I have one strategy working OnEachTick that has been working pretty well when i create entry/exit limit orders of 1 size.
Today i tried to increase the quantity to 3 contracts per order and for the entry it works well. However, the limit/stoploss exit orders only appear to create orders for 1 contract (instead of 3).
Below you can see the orders generated and how for the entry order the quantity is 3 but the exit orders are for quantity 1 only:
Below the screenshot of the code, the orders i have them in OnExecutionUpdate like that:
Then if one bar has elapsed, the exit limit order price is updated OnBarUpdate as per below:
Any idea why it only creates 1 contract when exiting? i assume it has to be with the execution.Order.Filled but would love some guidance on how to fix this.
THanks!
Comment