PureBytes Links
Trading Reference Links
|
The following is Paritech Description of Dick Arms VWMA:
"Dick Arms, well-known as the developer of the Arms Index and the
equivolume charting method developed a unique method for calculating
moving averages. In keeping with his prior work, the calculation
method incorporates volume and is appropriately called a volume
adjusted moving average .
The calculation for a volume adjusted moving average is somewhat
complex; however, it is conceptually easy to understand. All moving
averages (even volume adjusted) use some type of weighting scheme
to "average" the data. Exponential and weighted moving averages
assign the majority of weight to the most recent data. Simple moving
averages assign the weight equally across all data. Variable moving
averages assign the majority of the weight to the most volatile data.
And as its name implies, volume adjusted moving averages assign the
majority of weight to the day's with the most volume.
A volume adjusted moving average is calculated as follows:
Calculate the average volume using every time period in the chart.
Calculate the volume increment by multiplying the average volume by
0.67.
Calculate each period's volume ratio by dividing each period's actual
volume by the volume increment.
Starting at the most recent time period and working backwards,
multiply each period's price by the period's volume ratio and
cumulatively sum these values until the user-specified number of
volume increments is reached. Note that only a fraction of the last
period's volume will likely be used."
I first tried to code this average using the AddToComposite function
but that didn't seen to allow multiple closing prices for the same
date. Then I tried to use Osaka plug-in (code below) but I can't
figure how to calculate the MA. Any guidance with this problem will
be greatly appreciated.
osInitialize();
//calculate volume ratio
for(i=0; i<BarCount;i++)
{
avm = int((V/MA(V,55)*0.67))+1;
}
Vb = Cum(avm);
Vbc=LastValue(Vb);
List = Name();
row =0;
table=osTabCreate();
// setup columns
osTabAddColumn( "Close", 1, table );
// adds closing price to table based on volume ratio(Could have
multiple closing price for same day)
for(i=0; i < BarCount; i++)
{
for(k=0; k < avm[ i ]; k++)
{
SetForeign(List);
osTabSetNumber(Close[ i ] , row, 0, table ); // for
calculation of average
row = row+1;
}
}
// you can export for debugging
osTabExport( "vwma.csv", ",", table );
// ??Problem Area
average = 0; // init avarage
osTabDelete( table );
Plot( average, "VWMA(55)", colorRed );
Buy =0;
Filter=1;
Thanks,
Rich
------------------------ Yahoo! Groups Sponsor ---------------------~-->
Buy Ink Cartridges or Refill Kits for your HP, Epson, Canon or Lexmark
Printer at MyInks.com. Free s/h on orders $50 or more to the US & Canada.
http://www.c1tracking.com/l.asp?cid=5511
http://us.click.yahoo.com/mOAaAA/3exGAA/qnsNAA/GHeqlB/TM
---------------------------------------------------------------------~->
Send BUG REPORTS to bugs@xxxxxxxxxxxxx
Send SUGGESTIONS to suggest@xxxxxxxxxxxxx
-----------------------------------------
Post AmiQuote-related messages ONLY to: amiquote@xxxxxxxxxxxxxxx
(Web page: http://groups.yahoo.com/group/amiquote/messages/)
--------------------------------------------
Check group FAQ at: http://groups.yahoo.com/group/amibroker/files/groupfaq.html
Yahoo! Groups Links
<*> To visit your group on the web, go to:
http://groups.yahoo.com/group/amibroker/
<*> To unsubscribe from this group, send an email to:
amibroker-unsubscribe@xxxxxxxxxxxxxxx
<*> Your use of Yahoo! Groups is subject to:
http://docs.yahoo.com/info/terms/
|