else if (currentPositionSize < 0) // Short position
{
double newStopLoss = SymbolInfoDouble(_Symbol, SYMBOL_ASK) * (1 + trailingStopPercent / 100);
if (newStopLoss < currentStopLoss)
{
currentStopLoss = newStopLoss;
trade.PositionModify(_Symbol, currentStopLoss, 0);
}
}
}
// Deinitialization function
void OnDeinit(const int reason)
{
// Release indicator handles
IndicatorRelease(fastMAHandle);
IndicatorRelease(slowMAHandle);
}
🚀