Gamestudio Links
Zorro Links
Newest Posts
Data from CSV not parsed correctly
by dr_panther. 05/06/24 18:50
Help with plotting multiple ZigZag
by degenerate_762. 04/30/24 23:23
M1 Oversampling
by 11honza11. 04/30/24 08:16
AUM Magazine
Latest Screens
The Bible Game
A psychological thriller game
SHADOW (2014)
DEAD TASTE
Who's Online Now
1 registered members (lijoyi2011), 1,042 guests, and 2 spiders.
Key: Admin, Global Mod, Mod
Newest Members
firatv, wandaluciaia, Mega_Rod, EternallyCurious, howardR
19050 Registered Users
Previous Thread
Next Thread
Print Thread
Rate Thread
Bar data time alignment #406917
09/01/12 22:05
09/01/12 22:05
Joined: Feb 2012
Posts: 37
S
stevegee58 Offline OP
Newbie
stevegee58  Offline OP
Newbie
S

Joined: Feb 2012
Posts: 37
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.

Last edited by stevegee58; 09/01/12 22:06.
Re: Bar data time alignment [Re: stevegee58] #406926
09/02/12 06:53
09/02/12 06:53
Joined: Jul 2000
Posts: 27,986
Frankfurt
jcl Offline

Chief Engineer
jcl  Offline

Chief Engineer

Joined: Jul 2000
Posts: 27,986
Frankfurt
The first loaded asset determines the bars. If it has a gap, the gap also occurs in all other assets. If the first asset has no gap, but a subsequent asset has a gap, the gap is filled with a copy of the previous bar.

When bars are loaded, the bar contents are checked for plausibility. If a bar has invalid data, like some too high or too low price, it is corrected.

Re: Bar data time alignment [Re: jcl] #406932
09/02/12 10:10
09/02/12 10:10
Joined: Feb 2012
Posts: 37
S
stevegee58 Offline OP
Newbie
stevegee58  Offline OP
Newbie
S

Joined: Feb 2012
Posts: 37
OK that makes sense.

I'm specifically working on cointegrated pairs/basket trading. So you could see how having time-aligned data is important in that case. This would also be important for correlation analysis as well.


Moderated by  Petra 

Powered by UBB.threads™ PHP Forum Software 7.7.1