I have an exit strategy that opens a fake position to close it. When executing the code it the line of the strategy appears yellow (I understand this means error) but no error line appears on the log label. None on the output window. I paste the code to see if you find anything:
if (Position.MarketPosition == MarketPosition.Flat && PosOpened == false && Historical)
{
if (PositionType == "L")
MyOpenOrder = SubmitOrder(0, OrderAction.Buy, OrderType.Market, PosQuantity, 0, 0, "", "");
else if (PositionType == "S")
MyOpenOrder = SubmitOrder(0, OrderAction.SellShort, OrderType.Market, PosQuantity, 0, 0, "", "");
PosOpened = true;
}
Thanks
Comment