//_Trend History.mq4 _________\¦/ //_http://www.forex-tsd.com__(ò ó) //______________________o0o___(_)___o0o__ //___¦_____¦_____¦_____¦_____¦_____¦_____¦ //¦_____¦_____¦_____¦_____¦_____¦_____¦__ //___¦_____¦_____¦_____¦_____¦_____¦_____¦ //¦_____¦_____¦_____¦_____¦_____¦_____¦__ #property copyright "Baba_master" #property indicator_separate_window #property indicator_buffers 8 #property indicator_color1 Red #property indicator_color2 Lime #property indicator_color3 Red #property indicator_color4 White #property indicator_color5 Lime #property indicator_color6 Lime #property indicator_color7 Red #property indicator_color8 Tan double ExtMapBuffer0[]; double ExtMapBuffer1[]; double ExtMapBuffer2[]; double ExtMapBuffer3[]; double ExtMapBuffer4[]; double ExtMapBuffer5[]; double ExtMapBuffer6[]; double ExtMapBuffer7[]; double buf0,buf1,buf2,buf3,buf4,buf5,buf6,buf7; extern int TF=0; extern int Lsma_period = 300; extern int Lsma_slope = 10; extern int Lenght=10; extern double KV=1.0; extern int Mode=0; extern int jma=5; int init(){ int ArrSize = 159; SetIndexBuffer(0,ExtMapBuffer0); SetIndexBuffer(1,ExtMapBuffer1); SetIndexBuffer(2,ExtMapBuffer2); SetIndexBuffer(7,ExtMapBuffer3); SetIndexBuffer(3,ExtMapBuffer4); SetIndexBuffer(5,ExtMapBuffer5); SetIndexBuffer(6,ExtMapBuffer6); SetIndexBuffer(4,ExtMapBuffer7); SetIndexStyle(0,DRAW_HISTOGRAM,STYLE_SOLID,2); SetIndexStyle(1,DRAW_HISTOGRAM,STYLE_SOLID,2); SetIndexStyle(2,DRAW_HISTOGRAM,STYLE_SOLID,2); SetIndexStyle(7,DRAW_ARROW,0,2); SetIndexStyle(3,DRAW_HISTOGRAM,STYLE_SOLID,2); SetIndexStyle(5,DRAW_ARROW,0,2); SetIndexStyle(6,DRAW_ARROW,0,2); SetIndexStyle(4,DRAW_HISTOGRAM,STYLE_SOLID,2); SetIndexArrow(7,ArrSize); SetIndexArrow(5,ArrSize); SetIndexArrow(6,ArrSize); IndicatorShortName("Trend_History"); return(0);} int start(){ datetime TimeArray[]; int i,limit,y=0,counted_bars=IndicatorCounted(); ArrayCopySeries(TimeArray,MODE_TIME,Symbol(),TF); limit=Bars-1; for(i=0,y=0;i<limit;i++) {while (Time[i]<TimeArray[y]) y++; buf0=iCustom(Symbol(),TF,"LSMA in Color3",Lsma_period,0,0,y); buf2=iCustom(Symbol(),TF,"StepMA",Lenght,KV,0,Mode,0,0,false,2,0,1,y); buf3=iCustom(Symbol(),TF,"StepMA",Lenght,KV,0,Mode,0,0,false,2,0,2,y); buf4=iCustom(Symbol(),TF,"StepMA",Lenght,KV,0,Mode,0,0,false,0,0,0,y); buf5=iCustom(Symbol(),TF,"LSMA in Color3",Lsma_slope,0,0,y); buf6=iCustom(Symbol(),TF,"LSMA in Color3",Lsma_slope,0,0,y+1); buf7=iCustom(NULL,TF,"JJMA",jma,0,0,0,0,y); if ((buf2>=buf3)&&(buf4>Close[y])) {ExtMapBuffer0[i]=buf0; ExtMapBuffer1[i]=EMPTY_VALUE; ExtMapBuffer2[i]=EMPTY_VALUE; ExtMapBuffer7[i]=EMPTY_VALUE; ExtMapBuffer4[i]=EMPTY_VALUE;} if ((buf2<=buf3)&&(buf4<Close[y])) {ExtMapBuffer1[i]=buf0; ExtMapBuffer0[i]=EMPTY_VALUE; ExtMapBuffer2[i]=EMPTY_VALUE; ExtMapBuffer7[i]=EMPTY_VALUE; ExtMapBuffer4[i]=EMPTY_VALUE;} if((buf3>buf2)&&(buf4>=Close[y])) {ExtMapBuffer7[i]=buf0; ExtMapBuffer1[i]=EMPTY_VALUE; ExtMapBuffer0[i]=EMPTY_VALUE; ExtMapBuffer2[i]=EMPTY_VALUE; ExtMapBuffer4[i]=EMPTY_VALUE;} if((buf3<buf2)&&(buf4<=Close[y])) {ExtMapBuffer2[i]=buf0; ExtMapBuffer1[i]=EMPTY_VALUE; ExtMapBuffer0[i]=EMPTY_VALUE; ExtMapBuffer4[i]=EMPTY_VALUE; ExtMapBuffer7[i]=EMPTY_VALUE;} if((buf3==buf2)) {ExtMapBuffer4[i]=buf0; ExtMapBuffer1[i]=EMPTY_VALUE; ExtMapBuffer0[i]=EMPTY_VALUE; ExtMapBuffer7[i]=EMPTY_VALUE; ExtMapBuffer2[i]=EMPTY_VALUE;} ExtMapBuffer3[i]=buf7; if((buf5>=buf6)) {ExtMapBuffer5[i]=buf0; ExtMapBuffer6[i]=EMPTY_VALUE;} if((buf5<=buf6)) {ExtMapBuffer6[i]=buf0; ExtMapBuffer5[i]=EMPTY_VALUE;}} return(0); } //+------------------------------------------------------------------+
Sample
Analysis
Market Information Used:
Series array that contains open time of each bar
Series array that contains close prices for each bar
Indicator Curves created:
Implements a curve of type DRAW_HISTOGRAM
Implements a curve of type DRAW_ARROW
Indicators Used:
Custom Indicators Used:
LSMA in Color3
JJMA
stepma
Order Management characteristics:
Other Features: