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

Re: VMA - Are you sure ?



PureBytes Links

Trading Reference Links

>I like your concept, but am not sure that your code is doing
>what you had intended.  When I read your introduction, I
>assumed that the concept was that as volatility, as measured
>by ATR, varied, the length of the EMA would vary.  However,
>as you have it coded, the volatility-driven variable called
>"Factor" is set on the first bar, and is not altered on
>subsequent bars.


This a piece of code I took directly from the Omega function library. All I
did is substitute ATR for length. :-)

>A second point - and this is a nit - is that I don't think you
>need to check for a divide by zero, when the denominator
>is ATR + 1.  Unless the user inserts a value for "Fac" that
>is negative, it would be impossible for Fac*IntPortion(ATR)
>to evaluate to -1, since true range is by definition a positive
>number.



>A broader question is : How do you set the input Fac?

Optimization. :-)

I use fac to adjust the length when I switch between intraday bars to daily
bars.

The only use I have for this so far is for setting up stops.