If the position is already closed, you will not be able to close it again.. There is no output that you have posted that the position was closed. Also, trace orders does not show when an order fills or the position changes.
To use an IOrder (in a managed strategy) make an IOrder variable. When placing the order assign this to the variable.
private IOrder myOrder; if (/* conditions to enter */) { myOrder = EnterLongLimit("mV5 L2"); } if (myOrder != null) { Print(string.Format("{0} | name: {1} | order state: {2} | current price: {3} | stop price: {4} | limit price {5}", Time[0], myOrder.Name, myOrder.OrderState, Close[0], myOrder.StopPrice, myOrder.LimitPrice)); }
You can print the current position as well.
Print(Position.MarketPosition.ToString());
The order is ignored because there is no position created from an entry named 'mV5 L2'.
Basically I would want to see that the entry order is filled and has this correct name and the position is still open.
Comment