- ago
Hi, I see differences between WL6 and WL8 values for SPX.
Only for EMA200. EMA50 and EMA20 are the same.
I have three points of data: WL6, WL8, Fidelity ATP.
All three yield the same value for SMA 200 at end of day Jan 7, 2025: 5566.12.
This means the raw data is the same in all cases.
Here are the EMA results
WL6 ATP WL8
5574.52 5572.96 5604.28
WL6 and ATP are close but WL8 is different.
Can you please check to see what you get?
Thanks!
0
115
Solved
11 Replies

Reply

Bookmark

Sort
- ago
#1
Not enough data loaded. Is your data range equal or greater than 4 times the period (200) i.e. 800+ bars of data?
0
Cone8
 ( 5.87% )
- ago
#2
What's the starting date of the source in all 3 cases?

See Help > Indicators > Stability of Indicators.
0
- ago
#3
7/27/2009
0
- ago
#4
This start date is for both WL6 and WL8.
I do not know the depth of data for Fidelity ATP.
0
- ago
#5
When I extend the ATP range from 1 to 5 years I get the same value as WL6: 5574.52.
Learned something here. Though I do not understand how the EMA 200 needs 4 x the data range.
0
- ago
#6
This occurred to me.
I set the data depth in Tools/Preferences/Data to 800.
This probably applies to all strategies.

At a later point I might ask you if it is possible to set this depth per data set.
But this is separate discussion item and at this point I am not sure if it will be needed.
At the end of the day, I will have three data sets operating two of which simultaneously streaming:
1 day: Backtest
1 minute: Streaming
5 or 10 seconds: Streaming
0
Cone8
 ( 5.87% )
- ago
#7
QUOTE:
I do not understand how the EMA 200 needs 4 x the data range.
Explained in the Help reference above.

As a rule of the thumb IIR-type indicators need 3x the period to stabilize such that the start data doesn't significantly affect values that you're analyzing (because it always affects all the values that follow). But, if the period is large, less seed data is required.

Example:

EMA(200) with 250 bars. Notice how the value of the EMA on 1/8/2025 changes as we add more data (i.e., changing the start date).


EMA(200) with 300 bars.


EMA(200) with 350 bars.
0
Cone8
 ( 5.87% )
- ago
#8
By the way, I got precisely the same value as you did for WL6 (5574.523), loading from 2020, and not even knowing which source of data you're using.



0
- ago
#9
Great that EMA200 results match for WL6.

I use data from Fidelity ATP at the end of each day.
For day and 1 minute data.
Once I get going the 1 minute WL8 strategy will gather data throughout the day.
And add it to the data set. This was the practice in WL6.

Thank you for education on EMA computations.
Even though the formula includes only data, iterative solutions probably use previous EMA values. And this is how a depth deeper than 200 becomes necessary.

Wondering what EMA200 value your copy of WL8 generates.
0
Cone8
 ( 5.87% )
- ago
#10
QUOTE:
Wondering what EMA200 value your copy of WL8 generates.
Come again? There are 4 examples above.

Solution for IIR Indicator Stability
If you take an extra step, there's a good way to handle this issue - create the indicator with all data available

Run this and you'll see that the EMA values at any date will not change, not matter what the starting date is.

CODE:
public override void Initialize(BarHistory bars) {          // get all data available - the start data will always be the beginning of the available data          BarHistory allBars = GetHistoryUnsynched(bars.Symbol, bars.Scale, null);          // create an IIR indicator          TimeSeries ema = EMA.Series(allBars.Close, 200);          // now synchronize to the chart bars - the values won't change!          ema = TimeSeriesSynchronizer.Synchronize(ema, bars);          PlotTimeSeries(ema, "EMA(200)", "Price", WLColor.Aqua);       }
0
Best Answer
- ago
#11
Thank you! That worked.
Though I have no idea how it did.
This is OK. I do not have to understand everything.
1

Reply

Bookmark

Sort