Gamestudio Links
Zorro Links
Newest Posts
'AssetFrameZone' undeclared identifier
by AndrewAMD. 12/09/22 13:40
How to combile shader FX?
by NicolaB. 12/08/22 08:18
Function refresh?
by Quad. 12/07/22 20:56
AUM Magazine
Latest Screens
DEAD TASTE
Tactics of World War I
Hecknex World
Scheherazade's Journey
Who's Online Now
3 registered members (NexusP47, PeroPero, Grant), 627 guests, and 5 spiders.
Key: Admin, Global Mod, Mod
Newest Members
pythno, rxs, wezcam, juliastratos, DavidK
18872 Registered Users
Previous Thread
Next Thread
Print Thread
Rate Thread
Trading 100 instruments with IB #486933
11/19/22 03:35
11/19/22 03:35
Joined: Nov 2022
Posts: 2
Sydney, Australia
D
DavidK Offline OP
Guest
DavidK  Offline OP
Guest
D

Joined: Nov 2022
Posts: 2
Sydney, Australia
I would like to monitor and trade say 100 instruments using two IB accounts. What sort of Zorro configurations of would enable me to do it efficiently?
How would the code inside the run() and tick() functions know which of the assets triggered the call? It seems quite inefficient to have to loop through many assets to
see which assets caused the calls.

Last edited by DavidK; 11/19/22 03:50.
Re: Trading 100 instruments with IB [Re: DavidK] #486934
11/19/22 10:27
11/19/22 10:27
Joined: Aug 2017
Posts: 231
Netherlands
G
Grant Online
Member
Grant  Online
Member
G

Joined: Aug 2017
Posts: 231
Netherlands
Originally Posted by DavidK
I would like to monitor and trade say 100 instruments using two IB accounts. What sort of Zorro configurations of would enable me to do it efficiently?


By either using:

1) A 'for(used_assets)' loop, see https://zorro-project.com/manual/en/fortrades.htm

or

2) A 'while(asset(loop(...' , see https://zorro-project.com/manual/en/loop.htm (examples below) when you want to run optimizations.

Quote

How would the code inside the run() and tick() functions know which of the assets triggered the call? It seems quite inefficient to have to loop through many assets to
see which assets caused the calls.


Always use tock() instead of tick() for a multi-asset script.

Quote:

"Trading with different assets in a tick function can cause backtest snooping bias. When historical price ticks for assets A and B have the same time stamps, the tick function will first run with asset A, then with asset B. In the first run, asset A has the current price, but asset B still the previous price. This can be used to snoop the next B price especially when it strongly depends on the A price. To prevent this effect, use the tock function for trading multiple assets when required, and set TockTime to the tick resolution of the used historical data, or to TickTime in live trading." (https://zorro-project.com/manual/en/tick.htm)


You need to loop this, but c-lite is pretty fast.


Moderated by  Petra 

Gamestudio download | chip programmers | Zorro platform | shop | Data Protection Policy

oP group Germany GmbH | Birkenstr. 25-27 | 63549 Ronneburg / Germany | info (at) opgroup.de

Powered by UBB.threads™ PHP Forum Software 7.7.1