I'm wrestiling with order logic: I wrote an easy system wich exits multiple positions, orders seem to be placed and executed fine, but controc center->orders shows a redundant "cancelled". I really do not understand what can cause that.
Below a piece of the code:
if (Position.MarketPosition != MarketPosition.Flat)
if (Position.MarketPosition == MarketPosition.Long){
if (Position.Quantity == ctr)
{
ExitLongLimit(ctr/3, (Position.AvgPrice + target1), "1st Exit", "");
ExitLongStop(ctr, (Position.AvgPrice - stop), "1stStop", "");
The problem is that second "buytocover" limit orders which appears after the same order has been filled.
Thanks in advance for your help,
regards
Marce

Comment