Posted By: stevegee58
Bar data time alignment - 09/01/12 22:05
I'm interested in basket trading and was wondering how you handle data gaps in backtest data. I read the help information for asset() which was very helpful. However I want to be sure I understood.
Function run() is called once per bar. Suppose I have data for EURUSD and USDCHF for example. The data is pretty good but there are holes in each file that are in different time periods between the 2 pairs. So there might be a gap from 20120301-20120303 in USDCHF but EURUSD has valid data in that time period.
If run() is called during this gap period what data do I get for EURUSD and USDCHF? I would assume I'd get a valid bar for EURUSD and some kind of error for USDCHF so I'd know it's not valid and handle it somehow.
I noticed in your examples you don't check for data errors or gaps.
Function run() is called once per bar. Suppose I have data for EURUSD and USDCHF for example. The data is pretty good but there are holes in each file that are in different time periods between the 2 pairs. So there might be a gap from 20120301-20120303 in USDCHF but EURUSD has valid data in that time period.
If run() is called during this gap period what data do I get for EURUSD and USDCHF? I would assume I'd get a valid bar for EURUSD and some kind of error for USDCHF so I'd know it's not valid and handle it somehow.
I noticed in your examples you don't check for data errors or gaps.