I have a strategy with 2 (sometimes 3) instruments. All instruments use daily bars. I execute onbarupdate only for instrument==0.
My strategy e.g. goes long with instrument 1. Then on day X the position is closed and same day enterlong for instrument2 is called. If I do this, then I get this error:
-------------------
**NT** Error on calling 'OnBarUpdate' method for strategy 'mystrategy':
c # The object reference was not set to an object instance.
-------------
If I close position of instrument1 on day X, and only open position of instrument2 one day later, all works fine. What must I adjust to be able to execute trades with both instruments on same day(bar)?
Comment