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
1 registered members (Dico), 16,767 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
Correctly handling different trading hours per asset #484830
12/14/21 13:08
12/14/21 13:08
Joined: Aug 2021
Posts: 101
M
MegaTanker Offline OP
Member
MegaTanker  Offline OP
Member
M

Joined: Aug 2021
Posts: 101
I wanted to live test a strategy the other day that trades different index CFDs but quickly had an order rejected because it was generated at the close of the last bar of the trading day, so I need to handle this within the script. Please let me know if this is the correct approach:

- The BR_FLAT flag is necessary, because otherwise the first selected asset is used to determine the trading hours based on when bars are unavailable in the history, which could end up "swallowing" legitimate bars from assets that have different trade hours.

- With BR_FLAT enabled, can I set asset-specific StartMarket and EndMarket times?

- If an order is generated at the close of the last bar before EndMarket, will this order be automatically delayed until the StartMarket open, or do I need to handle this in the script manually?

Re: Correctly handling different trading hours per asset [Re: MegaTanker] #484834
12/14/21 16:28
12/14/21 16:28
Joined: Jul 2000
Posts: 28,024
Frankfurt
jcl Offline

Chief Engineer
jcl  Offline

Chief Engineer

Joined: Jul 2000
Posts: 28,024
Frankfurt
Yes, use BR_FLAT when you trade assets on different markets. Start/EndMarket are normally not needed, just check the market hours by script before entering a trade. When you want to skip price series or indicators outside market hours, use the NOSHIFT flag.


Moderated by  Petra 

Powered by UBB.threads™ PHP Forum Software 7.7.1