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

Re: AB version of MetaStock formulas



PureBytes Links

Trading Reference Links

--- In amibroker@xxxx, "Mike Lucero" <m.lucero@xxxx> wrote:
> Try something like this:
> Vwma = Sum(C*V,10)/Sum(V,10);

I wish it was that easy. But I am told that the MetaStock formula for 
Volume Weighted Moving Averages is a bit more complex. Others have 
tried to code it into TradeStation without success so far. I was 
hoping it could be done in Amibroker. Attached is a copy of what I 
have learned so far about Volume Weighted Moving Averages. 

It would be nice to get the formula and system to work in AB. The 
system's creator reports it tests very well (about 50%/year with 
drawdowns of less than 5%) on over 100 years of data on the Dow 
Jones. 

Any ideas of what the next step would be to code Volume Weighted 
Moving Averages in AB?

COPY OF DISCUSSION
From: "Del Craddock" <grailsm@xxxx> 
Date: Tue Jul 9, 2002 10:14 pm
Subject: Re: [holygrailsm] Re: Bill's DOW system

I tried that before it's, not doesnt give the same result (unless I 
coded it wrong, entirely possible). 

Here is a snippet from the paritech website
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.

----- Original Message ----- 
From: Brian Mitchell 
To: holygrailsm@xxxxxxxxxxxxxxx 
Sent: Tuesday, July 09, 2002 6:52 PM
Subject: Re: [holygrailsm] Re: Bill's DOW system


Assuming you wanted a 20 period VMA, you'd so something like:

1: for each period, add close * volume to total
2: divide total by culmulative volume over 20 days
3: divide that by 20

I believe that's all there is to it.


----- Original Message ----- 
From: Del Craddock 
To: holygrailsm@xxxxxxxxxxxxxxx 
Sent: Tuesday, July 09, 2002 7:31 PM
Subject: Re: [holygrailsm] Re: Bill's DOW system


The key is whether Amibroker does the Volume Adjusted moving average 
curves.
Metastock is
the only program I have found so far that does it. I have Bills 
system set
up in Metastock,
and was trying to see if I could duplicate it in Tradestation, and 
nobody I
can find has
figured out the code for volume adjusted moving averages in 
Tradestation.

Del
> > -----Original Message-----
> > From: b519b [mailto:b519b@x...]
> > Sent: Tuesday, July 09, 2002 10:12 AM
> > To: holygrailsm@xxxx
> > Subject: [holygrailsm] Bill's DOW system
> > Bill,
> > Thank you for sharing you system for trading the DOW. Your charts
> > look promising. I have been (slowly) working at translating your
> > MetaStock formulas for the system into my software which is just
> > different encough to leave me scratching my head at some points.
> >
> > I would appreciate any comments you might have to clear my 
thinking.
> > For discussion purposes, each line of that code (from post 5736) 
has
> > been numbered.
> >
> > Bullish / Long
> > 1a.....(ROC(Mov(C,20,S),1,$) > 0 AND
> > 1b.....(Mov(C,20,VOL) > Mov(C,20,S))) OR
> > 2a.....(ROC(Mov(C,20,VOL),1,$) > 0 AND
> > 2b.....(Mov(C,20,VOL) > Mov(C,20,S)))
> > Not included in ribbon MUST BE OBSERVED VISUALLY OR
> > 3a.....((ROC(Mov(C,20,S),1,$) > 0) AND
> > 3b.....(ROC(Mov(C,20,VOL),1,$) > 0))
> > 4a.....Bearish / Short = None of the above true.
> >
> > Concerning Long Entry: If I understand corrently this means I 
Enter
> > Long if any one of the following are true:
> > ... (1a AND 1b)
> > ... (2a AND 2b) which is the same as (2a AND 1b)
> > ... (3a AND 3b) which is the same as (1a AND 2a)
> >
> > Concerning Long Exit and Short Entry: If ALL of the above are 
False
> > then I should exit the Longs and go Short. Is this correct?
> >
> > Also I am a bit in the dark about what parts of the following
> > MetaStock formulas mean (even after consulting some of the 
MetaStock
> > information websites). Any comments would be appreciated.
> >
> > 1a.....(ROC(Mov(C,20,S),1,$) > 0
> > First I get a Simple moving average of the close for 20 days
> > This is put into a ROC (Return on Capital) formula with a period 
of
> > 1 day. If so, could I do the following: Omit the ROC call and just
> > test to see if today's Mov(C,20,S) is greater than yesterday's Mov
> > (C,20,S)?
> >
> > 1b.....(Mov(C,20,VOL) > Mov(C,20,S)))
> > It looks like this line measures the strength of any uptrend by
> > requires that there be more volume on the up-days than down-days. 
My
> > software does not have a specific option for a Volume Weighted
> > Moving Average (I assme that is what the "VOL" specifies). Do you
> > know if the following code (pseudo code, not necessarily MetaStock
> > code) would give the same result?
> >
> > Vwma = Sum(C*Volume,10)/Sum(Volume,10);
> > Where "Vwma" is just a variable in my software and where "Sum" is 
a
> > summation function. Or is this too simplistic an approach?
> >
> > 2a.....(ROC(Mov(C,20,VOL),1,$) > 0
> > If I understand 1a and 1b, I can understand 2a just fine.
> >
> > 2b, 3a, 3b.
> > These are just recombinations of 1a, 1b, and 2a.
> >
> > Thanks in advance for any help you can give.
> >
> > b