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

Re: your EMA code



PureBytes Links

Trading Reference Links

Lee:
>Thanks for posting your revised EMA function code Alex.  The ts ema has
>given me fits in every study that also used the hilbert cycle period.

You're welcome.  Basically, any TS function that refers to a
previous value of its own output (like xAverage does) should be
re-written so that you have to pass the previous value into the
function yourself.

If you pass different lengths to xAverage on different bars, TS
assumes these are different averages to keep track of, rather than
one average using a different length at each bar.

In addition to xAverage, another example is ADX.  Write your own if
you plan to pass variable lengths to ADX.  Fortunately this is easy
to do because all the source code is there for you to modify.

-- 
  ,|___    Alex Matulich -- alex@xxxxxxxxxxxxxx
 // +__>   Director of Research and Development
 //  \ 
 //___)    Unicorn Research Corporation -- http://unicorn.us.com