How can I collect the information about already opened positions when a strategy starts? I have this code in OnStartUp() but it returns always Quantity=0 and Position=Flat.
private void onStartUpHandler()
{
int initQuantity = Position.Quantity;
MarketPosition initPosition = Position.MarketPosition;
....
}
I have set under Tools | Options | Strategies the below settings. Changing “On starting a real-time strategy” didn’t change the result. The same for the Sim101 and the real account. In the Control Center under Positions I see the positions.
Please advice what I am doing wrong, how to get the data of the open strategies.
Under “ATM Strategy” all 3 options [Modify inner/nearest bracket and Use last price for auto trail…" are checked]. I can’t post more than 1 image.
