300 Bar Moving Average and reporting metrics
Author: rickraphael
Creation Date: 8/30/2009 1:48 PM
profile picture

rickraphael

#1
The following strategy includes a 300 bar Moving average and therefor a 302 day look back period. When backtesting it enters the first trade 302 bars after the date specified, as expected. That creates certain inaccuracies in the reporting metrics such as Annual Gain, etc. due to the look back period being included in the time based reports. Is there a way to setup the code for backtesting that does not include the look back period in the reports?

Thanks


CODE:
Please log in to see this code.

profile picture

Eugene

#2
QUOTE:
Is there a way to setup the code for backtesting that does not include the look back period in the reports?

No.

This has been answered many times, so to quote the Wealth-Lab 5 Wiki FAQ on Where did the Lead Bars go:
QUOTE:
This feature was purposely left out of Version 5 due to a multitude of reasons ranging from the difficulty that many users had in understanding it to the complexity in its implementation, which was a source of many bugs in Version 4.


Here's a discussion that provides more insight into the problem:

Lead Bars & Position Sizing Leeway
profile picture

Cone

#3
QUOTE:
Is there a way to setup the code for backtesting that does not include the look back period in the reports?
It's a common question, and, this is what we used to call "Lead Bars" in the Version 4 $imulator.

Some motivated programmer may be able figure a way to do something like Lead Bars in Version 5, but we left it out specifically to simplify the code base for more reliability. In fact, in the 5.5 User Guide, this is discussed, but I'm sorry that we're not going to be able to help you out with this :(.

---
If I'd have read this one minute later, I wouldn't have had to respond! Thanks Eugene, I think I'll take the rest of the day off now :)
profile picture

rickraphael

#4
Fair enough. It's not really all that difficult to do in a spreadsheet. Have a good day off!