- ago
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?
CODE:
public override void Initialize(BarHistory bars) {    indicator = new RoofingFilter(EMA.Series(bars.Close,3)/ATR.Series(bars,12));    PlotIndicator(indicator); }
0
576
Solved
4 Replies

Reply

Bookmark

Sort
- ago
#1
QUOTE:
The WL8 Build 85 description for the RoofingFilter indicator is incorrect.

Fixed, thanks.
0
Best Answer
- ago
#2
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.
0
- ago
#3
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:
   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);    }
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.
0
Glitch8
 ( 10.58% )
- ago
#4
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.
1

Reply

Bookmark

Sort