//+------------------------------------------------------------------+ //| MTF_Stochastic.mq4 | //| Copyright © 2006, Keris2112 | //+------------------------------------------------------------------+ //2008fxtsd ki #property copyright "Copyright © 2006, Keris2112" #property link "http://www.forex-tsd.com" #property indicator_separate_window #property indicator_buffers 3 #property indicator_color1 Blue #property indicator_color2 Red #property indicator_color3 DeepSkyBlue //#property indicator_style2 2 #property indicator_level1 80 #property indicator_level2 50 #property indicator_level3 20 #property indicator_levelcolor DarkSlateGray //---- extern int TimeFrame=60; extern int KPeriod=8; extern int DPeriod=3; extern int Slowing=3; extern int MAMethod=0; extern int PriceField=1; extern bool ShowDots =true; extern string PriceField_ = "0=Hi/Low 1=Close/Close"; extern string MA_Method_ = "SMA0 EMA1 SMMA2 LWMA3"; extern string TimeFrames = "M1;5,15,30,60H1;240H4;1440D1;10080W1;43200MN;0-currentTF"; double ExtMapBuffer1[]; double ExtMapBuffer2[]; double ExtMapBuffer3[]; //+---------------- int init() { SetIndexBuffer(0,ExtMapBuffer1); SetIndexStyle (0,DRAW_SECTION); SetIndexBuffer(1,ExtMapBuffer2); SetIndexStyle (1,DRAW_LINE); if (ShowDots) { SetIndexBuffer(2,ExtMapBuffer3); SetIndexStyle (2,DRAW_ARROW); SetIndexArrow (2,158); // 250 177 251 SetIndexShift (2,TimeFrame/Period()-1); SetIndexEmptyValue(2,EMPTY_VALUE); } TimeFrame =MathMax(TimeFrame,Period()); switch(TimeFrame) { case 1 : string TimeFrameStr="M1"; break; case 5 : TimeFrameStr="M5"; break; case 15 : TimeFrameStr="M15"; break; case 30 : TimeFrameStr="M30"; break; case 60 : TimeFrameStr="H1"; break; case 240 : TimeFrameStr="H4"; break; case 1440 : TimeFrameStr="D1"; break; case 10080 : TimeFrameStr="W1"; break; case 43200 : TimeFrameStr="MN"; break; default : TimeFrameStr="TF0"; } IndicatorShortName("Stochastic ("+KPeriod+","+DPeriod+","+Slowing+") "+TimeFrameStr); } return(0); //+--------------------- int start() { datetime TimeArray[]; int i,y,limit,counted_bars=IndicatorCounted(); if(counted_bars<0) return(-1); if(counted_bars>0) counted_bars--; ArrayCopySeries(TimeArray,MODE_TIME,Symbol(),TimeFrame); limit=Bars-counted_bars; limit=MathMax(limit,TimeFrame/Period()); for(i=0,y=0;i<limit;i++) { if (Time[i]<TimeArray[y]) y++; ExtMapBuffer1[i]=iStochastic(NULL,TimeFrame,KPeriod,DPeriod,Slowing,MAMethod,PriceField,0,y); ExtMapBuffer2[i]=iStochastic(NULL,TimeFrame,KPeriod,DPeriod,Slowing,MAMethod,PriceField,1,y); if(ShowDots && Time[i]==TimeArray[y]) ExtMapBuffer3[i]=ExtMapBuffer1[i]; } return(0); } //+------------------------------------------------------------------+
Sample
Analysis
Market Information Used:
Series array that contains open time of each bar
Indicator Curves created:
Indicators Used:
Stochastic oscillator
Custom Indicators Used:
Order Management characteristics:
Other Features: