//+------------------------------------------------------------------+
//| MTF_FTLM_v2.mq4
//| by Zathar Modified by Simba
//+------------------------------------------------------------------+
#property indicator_separate_window
#property indicator_buffers 2
#property indicator_color1 Magenta
#property indicator_color2 Aqua
#property indicator_width1 2
#property indicator_width2 2
extern int TimeFrame=1440;
double ExtMapBuffer1[];
double ExtMapBuffer2[];
int init()
{
//---- indicator line
SetIndexBuffer(0,ExtMapBuffer1);
SetIndexStyle(0,DRAW_HISTOGRAM,STYLE_SOLID,2);
SetIndexBuffer(1,ExtMapBuffer2);
SetIndexStyle(1,DRAW_HISTOGRAM,STYLE_SOLID,2);
IndicatorShortName("MTF_FTLM_v2");
SetIndexLabel(0,"Up");
SetIndexLabel(1,"Dn");
}
//----
return(0);
int start()
{
datetime TimeArray[];
int i,shift,limit,y=0,counted_bars=IndicatorCounted();
ArrayCopySeries(TimeArray,MODE_TIME,Symbol(),TimeFrame);
limit=Bars-counted_bars;
for(i=0,y=0;i<limit;i++) {
if (Time[i]<TimeArray[y]) {y++;}
ExtMapBuffer1[i]=iCustom(NULL,TimeFrame,"FTLM",1,y);
ExtMapBuffer2[i]=iCustom(NULL,TimeFrame,"FTLM",0,y);
}
return(0);
}
Comments