Gamestudio Links
Zorro Links
Newest Posts
Free Live Data for Zorro with Paper Trading?
by dr_panther. 05/18/24 11:01
Change chart colours
by 7th_zorro. 05/11/24 09:25
Data from CSV not parsed correctly
by dr_panther. 05/06/24 18:50
AUM Magazine
Latest Screens
The Bible Game
A psychological thriller game
SHADOW (2014)
DEAD TASTE
Who's Online Now
2 registered members (7th_zorro, dr_panther), 724 guests, and 3 spiders.
Key: Admin, Global Mod, Mod
Newest Members
Hanky27, firatv, wandaluciaia, Mega_Rod, EternallyCurious
19051 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: 27,986
Frankfurt
jcl Offline

Chief Engineer
jcl  Offline

Chief Engineer

Joined: Jul 2000
Posts: 27,986
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