//+------------------------------------------------------------------+ //| TimeWindows.mq4 | //| Programando Forex | //| http://www.programandoforex.com | //+------------------------------------------------------------------+ // El indicador muestra si estamos dentro de una de las ventanas temporales habilitadas (colores verde/rojo). #property copyright "Programando Forex" #property link "http://www.programandoforex.com" #property indicator_separate_window #property indicator_buffers 3 #property indicator_color1 Green #property indicator_color2 Red #property indicator_color3 Yellow #property indicator_width1 4 #property indicator_width2 4 #property indicator_width3 4 #property indicator_minimum 0 #property indicator_maximum 1 //---- buffers double GreenBuffer[]; double RedBuffer[]; double YellowBuffer[]; extern string Window_Ini= "10:10"; extern string Window_Fin = "20:20"; int init() { IndicatorBuffers(3); SetIndexStyle(0,DRAW_HISTOGRAM); SetIndexStyle(1,DRAW_HISTOGRAM); SetIndexStyle(2,DRAW_HISTOGRAM); SetIndexBuffer(0,GreenBuffer); SetIndexBuffer(1,RedBuffer); SetIndexBuffer(2,YellowBuffer); string short_name="TimeWindows"; IndicatorShortName(short_name); } int start() { int limit; int counted_bars=IndicatorCounted(); //---- last counted bar will be recounted if(counted_bars>0) counted_bars--; limit=Bars-counted_bars; for(int i=0; i oTimeIni) oTimeFin += 86400; // 60s * 60m * 24H if(oTimeBarra < oTimeIni) oTimeIni -= 86400; } if(oTimeIni < oTimeBarra && oTimeBarra < oTimeFin) return(1); else return(0); }