Skip to main content

Tom DeMark Range Expansion Index for Amibroker (AFL)

realkaka about 16 years ago Amibroker (AFL)

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

Tom DeMark’s REI indicator oftentimes gives leading signals before other indicators begin signaling. Use this together with other leading indicators, for signal confirmation. This version also includes the TD Price Oscillator Qualifier (TD POQ) and DeMark’s Duration Analysis, for identifying extreme overbought and oversold conditions.

Indicator / Formula

Copy & Paste Friendly
per = 5;
TD1 = H - Ref( H, -2 );
TD2 = L - Ref( L, -2 );
TD3 = IIf( ( H >= Ref( L, -5 ) OR H >= Ref( L, -6 ) ) AND( L <= Ref( H, -5 ) OR L <= Ref( H, -6 ) ), 1, 0 );
TD4 = IIf( ( Ref( H, -2 ) >= Ref( C, -7 ) OR Ref( H, -2 ) >= Ref( C, -8 ) ) AND( Ref( L, -2 ) <= Ref( C, -7 ) OR Ref( L, -2 ) <= Ref( C, -8 ) ), 1, 0 );
TD6 = ( TD1 ) + ( TD2 );
TD5 = IIf( ( TD3 ) + ( TD4 ) >= 1, ( TD6 ), 0 );
TD7 = Abs( TD1 ) + Abs( TD2 );
TDREI = ( ( TD5 ) + Ref( TD5, -1 ) + Ref( TD5, -2 ) + Ref( TD5, -3 ) + Ref( TD5, -4 ) ) / ( TD7 ) + Ref( TD7, -1 ) + Ref( TD7, -2 ) + Ref( TD7, -3 ) + Ref( TD7, -4 ) * 100;
TDREI = 100 * Sum( TD5, per ) / Sum( TD7, per ) ;
Plot( TDREI, _DEFAULT_NAME(), colorRed );
Plot(80, _DEFAULT_NAME(), colorBlue, styleDashed );
Plot(-80, _DEFAULT_NAME(), colorBlue, styleDashed );

1 comments

about 16 years ago

Wow !! Very nice n effective to me !!!
Thanks a lot…now I am one step ahead in my trading with this one !!

Leave Comment

Please login here to leave a comment.