//+------------------------------------------------------------------+ //| DayStochastic.mq4 | //| Copyright 2010-2015, Excstrategy | //| http://www.ExcStrategy.ru | //+------------------------------------------------------------------+ #property copyright "ExcStrategy" #property link "http://www.ExcStrategy.ru" #property version "1.1" #property description "Stochastic" #property strict //+------------------------------------------------------------------+ #property indicator_separate_window #property indicator_buffers 2 #property indicator_color1 Blue #property indicator_width1 1 #property indicator_color2 Red #property indicator_width2 1 #property indicator_minimum 0 #property indicator_maximum 100 #property indicator_level1 20.0 #property indicator_level2 80.0 #property indicator_levelcolor clrSilver #property indicator_levelstyle STYLE_DOT //---- input int InpDPeriod = 3; // D Period input int InpSlowing = 3; // Slowing extern int Method=0; extern int Price_field=0; //---- extern int DaysForCalculation=2; //---- buffers double Buffer1[]; double Buffer2[]; //+------------------------------------------------------------------+ //| | //+------------------------------------------------------------------+ int init() { IndicatorBuffers(2); //---- indicator lines SetIndexStyle(0,DRAW_LINE); SetIndexBuffer(0,Buffer1); SetIndexStyle(1,DRAW_LINE); SetIndexBuffer(1,Buffer2); //---- SetIndexLabel(0,"Stochastic"); SetIndexLabel(0,"Signal"); //--- DaysForCalculation=DaysForCalculation+1; //---- return(0); } //+------------------------------------------------------------------+ //| | //+------------------------------------------------------------------+ int start() { if(Period()>1400) { Alert("Error! Period can not be greater than D1"); return(0); } //---- int counted_bars=IndicatorCounted(); int barsday; bool rangeday; datetime Time1=Time[0],Time2; //---- if(counted_bars>0) counted_bars--; int limit=Bars-counted_bars; //---- for(int i=0; i