//+------------------------------------------------------------------+ //| SUPRESMultiFrame.mq4 | //| | //| RD | //+------------------------------------------------------------------+ #property copyright "RD" #property link "marynarz15@wp.pl" #property indicator_chart_window #define MaxObject 1000 //---- indicator parameters extern int TimeFrame=15; extern int BarsMax=144; extern int ExtDepth=13; extern int ExtDeviation=1; extern int ExtBackstep=5; extern bool DeleteObjectsOnExit=true; extern color LineColor1=RosyBrown; extern color LineColor5=Aqua; extern color LineColor15=DeepPink; extern color LineColor30=PaleVioletRed; extern color LineColor60=Red; extern color LineColor240=DarkOrange; extern color LineColor1440=DeepSkyBlue; extern color LineColor10080=Lime; //----------------------- double ExtMapBuffer[]; double ExtMapBuffer2[]; int SUPRESCount=0; int linewidth; string NamePattern; color LineColor; //+------------------------------------------------------------------+ //| Delete objects | //+------------------------------------------------------------------+ int DeleteSupRes() { int ObjectCount=ObjectsTotal(); string names[MaxObject]; for (int i=0; i=0; shift--) { val=iLow(NULL,TimeFrame,Lowest(NULL,TimeFrame,MODE_LOW,ExtDepth,shift)); if(val==lastlow) val=0.0; else { lastlow=val; if((iLow(NULL,TimeFrame,shift)-val)>(ExtDeviation*Point)) val=0.0; else { for(back=1; back<=ExtBackstep; back++) { res=ExtMapBuffer[shift+back]; if((res!=0)&&(res>val)) ExtMapBuffer[shift+back]=0.0; } } } ExtMapBuffer[shift]=val; //--- high val=iHigh(NULL,TimeFrame,Highest(NULL,TimeFrame,MODE_HIGH,ExtDepth,shift)); if(val==lasthigh) val=0.0; else { lasthigh=val; if((val-iHigh(NULL,TimeFrame,shift))>(ExtDeviation*Point)) val=0.0; else { for(back=1; back<=ExtBackstep; back++) { res=ExtMapBuffer2[shift+back]; if((res!=0)&&(res=0; shift--) { curlow=ExtMapBuffer[shift]; curhigh=ExtMapBuffer2[shift]; if((curlow==0)&&(curhigh==0)) continue; //--- if(curhigh!=0) { if(lasthigh>0) { if(lasthigh0) { if(lastlow>curlow) ExtMapBuffer[lastlowpos]=0; else ExtMapBuffer[shift]=0; } //--- if((curlow=0; shift--) { if(shift>=iBars(NULL,TimeFrame)-ExtDepth) ExtMapBuffer[shift]=0.0; else { res=ExtMapBuffer2[shift]; if(res!=0.0) ExtMapBuffer[shift]=res; } } ///////////////////////// Lines creation ///////////////// int count=0; double TempBufferPrice[MaxObject]; int TempBufferBar[MaxObject]; string ObjectNames[MaxObject]; //////////////////////// lists of lines ////////////////// for(shift=BarsMax; shift>0; shift--) if (ExtMapBuffer[shift]>0) { count++; TempBufferPrice[count-1]=ExtMapBuffer[shift]; TempBufferBar[count-1]=shift; } for(int i=0; i