//+------------------------------------------------------------------+ //| MTF_Stochastic.mq4 | //| Copyright © 2006, Keris2112 | //+------------------------------------------------------------------+ #property copyright "Copyright © 2006, Keris2112" #property link "http://www.forex-tsd.com" #property indicator_separate_window #property indicator_buffers 2 #property indicator_color1 LightSeaGreen #property indicator_color2 Red #property indicator_level1 80 #property indicator_level2 20 #property indicator_maximum 100 #property indicator_minimum 0 //---- input parameters extern int TimeFrame=0; extern int KPeriod=5; extern int DPeriod=3; extern int Slowing=3; extern int MAMethod=0; extern int PriceField=0;// PriceField: 0=Hi/Low 1=Close/Close extern string note_TimeFrames = "M1;5,15,30,60H1;240H4;1440D1;10080W1;43200MN"; extern string __MA_Method = "SMA0 EMA1 SMMA2 LWMA3"; extern string __PriceField = "0=Hi/Low 1=Close/Close"; //extern string __Price = "0O,1C 2H3L,4Md 5Tp 6WghC: Md(HL/2)4,Tp(HLC/3)5,Wgh(HLCC/4)6"; double ExtMapBuffer1[]; double ExtMapBuffer2[]; //+------------------------------------------------------------------+ //| Custom indicator initialization function | //+------------------------------------------------------------------+ int init() { //---- indicator line SetIndexBuffer(0,ExtMapBuffer1); SetIndexStyle (0,DRAW_LINE); SetIndexBuffer(1,ExtMapBuffer2); SetIndexStyle (1,DRAW_LINE,STYLE_DOT); SetIndexLabel (0, "Stochastic("+KPeriod+","+DPeriod+","+Slowing+")TF"+TimeFrame+""); SetIndexLabel (1," Stochastic("+KPeriod+","+DPeriod+","+Slowing+")TF"+TimeFrame+""); 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,limit,y=0,counted_bars=IndicatorCounted(); 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); } 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: