Skip to main content

Volume Histogram Area with MA for Amibroker (AFL)

Bursana over 8 years ago Amibroker (AFL)

  • Rating:
    5 / 5 (Votes 2)
  • Tags:
    amibroker, volume, histogram, area

Plotting volume histogram in a more beautiful area histogram chart

Indicator / Formula

Copy & Paste Friendly
Overlay = ParamToggle("MA Overlay Volume?", " No | Yes ", 1);
GraphZOrder = Overlay;

_SECTION_BEGIN( "Volume" );
SetBarFillColor( IIf( Close > Open, colorLime, colorRed ) );
Plot( Volume, _DEFAULT_NAME(), colorWhite, styleArea |styleNoTitle );
_SECTION_END();

_SECTION_BEGIN( "VolMA" );
Periods = Param( "Periods", 50, 2, 300, 1, 10 );
VolMA = MA(Volume,Periods);
Plot( VolMA, _DEFAULT_NAME(), ParamColor( "Color", colorCycle ), ParamStyle( "Style" ) );
_SECTION_END();

 _N(Title = StrFormat("{{NAME}} - {{INTERVAL}} {{DATE}}, Volume = ") + EncodeColor(colorGreen) + WriteVal(V,1.0) + StrFormat("  {{VALUES}}"));

2 comments

1. hohoyu
over 8 years ago

Hi, Bursana

If I want to add one more MA parameter in the indicator.
How to write?
Thanks

2. Bursana
over 8 years ago

hohoyu,
Just duplicate this part and add to the code:

_SECTION_BEGIN( "VolMA2" );
Periods2 = Param( "Periods2", 100, 2, 300, 1, 10 );
VolMA = MA(Volume,Periods2);
Plot( VolMA, _DEFAULT_NAME(), ParamColor( "Color", colorCycle ), ParamStyle( "Style" ) );
_SECTION_END();

Leave Comment

Please login here to leave a comment.