if (longSignal && !longOpened)
{
ExitShort();
EnterLong();
longOpened = true;
shortOpened = false;
}
if ( shortSignal && !shortOpened )
{
ExitLong();
EnterShort();
longOpened = false;
shortOpened = true;
}
When strategy starts of it opens 1 position (long or short), when the reversal is called upon it is opening the 2 positions on the opposite direction and the number of positions keeps climing up . At one point it had about 12 positions opened (Thank god I was running on sim account). My original code did not have the ExitLong or ExitShort, added it in to see if I can prevent the addition in the number of positions.

Comment