Only small help and modifications,as specified by the thread owner
Similar Stochastic code,courtesy wisestocktrader site......................
http://www.wisest ocktra der.com/indicators/1149-stochastic
Similar Stochastic code,courtesy wisestocktrader site......................
http://www.wisest ocktra der.com/indicators/1149-stochastic
Code:
_SECTION_BEGIN("Stochastic");
periods = Param( "Periods", 15, 1, 200, 1 );
Ksmooth = Param( "%K avg", 3, 1, 200, 1 );
Dsmooth = Param( "%D avg", 3, 1, 200, 1 );
myStochD=StochD( periods , Ksmooth, DSmooth );
myStochK=StochK( periods , Ksmooth);
Overbought=80;
Oversold=20;
Buy = Cross(myStochK, myStochD );
Sell = Cross( myStochD, myStochK );
Plot( myStochD, "Stochastic %D"+_PARAM_VALUES(), ParamColor( "ColorD", colorRed ), ParamStyle("StyleD") );
Plot( myStochK, "Stochastic %K", ParamColor( "ColorK", colorGreen ), ParamStyle("StyleK") );
PlotShapes(IIf(Sell, shapeHollowDownArrow , shapeNone), colorRed);
PlotShapes(IIf(Buy, shapeHollowUpArrow , shapeNone), colorBlue);
Plot(Overbought,"Overbought Level",colorRed);
Plot(Oversold,"Oversold Level",colorGreen);
PlotOHLC( myStochK,myStochK,50,myStochK, "", colorRed, styleCloud | styleClipMinMax, 20, 80 );
PlotOHLC( myStochD,myStochD,50,myStochD, "", colorYellow, styleCloud | styleClipMinMax, 20, 80 );
PlotOHLC( Null,myStochD,myStochK,Null, "", colorBlue, styleCloud);
_SECTION_END();
MySto = oSlowK;
min = 100;
max = 0;
for value1=0 to MinMaxPeriod-1 begin
if min>MySto[value1] then min=MySto[value1];
if max<MySto[value1] then max=MySto[value1];
end;
range = max-min;