The WL8 Build 85 description for the RoofingFilter indicator is incorrect. The good news is its description for WL6 is correct, so you can use that instead. http://www2.wealth-lab.com/WL5Wiki/RoofingFilter.ashx
The other problem is that the code below returns NaN for all RoofingFilter values. How do I fix that?
The other problem is that the code below returns NaN for all RoofingFilter values. How do I fix that?
CODE:
public override void Initialize(BarHistory bars) { indicator = new RoofingFilter(EMA.Series(bars.Close,3)/ATR.Series(bars,12)); PlotIndicator(indicator); }
Rename
QUOTE:
The WL8 Build 85 description for the RoofingFilter indicator is incorrect.
Fixed, thanks.
QUOTE:
How do I fix that?
I'd say get rid of Double.NaN values at the beginning of your TimeSeries, assiging values while looping, and then pass that cleaned up TimeSeries to RoofingFilter. I think it's confused by those NaNs.
QUOTE:
I'd say get rid of Double.NaN values at the beginning of your TimeSeries,
So you're right. If I include the FOR loop below, it works. But since nearly all TimeSeries will have NaN at their beginning, the Populate() procedure in RoofingFilter should setup its FOR loop to start at FirstValueIndex and not before to fix this problem (like all other indicators do).
CODE:I might add, if I execute the above FOR loop without the "intermediate" dummy variable (using emaOverAtr.FirstValidIndex directly), it fails. I'm not sure why that is.
public override void Initialize(BarHistory bars) { TimeSeries emaOverAtr = EMA.Series(bars.Close, 3) / ATR.Series(bars, 12); WriteToDebugLog(emaOverAtr.FirstValidIndex); int dummy = emaOverAtr.FirstValidIndex; for (int bar = 0; bar < dummy; bar++) emaOverAtr[bar] = bars.Close[bar]; IndicatorBase indicator = new RoofingFilter(emaOverAtr); PlotIndicator(indicator); }
It sounds like RoofingFilter is a faulty indicator to me.
A WL8 indicator should not break if the source series has NaNs at the beginning.
A WL8 indicator should not break if the source series has NaNs at the beginning.
Your Response
Post
Edit Post
Login is required