// 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
Comment