I've got a question regarding unmanaged Order submissions.
I want to use brackets for my unmanaged orders, with a StopLoss and a TakeProfit.
Let's say I am entering with 5 contracts long like so:
SubmitOrderUnmanaged(1, OrderAction.Buy, OrderType.Market, 5, 0, 0, string.Empty, entryName);
Like so:
currentPtPrice = execution.Order.AverageFillPrice + X; profitTargetLong = placeHolderOrder; SubmitOrderUnmanaged(1, OrderAction.Sell, OrderType.Limit, 5, currentPtPrice, 0, ocoString, "profit target"); currentSlPrice = execution.Order.AverageFillPrice - X; stopLossLong = placeHolderOrder; SubmitOrderUnmanaged(1, OrderAction.Sell, OrderType.StopMarket, 5, 0, currentSlPrice, ocoString, "stop loss");
Meaning, if somehow my TP Limit only get's partially filled and the chart reverses, hits my SL and now I'm short a couple contracts...
That's why I want to replace my TP with a Market if Touched Order.
However, if I simply change it to MIT, it places the order at zero, completely disregarding my previously calculated currentPtPrice.
I have tried using MIT, and also changing the OrderAction to StopMarket to no avail.
Any pointers would be very welcomed.
Also, how dows it work with Short setups?
I have set the OrderAction to Buy, but I'm not sure if I should be using BuyToCover and if so, what OrderType I should be using for my TP?
And if there were another way for me to pass my initial entry Contract Size to the TP and SL orders, that would be wonderful as well!
(I was thinking execution.Order.Filled, but that throws me an error...)
Cheers
Comment