Very Nice Simple Stochastic Oscillator


Very Nice Simple Stochastic Oscillator
Very Nice Simple Stochastic Oscillator



// www.aflcode.com
periods = Param( "Periods", 15, 1, 200, 1 );
Ksmooth = Param( "%K avg", 3, 1, 200, 1 );
Dsmooth = Param( "%D avg", 3, 1, 200, 1 );
chg = Param("Future Change %", 0, -10, 10, 0.1 );

FutureC = LastValue( C ) * ( 1 + 0.01 * chg );
FutureH = LastValue( H ) * ( 1 + 0.01 * chg );
FutureL = LastValue( L ) * ( 1 + 0.01 * chg );

inputC = Ref( C, 1 );
inputH = Ref( H, 1 );
inputL = Ref( L, 1 );

inputC[ BarCount - 1 ] = FutureC;
inputH[ BarCount - 1 ] = FutureH;
inputL[ BarCount - 1 ] = FutureL;

StockKK = MA((inputC-LLV(inputL,periods))/(HHV(inputH,periods)-(LLV(inputL+.00001,periods))),Ksmooth)*100;
StocDDD = MA(StockKK,Dsmooth);

Plot( StockKK, "%k", colorBlue, styleLine );
Plot( StocDDD, "%D", colorOrange, styleLine );

Title = "Future price " + FutureC;
Previous
Next Post »