We all have occasional computer downtime, therefore strategies that have open positions get disabled and we are left with account positions that are only exitable on re-enabling of the strategy by using the following logic:

// Exits
if (BarsInProgress == i
&& PositionsAccount[i].MarketPosition == MarketPosition.Short
&& Closes[i][0] <= MIN(Closes[i],5)[0])

{
EnterLong(i,PositionsAccount[i].Quantity,"ExitShort"+i);
}

The problem is that the first action from EnterLong is to close the short positions... then add a new long position. So to get around this problem we try using:


if (BarsInProgress == i
&& PositionsAccount[i].MarketPosition == MarketPosition.Short
&& Closes[i][0] <= MIN(Closes[i],5)[0])

{
ExitShort(i,PositionsAccount[i].Quantity,"SwingShort"+i,"ExitShort"+i);
}

Problem here is that as the strategy was disabled... that "SwingShort" positions entry is no longer valid and visible to the newly enabled strategy.

Conclusion: All swing traders need a way to continue managing existing positions upon strategy re-enable. Is there a way to achieve this with occasional computer downtime when you cannot rely on the strategy position object? Regards and thx to all