The easiest DIY is to go to line 3411: if (signal == LONG)
There you will see two blocks of code ending at line 3443: }//if (signal == SHORT)
All the instances of: OP_BUY and BuyClosureFailure: OP_SELL and SellClosureFailure are in the wrong blocks. Either change them all manually or copy this over the top of the existing code:
Code: Select all
//Opposite signal closure
if (signal == LONG)
{
if ((TimeLocal() - TDeskTimes[pairIndex]) / 60 <= MaxSignalAgeMinutes)
BuySignal = true;
if (CloseOnOppositeSignal)
{
SellClosureFailure = false;
CloseAllTrades(symbol, OP_SELL);
if (ForceTradeClosure)
{
SellClosureFailure = true;
pairIndex--;
continue;
}//if (ForceTradeClosure)
}//if (CloseOnOppositeSignal)
}//if (signal == LONG)
if (signal == SHORT)
{
if ((TimeLocal() - TDeskTimes[pairIndex]) / 60 <= MaxSignalAgeMinutes)
SellSignal = true;
if (CloseOnOppositeSignal)
{
BuyClosureFailure = false;
CloseAllTrades(symbol, OP_BUY);
if (ForceTradeClosure)
{
BuyClosureFailure = true;
pairIndex--;
continue;
}//if (ForceTradeClosure)
}//if (CloseOnOppositeSignal)
}//if (signal == SHORT)