Skip to main content

Stochastic new verrsion for Amibroker (AFL)

amiryazdanbakhsh about 10 years ago Amibroker (AFL)

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

Stochastic Momentum Oscillator is plotted in histogram format and color coded as follows

Green – Increasing Positive Momentum
Blue – Decreasing Positive Momentum (could lead to either potential reversal or sideways action if the trend is really strong)
Red – Increasing Negative Momentum
Yellow– Decreasing Negative Momentum (could lead to either potential reversal or sideways action if the trend is really strong)

Indicator / Formula

Copy & Paste Friendly
_SECTION_BEGIN("Stochastic Momentum Oscillator");
LookBack1 = Param("Lookback1", 24, 2, 100 );
LookBack2 = Param("Lookback2", 100, 2, 100 );
Smooth1 = Param("Smooth 1", 3, 1, 100 );
Smooth2 = Param("Smooth 2", 10, 1, 100 );

P = (H+L+C)/3;

HH1 = HHV( P, LookBack1 );
LL1 = LLV( P, LookBack1 );

HH2 = HHV( P, LookBack2 );
LL2 = LLV( P, LookBack2 );

StoMom = 100 * MA( EMA( C - 0.5 * ( HH1 + LL1 ), Smooth1 ), Smooth2 ) / 
( 0.5 * MA( EMA( HH2 - LL2, Smooth1 ), Smooth2 ) );
icolor = IIf(StoMom>0 AND StoMom>Ref(StoMom,-1),colorGreen,IIf(StoMom>0 AND StoMom<Ref(StoMom,-1),colorBlue,IIf(StoMom<0 AND StoMom<Ref(StoMom,-1),
			colorRed,colorYellow)));

Plot(StoMom, _DEFAULT_NAME(), icolor, styleHistogram | stylethick );
_SECTION_END();

0 comments

Leave Comment

Please login here to leave a comment.