Profile Picture

ATR result different depending on Live Lead Bars when running Live

Posted By smersh 3 Years Ago

ATR result different depending on Live Lead Bars when running Live

Message
Posted Monday September 08 2014
When running live and using the ATR indicator, the value of the ATR is different depending on the value of Live Lead Bars.

This should not be the case as my understanding of Live Lead Bars is the number of bars that are simulated before a live run actually goes live.
So even if there are many more bars than this available in the datastore, they should be loaded for the ATR calculation.

To get around this I've had to set Live Lead Bars to 500 days to get the ATR to converge closely enough to the real ATR value.

I suspect this problem is caused by starting the ATR calculation at Now - Live Lead Bars ago rather than at the first bar that is available.


Makes me wonder about the Wilder's ATR though, To be absolutely correct it would have to include ALL data in existence since the Big Bang....

Posted Tuesday September 09 2014
smersh (9/8/2014)
So even if there are many more bars than this available in the datastore, they should be loaded for the ATR calculation.


When you run a system, the lead bars are the bars that are processed before the system can make any trades.  No bars before the lead bars are processed by the system or by the indicators.

Yes, the ATR calculation is dependent on how many bars of history you have.  It uses a calculation similar to an EMA, which also has the characteristic that the exact value depends on how many bars of history you supply to it, but the values converge towards the same thing.

Thanks,
Daniel

Posted Friday September 12 2014
Hi Daniel,

So you are saying that "processing bars" also includes calculating indicators?

The problem is that there is significant difference between running a back test (on a large data set) and running live unless veeeerrryyy long Live Lead Bars are used. Doing this executes the strategy code for all of these bars and can take a long time to eventually go to Live Mode just for the sake of getting these indicators right.
It also makes the situation non-deterministic.

I wonder if it's too much to suggest that just before RE starts processing the lead bars that both the EMA and ATR indicators are initialised from the start of the available data and then left to continue calculation as happens now (i.e during processing of lead and subsequent bars)?

Thanks

Posted Sunday September 14 2014
To the RightEdge simulation engine, there's no difference between the indicators and your trading system.

If your strategy code takes a long time to execute but calculating the indicators doesn't, then I'd suggest writing your system so that the strategy code is skipped during the lead bars.  Then you can include your whole history in the lead bars, and the results and performance should be the same as what you are suggesting.

If you want live results to be more deterministic, you can set the "Live Data Start Date" instead of the "Live Lead Bars" in your system properties.  Then your data will always start with the same bar until you change that setting, instead of changing based on the current date.

Does that help?

Thanks,
Daniel
Posted Sunday September 14 2014
Thanks Daniel, That helps.




Similar Topics


Reading This Topic


2005-2017 © RightEdge Systems