Gamestudio Links
Zorro Links
Newest Posts
Zorro 2.70
by jcl. 09/29/25 09:24
optimize global parameters SOLVED
by dBc. 09/27/25 17:07
ZorroGPT
by TipmyPip. 09/27/25 10:05
assetHistory one candle shift
by jcl. 09/21/25 11:36
Plugins update
by Grant. 09/17/25 16:28
AUM Magazine
Latest Screens
Rocker`s Revenge
Stug 3 Stormartillery
Iljuschin 2
Galactic Strike X
Who's Online Now
5 registered members (Dico, AndrewAMD, TipmyPip, NewbieZorro, Grant), 15,791 guests, and 5 spiders.
Key: Admin, Global Mod, Mod
Newest Members
krishna, DrissB, James168, Ed_Love, xtns
19168 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: 28,024
Frankfurt
jcl Offline

Chief Engineer
jcl  Offline

Chief Engineer

Joined: Jul 2000
Posts: 28,024
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