//+------------------------------------------------------------------+ //| PricePercentRange.mq4 | //| Copyright 2015, MetaQuotes Software Corp. | //| http://www.mql5.com | //| https://www.mql5.com/en/users/3rjfx | //+------------------------------------------------------------------+ #property copyright "https://www.mql5.com/en/users/3rjfx. ~ By 3rjfx ~ Created: 2015/12/20" #property link "http://www.mql5.com" #property link "https://www.mql5.com/en/users/3rjfx" #property version "2.00" #property strict //-- #property description "Price(%)Range is the indicator for the MT4, which calculates the price movement" #property description "based on percentage High (Highest) and Low (Lowest) price on 100 bars." /* //--Update 01: Update 1 (22/01/2016) : Added SwingBars and Vertical Line on the chart. */ //-- //--- #property indicator_separate_window #property indicator_buffers 9 //--- extern ENUM_APPLIED_PRICE Price = PRICE_TYPICAL; // Price extern bool SoundAlerts = true; extern bool MsgAlerts = true; extern bool eMailAlerts = false; extern string SoundAlertFile = "alert.wav"; extern color MoveUpColor = clrBlue; extern color MoveDownColor = clrRed; extern color WaitDirectionColor = clrYellow; extern color MoveLinkColor = clrAqua; extern color TextColor = clrSnow; extern color RoundedColor = clrYellow; extern color BorderlinePricesRise = clrBlue; extern color BorderlinePricesDown = clrRed; extern int LineWidthSize = 1; extern color TrendLineDowntoUpColor = clrBlue; extern color TrendLineUptoDownColor = clrRed; extern color VerticalLineColor = clrGold; extern ENUM_LINE_STYLE LineStyle = STYLE_SOLID; extern ENUM_ANCHOR_POINT TextPosition = ANCHOR_RIGHT; extern int TextFontSize = 8; extern string TextFontName = "Arial Black"; //"Courier" //"Calibri" //"Cambria" //"Bodoni MT Black" extern int TopBottomDotSize = 15; //-- //--- the Main arrays buffers double ExtCPRBuffer[]; double ExtHPRBuffer[]; double ExtMHPRBuffer[]; double ExtMDPBuffer[]; double ExtMLPRBuffer[]; double ExtLPRBuffer[]; double ExtEMABuffer[]; double ExtEMABuffUp[]; double ExtEMABuffDn[]; double ema04[]; double ema24[]; double ema39[]; //-- double cph; double cpl; double cpr0; double cpr1; //-- double tpb0p1; double tpt0p1; double tpb0p2; double tpt0p2; //-- datetime fb0p1; datetime ft0p1; datetime fb0p2; datetime ft0p2; //-- bool barUp; bool barDn; //--- spacing & coordinate int scaleYt=18; int offsetX=171; int offsetY=3; int fontSize=9; int corner=1; color arrow; //--- bars maximum for calculation int DATA_LIMIT; int bigema=39; int medema=24; int smlema=4; int barcnt; int hilo; int pos; int prvup; int prvdn; //-- int cal; int pal; int cmnt; int pmnt; //-- long chart_ID; string short_name; string alBase,alSubj,alMsg; //--- //+------------------------------------------------------------------+ //| Custom indicator initialization function | //+------------------------------------------------------------------+ int OnInit() { //--- indicator buffer mapping IndicatorBuffers(9); //-- short_name=StringConcatenate("Price(%R,",_Symbol,",TF:",strTF(_Period),")"); chart_ID=ChartID(); DATA_LIMIT=135; barcnt=DATA_LIMIT-1; hilo=100; pos=0; //--- set levels - color - levelstyle IndicatorSetInteger(INDICATOR_LEVELS,4); IndicatorSetDouble(INDICATOR_LEVELVALUE,0,23.6); IndicatorSetDouble(INDICATOR_LEVELVALUE,1,38.2); IndicatorSetDouble(INDICATOR_LEVELVALUE,2,61.8); IndicatorSetDouble(INDICATOR_LEVELVALUE,3,76.4); //-- IndicatorSetInteger(INDICATOR_LEVELCOLOR,clrLightSlateGray); IndicatorSetInteger(INDICATOR_LEVELSTYLE,STYLE_SOLID); //--- set maximum and minimum for subwindow IndicatorSetDouble(INDICATOR_MINIMUM,0); IndicatorSetDouble(INDICATOR_MAXIMUM,100); //-- //--- SetIndexBuffer(0,ExtEMABuffer); // Moving Average 39 SetIndexBuffer(1,ExtCPRBuffer); // Current Price%R value SetIndexBuffer(2,ExtHPRBuffer); // High Price%R value SetIndexBuffer(3,ExtMHPRBuffer); // Medium High Price%R value SetIndexBuffer(4,ExtMDPBuffer); // Medium Price%R value SetIndexBuffer(5,ExtMLPRBuffer); // Medium Low Price%R value SetIndexBuffer(6,ExtLPRBuffer); // Low Price%R value SetIndexBuffer(7,ExtEMABuffUp); // Moving Average 39 Up SetIndexBuffer(8,ExtEMABuffDn); // Moving Average 39 Down //-- indicator drawing shape styles SetIndexStyle(0,DRAW_LINE,STYLE_SOLID,LineWidthSize,MoveLinkColor); SetIndexStyle(1,DRAW_LINE,STYLE_SOLID,LineWidthSize,MoveLinkColor); SetIndexStyle(2,DRAW_LINE,STYLE_SOLID,LineWidthSize,MoveUpColor); SetIndexStyle(3,DRAW_LINE,STYLE_SOLID,LineWidthSize,MoveUpColor); SetIndexStyle(4,DRAW_LINE,STYLE_SOLID,LineWidthSize,WaitDirectionColor); SetIndexStyle(5,DRAW_LINE,STYLE_SOLID,LineWidthSize,MoveDownColor); SetIndexStyle(6,DRAW_LINE,STYLE_SOLID,LineWidthSize,MoveDownColor); SetIndexStyle(7,DRAW_LINE,STYLE_SOLID,2,BorderlinePricesRise); SetIndexStyle(8,DRAW_LINE,STYLE_SOLID,2,BorderlinePricesDown); //-- SetIndexLabel(0,NULL); SetIndexLabel(1,"Price(%)R"); SetIndexLabel(2,NULL); SetIndexLabel(3,NULL); SetIndexLabel(4,NULL); SetIndexLabel(5,NULL); SetIndexLabel(6,NULL); SetIndexLabel(7,"(%R)Ups"); SetIndexLabel(8,"(%R)Down"); //-- IndicatorDigits(_Digits); IndicatorShortName(short_name); //-- //--- initialization done //--- return(INIT_SUCCEEDED); } //+------------------------------------------------------------------+ //| Custom indicator deinitialization function | //+------------------------------------------------------------------+ void OnDeinit(const int reason) { //---- ObjectsDeleteAll(); GlobalVariablesDeleteAll(); //---- return; } //+------------------------------------------------------------------+ //| Custom indicator iteration function | //+------------------------------------------------------------------+ int OnCalculate(const int rates_total, const int prev_calculated, const datetime &time[], const double &open[], const double &high[], const double &low[], const double &close[], const long &tick_volume[], const long &volume[], const int &spread[]) { //---- //-- ResetLastError(); RefreshRates(); //-- if(rates_total=pos; i--) {ema04[i]=iMA(_Symbol,0,4,0,1,5,i);} //-- for(i=barcnt; i>=pos; i--) {ema24[i]=iMAOnArray(ema04,0,24,0,1,i);} for(i=barcnt; i>=pos; i--) {ema39[i]=iMAOnArray(ema24,0,39,0,1,i);} //-- int inH=iHighest(_Symbol,0,MODE_HIGH,hilo,pos); int inL=iLowest(_Symbol,0,MODE_LOW,hilo,pos); if(inH>=0) cph=iHigh(_Symbol,0,inH); if(inL>=0) cpl=iLow(_Symbol,0,inL); //-- double ma24d[],ma04d[]; ArrayResize(ma24d,DATA_LIMIT); ArrayResize(ma04d,DATA_LIMIT); ArraySetAsSeries(ma24d,true); ArraySetAsSeries(ma04d,true); //--- //--- if(!IsStopped()) { for(z=0; z=0) tpttest=iHigh(_Symbol,0,ft0); if(fb0>=0) tpbtest=iLow(_Symbol,0,fb0); //-- if((tpttest>=iHigh(_Symbol,0,iHighest(_Symbol,0,MODE_HIGH,scan,ft0+1))) && (tpbtest<=iLow(_Symbol,0,iLowest(_Symbol,0,MODE_LOW,scan,fb0+1)))) { tpt0=iHigh(_Symbol,0,ft0); tpb0=iLow(_Symbol,0,fb0); break; } else {xhilo=xbars+(tunebar*z);} //-- } } //-- //-- if(ft0fb0) { //-- barUp=true; barDn=false; fb0p2=time[fb0]; tpb0p2=tpb0; ft0p2=time[ft0]; tpt0p2=tpt0; prvup=1; //-- string objnameUp10_=short_name+": VerticalLineSwingBarsDn1_"; string objnameUp20_=short_name+": VerticalLineSwingBarsDn2_"; string objname11=short_name+": TrendSwingBarsDown"; string objname21=short_name+": SwingBarsPosTop1"; string objname31=short_name+": SwingBarsPosBottom1"; ObjectDelete(objname11); ObjectDelete(objname21); ObjectDelete(objname31); ObjectDelete(objnameUp10_); ObjectDelete(objnameUp20_); //-- ObjectCreate(chart_ID,objnameUp10_,OBJ_VLINE,0,time[ft0],0); ObjectSetInteger(chart_ID,objnameUp10_,OBJPROP_COLOR,VerticalLineColor); ObjectSetInteger(chart_ID,objnameUp10_,OBJPROP_STYLE,LineStyle); ObjectSetInteger(chart_ID,objnameUp10_,OBJPROP_WIDTH,LineWidthSize); ObjectSetInteger(chart_ID,objnameUp10_,OBJPROP_HIDDEN,true); //-- ObjectCreate(chart_ID,objnameUp20_,OBJ_VLINE,0,time[fb0],0); ObjectSetInteger(chart_ID,objnameUp20_,OBJPROP_COLOR,VerticalLineColor); ObjectSetInteger(chart_ID,objnameUp20_,OBJPROP_STYLE,LineStyle); ObjectSetInteger(chart_ID,objnameUp20_,OBJPROP_WIDTH,LineWidthSize); ObjectSetInteger(chart_ID,objnameUp20_,OBJPROP_HIDDEN,true); //--- ObjectCreate(chart_ID,objname11,OBJ_TREND,0,time[ft0],tpt0,time[fb0],tpb0); ObjectSetInteger(chart_ID,objname11,OBJPROP_COLOR,TrendLineUptoDownColor); ObjectSetInteger(chart_ID,objname11,OBJPROP_RAY_RIGHT,false); ObjectSetInteger(chart_ID,objname11,OBJPROP_STYLE,LineStyle); ObjectSetInteger(chart_ID,objname11,OBJPROP_WIDTH,LineWidthSize); ObjectSetInteger(chart_ID,objname11,OBJPROP_HIDDEN,true); //-- ObjectCreate(chart_ID,objname21,OBJ_TEXT,0,time[ft0],tpt0); ObjectSetString(chart_ID,objname21,OBJPROP_TEXT,CharToStr(119)); ObjectSetString(chart_ID,objname21,OBJPROP_FONT,"Wingdings"); ObjectSetInteger(chart_ID,objname21,OBJPROP_FONTSIZE,TopBottomDotSize); ObjectSetInteger(chart_ID,objname21,OBJPROP_COLOR,TrendLineUptoDownColor); ObjectSetInteger(chart_ID,objname21,OBJPROP_ANCHOR,ANCHOR_CENTER); ObjectSetInteger(chart_ID,objname21,OBJPROP_HIDDEN,true); //-- ObjectCreate(chart_ID,objname31,OBJ_TEXT,0,time[fb0],tpb0); ObjectSetString(chart_ID,objname31,OBJPROP_TEXT,CharToStr(119)); ObjectSetString(chart_ID,objname31,OBJPROP_FONT,"Wingdings"); ObjectSetInteger(chart_ID,objname31,OBJPROP_FONTSIZE,TopBottomDotSize); ObjectSetInteger(chart_ID,objname31,OBJPROP_COLOR,TrendLineDowntoUpColor); ObjectSetInteger(chart_ID,objname31,OBJPROP_ANCHOR,ANCHOR_CENTER); ObjectSetInteger(chart_ID,objname31,OBJPROP_HIDDEN,true); //-- //--- if((barUp) && (prvdn==1)) { //-- prvdn=0; //-- string objnameDn1p=short_name+": VerticalLineSwingBarsUp1-"; string objnameDn2p=short_name+": VerticalLineSwingBarsUp2-"; string objname11p=short_name+": TrendSwingBarsUp1"; string objname21p=short_name+": SwingBarsPosTop1p"; string objname31p=short_name+": SwingBarsPosBottom1p"; string objname41p=short_name+": AverageVolumeSwingBarsUp1p"; //-- ObjectCreate(chart_ID,objnameDn1p+string(TimeToString(fb0p1,TIME_DATE|TIME_MINUTES)),OBJ_VLINE,0,fb0p1,0); ObjectSetInteger(chart_ID,objnameDn1p+string(TimeToString(fb0p1,TIME_DATE|TIME_MINUTES)),OBJPROP_COLOR,VerticalLineColor); ObjectSetInteger(chart_ID,objnameDn1p+string(TimeToString(fb0p1,TIME_DATE|TIME_MINUTES)),OBJPROP_STYLE,LineStyle); ObjectSetInteger(chart_ID,objnameDn1p+string(TimeToString(fb0p1,TIME_DATE|TIME_MINUTES)),OBJPROP_WIDTH,LineWidthSize); ObjectSetInteger(chart_ID,objnameDn1p+string(TimeToString(fb0p1,TIME_DATE|TIME_MINUTES)),OBJPROP_HIDDEN,true); //-- ObjectCreate(chart_ID,objnameDn2p+string(TimeToString(ft0p1,TIME_DATE|TIME_MINUTES)),OBJ_VLINE,0,ft0p1,0); ObjectSetInteger(chart_ID,objnameDn2p+string(TimeToString(ft0p1,TIME_DATE|TIME_MINUTES)),OBJPROP_COLOR,VerticalLineColor); ObjectSetInteger(chart_ID,objnameDn2p+string(TimeToString(ft0p1,TIME_DATE|TIME_MINUTES)),OBJPROP_STYLE,LineStyle); ObjectSetInteger(chart_ID,objnameDn2p+string(TimeToString(ft0p1,TIME_DATE|TIME_MINUTES)),OBJPROP_WIDTH,LineWidthSize); ObjectSetInteger(chart_ID,objnameDn2p+string(TimeToString(ft0p1,TIME_DATE|TIME_MINUTES)),OBJPROP_HIDDEN,true); //--- ObjectCreate(chart_ID,objname11p+string(TimeToString(fb0p1,TIME_DATE|TIME_MINUTES)),OBJ_TREND,0,fb0p1,tpb0p1,ft0p1,tpt0p1); ObjectSetInteger(chart_ID,objname11p+string(TimeToString(fb0p1,TIME_DATE|TIME_MINUTES)),OBJPROP_COLOR,TrendLineDowntoUpColor); ObjectSetInteger(chart_ID,objname11p+string(TimeToString(fb0p1,TIME_DATE|TIME_MINUTES)),OBJPROP_RAY_RIGHT,false); ObjectSetInteger(chart_ID,objname11p+string(TimeToString(fb0p1,TIME_DATE|TIME_MINUTES)),OBJPROP_STYLE,LineStyle); ObjectSetInteger(chart_ID,objname11p+string(TimeToString(fb0p1,TIME_DATE|TIME_MINUTES)),OBJPROP_WIDTH,LineWidthSize); ObjectSetInteger(chart_ID,objname11p+string(TimeToString(fb0p1,TIME_DATE|TIME_MINUTES)),OBJPROP_HIDDEN,true); //-- ObjectCreate(chart_ID,objname21p+string(TimeToString(ft0p1,TIME_DATE|TIME_MINUTES)),OBJ_TEXT,0,ft0p1,tpt0p1); ObjectSetString(chart_ID,objname21p+string(TimeToString(ft0p1,TIME_DATE|TIME_MINUTES)),OBJPROP_TEXT,CharToStr(119)); ObjectSetString(chart_ID,objname21p+string(TimeToString(ft0p1,TIME_DATE|TIME_MINUTES)),OBJPROP_FONT,"Wingdings"); ObjectSetInteger(chart_ID,objname21p+string(TimeToString(ft0p1,TIME_DATE|TIME_MINUTES)),OBJPROP_FONTSIZE,TopBottomDotSize); ObjectSetInteger(chart_ID,objname21p+string(TimeToString(ft0p1,TIME_DATE|TIME_MINUTES)),OBJPROP_COLOR,TrendLineUptoDownColor); ObjectSetInteger(chart_ID,objname21p+string(TimeToString(ft0p1,TIME_DATE|TIME_MINUTES)),OBJPROP_ANCHOR,ANCHOR_CENTER); ObjectSetInteger(chart_ID,objname21p+string(TimeToString(ft0p1,TIME_DATE|TIME_MINUTES)),OBJPROP_HIDDEN,true); //-- ObjectCreate(chart_ID,objname31p+string(TimeToString(fb0p1,TIME_DATE|TIME_MINUTES)),OBJ_TEXT,0,fb0p1,tpb0p1); ObjectSetString(chart_ID,objname31p+string(TimeToString(fb0p1,TIME_DATE|TIME_MINUTES)),OBJPROP_TEXT,CharToStr(119)); ObjectSetString(chart_ID,objname31p+string(TimeToString(fb0p1,TIME_DATE|TIME_MINUTES)),OBJPROP_FONT,"Wingdings"); ObjectSetInteger(chart_ID,objname31p+string(TimeToString(fb0p1,TIME_DATE|TIME_MINUTES)),OBJPROP_FONTSIZE,TopBottomDotSize); ObjectSetInteger(chart_ID,objname31p+string(TimeToString(fb0p1,TIME_DATE|TIME_MINUTES)),OBJPROP_COLOR,TrendLineDowntoUpColor); ObjectSetInteger(chart_ID,objname31p+string(TimeToString(fb0p1,TIME_DATE|TIME_MINUTES)),OBJPROP_ANCHOR,ANCHOR_CENTER); ObjectSetInteger(chart_ID,objname31p+string(TimeToString(fb0p1,TIME_DATE|TIME_MINUTES)),OBJPROP_HIDDEN,true); //-- } //--- } //--- //---- for(i=barcnt; i>=pos; i--) { //--- switch(Price) { case 0: cpr0=Close[i]; cpr1=Close[i+1]; break; case 1: cpr0=Open[i]; cpr1=Open[i+1]; break; case 2: cpr0=High[i]; cpr1=High[i+1]; break; case 3: cpr0=Low[i]; cpr1=Low[i+1]; break; case 4: cpr0=(High[i]+Low[i])/2; cpr1=(High[i+1]+Low[i+1])/2; break; case 5: cpr0=(High[i]+Low[i]+Close[i])/3; cpr1=(High[i+1]+Low[i+1]+Close[i+1])/3; break; case 6: cpr0=(High[i]+Low[i]+Close[i]+Close[i])/4; cpr1=(High[i+1]+Low[i+1]+Close[i+1]+Close[i+1])/4; break; } //-- ExtCPRBuffer[i]=((cpr0-cpl)/(cph-cpl))*100; ExtEMABuffer[i]=((ema39[i]-cpl)/(cph-cpl))*100; ma24d[i]=((ema24[i]-cpl)/(cph-cpl))*100; ma04d[i]=((ema04[i]-cpl)/(cph-cpl))*100; //-- if(ma04d[i]>ExtEMABuffer[i]) {ExtEMABuffUp[i]=ExtEMABuffer[i]; ExtEMABuffDn[i]=EMPTY_VALUE; arrow=clrBlue;} if(ma04d[i]ExtEMABuffer[i])&&(ma04d[i]>ma04d[i+1])) {ExtEMABuffUp[i]=ExtEMABuffer[i]; ExtEMABuffDn[i]=EMPTY_VALUE;} if((ma24d[i]=76.4) && (ExtCPRBuffer[i]<100.0)) { ExtHPRBuffer[i]=ExtCPRBuffer[i]; ExtMHPRBuffer[i]=EMPTY_VALUE; ExtMDPBuffer[i]=EMPTY_VALUE; ExtMLPRBuffer[i]=EMPTY_VALUE; ExtLPRBuffer[i]=EMPTY_VALUE; MoveLinkColor=MoveUpColor; } else if((ExtCPRBuffer[i]>=61.8) && (ExtCPRBuffer[i]<76.4)) { ExtHPRBuffer[i]=EMPTY_VALUE; ExtMHPRBuffer[i]=ExtCPRBuffer[i]; ExtMDPBuffer[i]=EMPTY_VALUE; ExtMLPRBuffer[i]=EMPTY_VALUE; ExtLPRBuffer[i]=EMPTY_VALUE; MoveLinkColor=MoveUpColor; } else if((ExtCPRBuffer[i]>=38.2) && (ExtCPRBuffer[i]<61.8)) { ExtHPRBuffer[i]=EMPTY_VALUE; ExtMHPRBuffer[i]=EMPTY_VALUE; ExtMDPBuffer[i]=ExtCPRBuffer[i]; ExtMLPRBuffer[i]=EMPTY_VALUE; ExtLPRBuffer[i]=EMPTY_VALUE; MoveLinkColor=WaitDirectionColor; } else if((ExtCPRBuffer[i]>=23.6) && (ExtCPRBuffer[i]<38.2)) { ExtHPRBuffer[i]=EMPTY_VALUE; ExtMHPRBuffer[i]=EMPTY_VALUE; ExtMDPBuffer[i]=EMPTY_VALUE; ExtMLPRBuffer[i]=ExtCPRBuffer[i]; ExtLPRBuffer[i]=EMPTY_VALUE; MoveLinkColor=MoveDownColor; } else if((ExtCPRBuffer[i]>=0.0) && (ExtCPRBuffer[i]<23.6)) { ExtHPRBuffer[i]=EMPTY_VALUE; ExtMHPRBuffer[i]=EMPTY_VALUE; ExtMDPBuffer[i]=EMPTY_VALUE; ExtMLPRBuffer[i]=EMPTY_VALUE; ExtLPRBuffer[i]=ExtCPRBuffer[i]; MoveLinkColor=MoveDownColor; } //-- //--- if(i==0) { //--- if(ExtCPRBuffer[i]>ExtCPRBuffer[i+1]) { //-- ObjectDelete(chart_ID,"txCons"+string(x)); ObjectDelete(chart_ID,"txCons"+string(x)+"a"); ObjectDelete(chart_ID,"txCons"+string(x)+"a"+"1"); //-- ObjectCreate(chart_ID,"txCons"+string(x),OBJ_LABEL,1,0,0); ObjectSetString(chart_ID,"txCons"+string(x),OBJPROP_FONT,"Wingdings"); ObjectSetString(chart_ID,"txCons"+string(x),OBJPROP_TEXT,CharToString(164)); ObjectSetInteger(chart_ID,"txCons"+string(x),OBJPROP_FONTSIZE,27); ObjectSetInteger(chart_ID,"txCons"+string(x),OBJPROP_COLOR,RoundedColor); ObjectSetInteger(chart_ID,"txCons"+string(x),OBJPROP_CORNER,corner); ObjectSetInteger(chart_ID,"txCons"+string(x),OBJPROP_XDISTANCE,offsetX-6); ObjectSetInteger(chart_ID,"txCons"+string(x),OBJPROP_YDISTANCE,scaleYt+offsetY+19); //-- ObjectCreate(chart_ID,"txCons"+string(x)+"a",OBJ_LABEL,1,0,0); ObjectSetString(chart_ID,"txCons"+string(x)+"a",OBJPROP_FONT,"Wingdings"); ObjectSetString(chart_ID,"txCons"+string(x)+"a",OBJPROP_TEXT,CharToString(217)); ObjectSetInteger(chart_ID,"txCons"+string(x)+"a",OBJPROP_FONTSIZE,20); ObjectSetInteger(chart_ID,"txCons"+string(x)+"a",OBJPROP_COLOR,arrow); ObjectSetInteger(chart_ID,"txCons"+string(x)+"a",OBJPROP_CORNER,corner); ObjectSetInteger(chart_ID,"txCons"+string(x)+"a",OBJPROP_XDISTANCE,offsetX-10); ObjectSetInteger(chart_ID,"txCons"+string(x)+"a",OBJPROP_YDISTANCE,offsetY+24); //-- if(cpr0>cpr1) { ObjectCreate(chart_ID,"txCons"+string(x)+"a"+"1",OBJ_LABEL,1,0,0); ObjectSetString(chart_ID,"txCons"+string(x)+"a"+"1",OBJPROP_TEXT,"UP"); ObjectSetString(chart_ID,"txCons"+string(x)+"a"+"1",OBJPROP_FONT,"Bodoni MT Black"); ObjectSetInteger(chart_ID,"txCons"+string(x)+"a"+"1",OBJPROP_FONTSIZE,7); ObjectSetInteger(chart_ID,"txCons"+string(x)+"a"+"1",OBJPROP_COLOR,TextColor); ObjectSetInteger(chart_ID,"txCons"+string(x)+"a"+"1",OBJPROP_CORNER,corner); ObjectSetInteger(chart_ID,"txCons"+string(x)+"a"+"1",OBJPROP_XDISTANCE,offsetX-14); ObjectSetInteger(chart_ID,"txCons"+string(x)+"a"+"1",OBJPROP_YDISTANCE,2*scaleYt+offsetY+33); } //-- else { ObjectCreate(chart_ID,"txCons"+string(x)+"a"+"1",OBJ_LABEL,1,0,0); ObjectSetString(chart_ID,"txCons"+string(x)+"a"+"1",OBJPROP_TEXT,"WAIT"); ObjectSetString(chart_ID,"txCons"+string(x)+"a"+"1",OBJPROP_FONT,"Bodoni MT Black"); ObjectSetInteger(chart_ID,"txCons"+string(x)+"a"+"1",OBJPROP_FONTSIZE,7); ObjectSetInteger(chart_ID,"txCons"+string(x)+"a"+"1",OBJPROP_COLOR,TextColor); ObjectSetInteger(chart_ID,"txCons"+string(x)+"a"+"1",OBJPROP_CORNER,corner); ObjectSetInteger(chart_ID,"txCons"+string(x)+"a"+"1",OBJPROP_XDISTANCE,offsetX-7); ObjectSetInteger(chart_ID,"txCons"+string(x)+"a"+"1",OBJPROP_YDISTANCE,2*scaleYt+offsetY+33); } } //--- else if(ExtCPRBuffer[i]ExtEMABuffer[i])&&(cpr0>cpr1)&&(ExtEMABuffUp[i]!=EMPTY_VALUE)) {cal=391;} if((ma04d[i+1]>=ExtEMABuffer[i+1])&&(ma04d[i]ExtEMABuffer[i])&&(ExtCPRBuffer[i]<80.0)&&(cpr0>cpr1)&&(ma04d[i]>ma04d[i+1])&&(ExtEMABuffUp[i]!=EMPTY_VALUE)) {cal=393;} if((ma04d[i]20.0)&&(cpr023.6)&&(ExtEMABuffer[i]>38.2)&&(cpr0>cpr1)) {cal=395;} if((ExtCPRBuffer[i+1]>76.4)&&(ExtCPRBuffer[i]<76.4)&&(ExtEMABuffer[i]<61.8)&&(cpr061.8)&&(ma04d[i]>ma04d[i+1])&&(cpr0>cpr1)) {cal=397;} if((ExtCPRBuffer[i]>76.4)&&(inH