Ultimate Oscillator based TEMA shows NaN
Author: karla2010
Creation Date: 6/19/2010 8:35 AM
profile picture

karla2010

#1
This may be something to do with the fact that TEMA belongs to TASCIndicators and I'm missing the right script to handle it.

So here goes.

I created a Kalman-filtered new set of Bars, then computed the UltimateOscillator from WealthLab.Indicators and UltimateOscillator2 from Community.Indicators. Both oscillators were then run through the TEMA filter from TASC.Indicators.

The TEMA filtered UltimateOscillator plots ok but the TEMA filtered UltimateOscillator2 shows NaN values.

Here's the script, any help is appreciated.

CODE:
Please log in to see this code.



profile picture

Eugene

#2
UltimateOsc2 is the culprit, I'm not sure why it produces NaNs. For now, simply replace your series:
CODE:
Please log in to see this code.
With this:
CODE:
Please log in to see this code.
Later I'll incorporate the check in the code. Thanks for the heads-up.
profile picture

karla2010

#3
Eugene,

Thanks very much. Works like a charm.

I made a small change to your suggestion. Instead of replacing the NaN result with 0.0, I used the previous value which makes for a smoother function.

CODE:
Please log in to see this code.

profile picture

Cone

#4
That's a good observation karla. It wasn't until recently that I started building indicators that way, and I think the "previous value" method should be adopted by all indicator authors. We'll get that changed where required in TASCIndicators.
profile picture

Eugene

#5
I'll mark it for later in Community.Indicators.
This website uses cookies to improve your experience. We'll assume you're ok with that, but you can opt-out if you wish (Read more).