//Calculate position size double equity = GetAccountValue(AccountItem.NetLiquidation); double qty = contractsperMillionEquity * equity / 1000000; EnterShort((int)qty);
However, during back-tests, the account equity is returned as 0 and quantity used is 1 for all orders.
I suspect the same thing happens when I enable a strategy with "Sync Account position = True": the startup position is derived from the historical bar signals and the account is returned as 0, therefore the position size is set to 1... Every time my strategy is enabled and a position exists, the sync just creates a position of 1 on the account. The next position taken by the code that now runs on the live account will then have the correct size (since the account value will correctly be returned on live bars).
Is there a way to fix this behaviour (apart from setting the initial qty as a strategy parameter)?
Comment