Kperiods = Param( "K Periods", 5, 1, 200, 1 );
Dperiods = Param( "D Periods", 3, 1, 200, 1 );
Ksmooth = Param( "%K avg", 2, 1, 200, 1 );
Dsmooth = Param( "%D avg", 2, 1, 200, 1 );
myStochD =StochD( dperiods , Ksmooth, DSmooth );
myStochK =StochK( kperiods , Ksmooth);
Overbought = 80 ;
Oversold =20 ;
Center = 50 ;
Plot( myStochD, "Stochastic %D"+_PARAM_VALUES( ), ParamColor( "ColorD", colorRed ), ParamStyle(" StyleD") );
Plot( myStochK, "Stochastic %K", ParamColor( "ColorK", colorBlue ), ParamStyle(" StyleK") );