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
2) A 'while(asset(loop(...' , see https://zorro-project.com/manual/en/loop.htm
(examples below) when you want to run optimizations.
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.
"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.