Skip to main content

Predicted Stochastic for Amibroker (AFL)

mena over 6 years ago Amibroker (AFL)

  • Rating:
    5 / 5 (Votes 2)
  • Tags:
    oscillator, amibroker

Plots a predicted stochastic indicator based on the predicted price change. The predicted price change is entered via the parameters

Indicator / Formula

Copy & Paste Friendly
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;

1 comments

Leave Comment

Please login here to leave a comment.