Skip to main content

Colorful Price for Amibroker (AFL)

huynhbao2 about 15 years ago Amibroker (AFL)

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

Colorful Price of Bars. It makes the bars more colorful.

Indicator / Formula

Copy & Paste Friendly
_SECTION_BEGIN("Price");

upbar = C > Ref( C, -1 );
downbar = C < Ref( C, -1 );

/* Colourized price bars drawn here */
Graph0 = Close;
Graph0Style = 128;

barcolor = IIf( downbar, 4, IIf( upbar, 5, 1 ) );
Graph0BarColor = ValueWhen( barcolor != 0, barcolor );
SetBarFillColor( IIf( Close > Open, colorWhite, colorDarkRed ) ); 

SetChartOptions(0,chartShowArrows|chartShowDates);
_N(Title = StrFormat("{{NAME}} - {{INTERVAL}} {{DATE}} Open %g, Hi %g, Lo %g,
Close %g (%.1f%%) {{VALUES}}", O, H, L, C, SelectedValue( ROC( C, 1 ) ) ));
Plot( C, "Close", ParamColor("Color", colorBlack ), styleNoTitle |
ParamStyle("Style") | GetPriceStyle() ); 
_SECTION_END();

0 comments

Leave Comment

Please login here to leave a comment.