Skip to main content

Color Bars with Hema / Lema for Amibroker (AFL)

infynhome over 15 years ago Amibroker (AFL)

  • Rating:
    4 / 5 (Votes 5)
  • Tags:
    amibroker, moving average

This is a very basic level formula created with the following conditions:
Bar turns green when close above 5 period EMA of Highs
Bar turns Red when the close is below 5 period EMA of lows
Bar remains black if its within the EMA highs and lows.

The formula can be used for timing entries during reversals or for looking momentum in the direction of the Bar color.
The concept was shown to me by Ilango and formula was created by Mike.Thanks to both of them.

Indicator / Formula

Copy & Paste Friendly
Highs = EMA(High, 5);

Lows = EMA(Low, 5);



UpTrend = C > Highs;

DnTrend = C < Lows ;

Colors = IIf(UpTrend, colorGreen, IIf(DnTrend, colorRed, colorBlack));



Plot(Close, "Price", Colors, styleBar | styleThick);

0 comments

Leave Comment

Please login here to leave a comment.