SetStopLoss("ShortEntry", CalculationMode.Price, stop, false);
SetProfitTarget("ShortEntry", CalculationMode.Price, profit);
EnterShortStopMarket(quantity, entry, "ShortEntry");
When the OnBarUpdate called next time after next bar is complete, if the entry didn't happen, I cancel the ShortEntry as -
CancelOrder(entryOrder);
The entryOrder is picked up from OnOrderUpdate for "ShortEntry" order name.
After I cancel the order. I recalculate new entry, stop, profit target, quantity etc and
resubmit above three orders with new calculated values.
The new order has everything correct except quantity. The quantity value doesn't change. Am I doing something wrong?
I print the whole order in OnOrderUpdate and I see the all variables like entry, stop, profit target etc are changed but the quantity doesn't. The quantity is same as the first order and not the newly computed one.
Can someone help me with this?
Thank you for your help!
Comment