//+------------------------------------------------------------------+ //| For__red_r2005.mq4 | //| Copyright © 2010, PapaYozh | //| * | //+------------------------------------------------------------------+ #property copyright "Copyright © 2010, PapaYozh" #property link "*" #property indicator_chart_window #property indicator_buffers 2 #property indicator_color1 Coral #property indicator_color2 CornflowerBlue #property indicator_width1 2 #property indicator_width2 2 // ---- buffers ---- double BuffD[]; double BuffM[]; //+------------------------------------------------------------------+ int init() { SetIndexBuffer(0,BuffD); SetIndexEmptyValue(0,EMPTY_VALUE); SetIndexStyle(0,DRAW_SECTION,EMPTY,EMPTY); SetIndexBuffer(1,BuffM); SetIndexEmptyValue(1,EMPTY_VALUE); SetIndexStyle(1,DRAW_SECTION,EMPTY,EMPTY); return(0); } // init() //+------------------------------------------------------------------+ int deinit() { return(0); } // deinit() //+------------------------------------------------------------------+ //+------------------------------------------------------------------+ int start() { int shift; shift = Bars - 1 - IndicatorCounted(); for ( ; shift>0 ; shift-- ) { if ( TimeDayOfYear(Time[shift]) != TimeDayOfYear(Time[shift-1]) ) { BuffD[shift] = Close[shift]; if ( TimeDayOfWeek(Time[shift-1]) == 1 ) BuffM[shift] = Close[shift]; else BuffM[shift] = EMPTY_VALUE; } else { BuffD[shift] = EMPTY_VALUE; BuffM[shift] = EMPTY_VALUE; } } return(0); } // start() //+------------------------------------------------------------------+