//+------------------------------------------------------------------+ //| HourStrip.mq4 | //| Alexandr Shvedenko | //| http://www.metaquotes.net | //+------------------------------------------------------------------+ #property copyright "Alexandr Shvedenko" #property link "http://www.metaquotes.net" #property indicator_chart_window #property indicator_minimum 0 #property indicator_maximum 2 #property indicator_buffers 2 #property indicator_color1 Blue #property indicator_color2 Red extern int SSP=300; extern int OpenMoning=8; extern int CloseMoning=10; extern int OpenEvning=14; extern int CloseEvning=17; int ind_buffer1[]; int ind_buffer2[]; //+------------------------------------------------------------------+ //| Custom indicator initialization function | //+------------------------------------------------------------------+ int init() { //---- indicators IndicatorBuffers(2); SetIndexStyle(0, DRAW_LINE,STYLE_SOLID,20); SetIndexStyle(1, DRAW_SECTION,STYLE_SOLID,5); // SetIndexArrow(0, 217); // SetIndexArrow(1, 218); // SetIndexShift(0,ind_buffer1); // SetIndexShift(1,ind_buffer2); //SetIndexDrawBegin(1,1); //SetIndexDrawBegin(2,1); // SetIndexBuffer(0,ind_buffer1); // SetIndexBuffer(1,ind_buffer2); //---- indicator buffers mapping if(!SetIndexBuffer(0,ind_buffer1) && !SetIndexBuffer(1,ind_buffer2)) Print("cannot set indicator buffers!"); //---- // SetIndexDrawBegin(0,ind_buffer1); // SetIndexDrawBegin(1,ind_buffer2); return(0); } //+------------------------------------------------------------------+ //| Custom indicator iteration function | //+------------------------------------------------------------------+ int start() {int limit,n,ho,lo; int counted_bars=IndicatorCounted(); if (counted_bars<0) return (-1); if (counted_bars>0) counted_bars--; limit=Bars-counted_bars; //---- indicator calculation for(int i=limit; i>=0; i--) { if (TimeHour(Time[i])>=OpenMoning && TimeHour(Time[i])<=CloseMoning ) ind_buffer1[i]=Low[i]-0.0007; else ind_buffer1[i]=0; //---------------------- if (TimeHour(Time[i])>=OpenEvning && TimeHour(Time[i])