[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

RE: [amibroker] MA Volume on main price chart



PureBytes Links

Trading Reference Links

Don,

Here is the code that I use to plot a variable moving average of the volume
based on what time frame I am in.

_SECTION_BEGIN("Volume");
Plot( Volume, _DEFAULT_NAME(), IIf( C > Ref(C,-1), ParamColor("Up Color",
colorGreen ), ParamColor("Down Color", colorRed ) ), ParamStyle( "Style",
styleHistogram | styleThick, maskHistogram  ) );
_SECTION_END();

_SECTION_BEGIN("OBV");
Plot( OBV(), _DEFAULT_NAME(), ParamColor("Color", colorCycle ),
ParamStyle("Style")  );
_SECTION_END();

_SECTION_BEGIN("MA");
MP = IIf( Interval()==inMonthly, 5, IIf( Interval()==inWeekly, 10, 50 ));
Plot( MA( V, MP ), "VMA(" + MP + ")", ParamColor( "Color", colorCycle ),
ParamStyle("Style") ); 
_SECTION_END();

It is this last section that you are interested in.  The way it reads is if
my time frame is Monthly, then use a 5 month period, if I am in a Weekly
chart, then use a 10 week period, if not then I must be in a Daily time
period and use 50 periods.

Or if you just want a fixed 50 period do the following:

_SECTION_BEGIN("MA");
Plot( MA( V, 50 ), "VMA-50", ParamColor( "Color", colorCycle ),
ParamStyle("Style") ); 
_SECTION_END();

Dave

PS  I had a lot of help from folks here in the forum to get this to work
correctly (and my brain on the right track, lol)  Graham and many others are
to be thanked.

-----Original Message-----
From: amibroker@xxxxxxxxxxxxxxx [mailto:amibroker@xxxxxxxxxxxxxxx] On Behalf
Of doedau
Sent: Sunday, June 11, 2006 9:05 PM
To: amibroker@xxxxxxxxxxxxxxx
Subject: [amibroker] MA Volume on main price chart

Hi,
My main price chart has a volume histogram. I want to plot a moving 
average of the volume such that it plots against the volume histogram 
so that I can see which bars are above/below average vol. I cant get 
it to work, possibly because vol has styleownscale set so it plots 
like a moving average of the price. I have tried it with and without 
styleownscale.

Could anyone kindly advise what I am doing wrong? Many thanks in 
advance.

Regards, Don.









Please note that this group is for discussion between users only.

To get support from AmiBroker please send an e-mail directly to 
SUPPORT {at} amibroker.com

For other support material please check also:
http://www.amibroker.com/support.html

 
Yahoo! Groups Links