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

Re: ADX jumps



PureBytes Links

Trading Reference Links

"Gary Fritz" <fritz@xxxxxxxx> writes:
>When you turn on Update Every Tick on most indicators, it does what
>you would expect:  the indicator value changes on each tick according
>to the change in the price.
>
>For some reason ADX (and possibly others, I don't know) doesn't act
>like that.  It locks at one value for a long time, makes occasional
>rapid moves, and makes large JUMPS immediately after the bar closes.
>
>I noticed that ADX is a Series function, which calls DMI (a Simple
>function), which calls DMIPlus and DMIMinus (Series functions).

The builtin ADX is probably the worst example I've seen of
inefficient Omega code.  When you go through all its gyrations, you
find that you can eliminate most of the code and just boil it down to
the calculation of an average of a ratio of a couple of averages.
Unless you really want to plot the DMI things separately, just throw
out all that thrashing, and save a zillion cpu cycles.  And get rid
of the jumping behavior in the process. 

Use whatever sort of average algorithm you like, but do it within
the ADX code, not as an external function call.  And if you want to
get fancy, like, say, a real low-pass filter for the averaging processes,
watch out for those single-precision limitations. :)

Jim