PureBytes Links
Trading Reference Links
|
I understand that Tradestation doesn't accomodate Dick Arm's Equivolume.
But perhaps someone can help with the code that creates his "Volume Adjusted
Moving Averages."
He weights the price by the number of units of say 100,000 volume. He
gets the number of units by dividing volume by 100,000 in this case. A day
with 500,000 shares traded would have the price weighted 5 times, and a day
with 800,000 shares traded would have the price weighted 8 times. His price
is the midpoint between high and low.
The problem I am having is in the denominator, where he divides by say a
"5 - volume moving average." The 5 in this example is NOT the number of
bars, but the number of volume units.
The code I have for the function and indicator are as follows:
Any help would be appreciated.
Barry
--------------------------------------------------------------
For Function:
{volume adjusted moving averages per Dick Arms}
Inputs: Price(numeric), Length(numeric);
Variables: Mult(0), VolAdjMA(0);
{Calculate the number of times we will count the MeanPrice based on
increments of 100,000 volume}
Mult = Round((volume/100000), 0);
{calcualte the weighted value of the MeanPrice}
VolAdjMA = 0;
If VolAdjMA <> 0 then begin
For value1 = 0 to Length - 1 Begin
VolAdjMA = VolAdjMA + ((Price[value1] * Mult[value1]) / Length);
End;
End;
_VolAdjMA = VolAdjMA;
----------------------------------------------------------------------------
-------------------
For Indicator:
{volume adjusted moving averages per Dick Arms
Scaling: Same as symbol}
Inputs: Price((high + low)/2), FastAvg(4), SlowAvg(10);
Plot1(_VolAdjMA(price, FastAvg), "FastAvg", magenta, default, 0);
Plot2(_VolAdjMA(price, SlowAvg), "SlowAvg", cyan, default, 0);
|