//+------------------------------------------------------------------+ //| ShadowCandles.mq4 | //| Copyright © 2009, ПавелИванович (api) | //| p231970@hotmail.com | //+------------------------------------------------------------------+ #property copyright "Copyright © 2009, ПавелИванович (api)" #property link "p231970@hotmail.com" #property indicator_chart_window //---- input parameters extern int iPeriod=720; extern int tShift = 60; extern int iNumCandles=80; extern color BullCandle=Maroon; extern color BearCandle=Blue; extern color BullShadow=Maroon; extern color BearShadow=Blue; double data[][6]; bool ValidParams=true; //+------------------------------------------------------------------+ //| | //+------------------------------------------------------------------+ int init() { if(iPeriod<=Period()) ValidParams=false; if(MathMod(iPeriod,Period())!=0) ValidParams=false; if(MathMod(tShift,Period())!=0) ValidParams=false; ArrayResize(data,iNumCandles); } //+------------------------------------------------------------------+ //| Custom indicator deinitialization function | //+------------------------------------------------------------------+ int deinit() { for(int i=0;i0) counted_bars--; int limit=Bars-counted_bars; if(counted_bars==0) limit-=1; while(i=limit) break; time_0=MathFloor((1.0*Time[iBar]-tShift*60)/PerSec); time_0*=PerSec; time_0+=tShift*60; time_F=time_0+PerSec-Period()*60; iSh=iBarShift(NULL,0,time_0); dO=Open[iSh]; dC=Close[iBar]; dH=High[iHighest(NULL,0,MODE_HIGH,iSh+1-iBar,iBar)]; dL=Low[ iLowest( NULL,0,MODE_LOW, iSh+1-iBar,iBar)]; data[i][0]=time_0; data[i][1]=dO; data[i][2]=dL; data[i][3]=dH; data[i][4]=dC; data[i][5]=time_F; DrawCandle(i); if(i==0) if(last_time_0