//+------------------------------------------------------------------+ //| SRM-TL.mq4 | //| http://www.metaquotes.net | //+------------------------------------------------------------------+ #property indicator_separate_window #property indicator_minimum 0 #property indicator_maximum 1 #property indicator_buffers 3 #property indicator_color1 Red #property indicator_color2 Green #property indicator_color3 Gold //---- input parameters //---- buffers double ExtMapBuffer1[]; double ExtMapBuffer2[]; double ExtMapBuffer3[]; string TimeFrameStr; //+------------------------------------------------------------------+ //| Custom indicator initialization function | //+------------------------------------------------------------------+ int init() { //---- indicators SetIndexStyle(0,DRAW_HISTOGRAM,STYLE_SOLID,5,Red); SetIndexBuffer(0,ExtMapBuffer1); SetIndexStyle(1,DRAW_HISTOGRAM,STYLE_SOLID,5, Green); SetIndexBuffer(1,ExtMapBuffer2); SetIndexStyle(2,DRAW_HISTOGRAM,STYLE_SOLID,5, Gold); SetIndexBuffer(2,ExtMapBuffer3); IndicatorShortName("TrendLordBars"); //---- return(0); } //+------------------------------------------------------------------+ //| Custom indicator deinitialization function | //+------------------------------------------------------------------+ int deinit() { //---- //---- return(0); } //+------------------------------------------------------------------+ //| Custom indicator iteration function | //+------------------------------------------------------------------+ int start() { int counted_bars=IndicatorCounted(); //---- for (int i = 0; i < 2500; i++){ ExtMapBuffer1[i]=0; ExtMapBuffer2[i]=0; ExtMapBuffer3[i]=0; double tlbuy=iCustom(NULL,0,"TrendLord",50,1,i); double tlsell=iCustom(NULL,0,"TrendLord",50,2,i); double haOpen = iCustom(NULL,0,"Heiken Ashi",2,i); double haClose = iCustom(NULL,0,"Heiken Ashi",3,i); double wbuy=iCustom(NULL,0,"W-LNX",14,6,25,true,50,14,34,14,14,6,14,6,14,6,14,6,14,6,14,6,14,6,6,i); double wsell=iCustom(NULL,0,"W-LNX",14,6,25,true,50,14,34,14,14,6,14,6,14,6,14,6,14,6,14,6,14,6,7,i); if((haOpen0 && tlsell==EMPTY_VALUE) && wbuy!=EMPTY_VALUE)) ExtMapBuffer2[i] = 1; if((haOpen>haClose && (tlbuy==EMPTY_VALUE && tlsell>0)&& wsell!=EMPTY_VALUE ))ExtMapBuffer1[i] = 1; if (ExtMapBuffer2[i]==0 && ExtMapBuffer1[i]==0) ExtMapBuffer3[i]=1; } //---- return(0); } //+------------------------------------------------------------------+