I have a question about PartialFills. I have some strategies which trades 3-5 contracts with market orders. Partial-Fill occurs, but everything seems to be fine.
How often is the OnExecution-Method called? For every partial-fill?
How often is the OnOrderUpdate-Method called? For every partial-fill?
Does NTt cumulate the contracts and change the stop/target orders automatically?
Now I have a range-system with Unmanaged-Approach. I want to trade form, outside to inside the range. For example for Short-Trades I use a LimitOrder with Submit-Order method. With 1 contract it works fine, but how could it work with 2 or more contracts?
My OnExecution-Methods looks like this:
if (execution.Order.OrderState == OrderState.Filled || execution.Order.OrderState == OrderState.PartFilled ||
(execution.Order.OrderState == OrderState.Cancelled && execution.Order.Filled > 0))
{ ....
if (entryOrderShort != null && entryOrderShort == execution.Order)
{
....
double entryPrice = entryOrderShort.AvgFillPrice;
if (Position.MarketPosition == MarketPosition.Short)
{
stopLevel = entryPrice + stopLossTicks*TickSize;
targetLevel = entryPrice - profitTargetTicks * TickSize;
stopOrder = SubmitOrder(0, OrderAction.BuyToCover, OrderType.Stop, entryOrderShort.Filled, 0, stopLevel, "OCO " +this.Name, "Initial-Stop");
targetOrder = SubmitOrder(0, OrderAction.BuyToCover, OrderType.Limit, entryOrderShort.Filled, targetLevel, 0, "OCO " +this.Name, "Profit-Target");
}
}
With Market in other strategies it seems to work well.
How do I have to handle Partial-Fills in this case correctly? Do I need to use Market-Orders?
Thx
DT

Comment