My question refers to the SetProfitTarget() function.
Upon a complete fill of a Stop entry order I call the SetProfitTarget function as:
SetProfitTarget(CalculationMode.Ticks, NumPipsTarget);
I believe this is a limit order, which means partial fills will not be completely automatically handled by NT.
Now, after a partial fill of a target I get a PendingChange Order automatically by NT (I'm assuming b/c I have the SetProfitTarget in my initialize function with a static number of pips); this order gets rejected b/c "Can't replace below filled quantity). At this point the remaining lots of my position do not get exited until the price reaches the target price that moves to fulfills my # of target profit pips.
This is how I think I should solve this issue.
I'm assuming I should remove the SetTargetProfit() function from the Initialize() function so a new target doesn't get submitted; I call the SetTargetProfit() function after my entry order gets filled anyway.
Additionally, I have added code to the OnExecution() function checking for the execution.Order.Name == "Profit target" which exits any remaining position i have in the event of an OderState.PartFilled.
Thanks for your help / thoughts.
Anthony

Comment