are symmetrical these levels for buy and sell? // Process buy positions if(type ==…
- User
are symmetrical these levels for buy and sell? // Process buy positions if(type == POSITION_TYPE_BUY) { double priceMove = MathMax(SymbolInfoDouble(_Symbol, SYMBOL_BID) - openPrice + CommissionPerPip, 0); double trailDist = CalculateTrailingStop(priceMove, MinStopDistance, TrailingStopActive, BaseTrailingStop, TrailingStopMax);
double modifiedSl = NormalizeDouble(SymbolInfoDouble(_Symbol, SYMBOL_BID) - trailDist, _Digits); double triggerLevel = openPrice + CommissionPerPip + TrailingStopIncrement; if(SymbolInfoDouble(_Symbol, SYMBOL_BID) > triggerLevel && (sl == 0 || (SymbolInfoDouble(_Symbol, SYMBOL_BID) - sl) > trailDist) && modifiedSl != sl) { trade.PositionModify(ticket, modifiedSl, tp); } } else if(type == POSITION_TYPE_SELL) { double priceMove = MathMax(openPrice - SymbolInfoDouble(_Symbol, SYMBOL_ASK) - CommissionPerPip, 0); double trailDist = CalculateTrailingStop(priceMove, MinStopDistance, TrailingStopActive, BaseTrailingStop, TrailingStopMax); double modifiedSl = NormalizeDouble(SymbolInfoDouble(_Symbol, SYMBOL_ASK) + trailDist, _Digits); double triggerLevel = openPrice - CommissionPerPip - TrailingStopIncrement; if((triggerLevel - SymbolInfoDouble(_Symbol, SYMBOL_ASK)) > trailDist && (sl == 0 || (sl - SymbolInfoDouble(_Symbol, SYMBOL_ASK)) > trailDist) && modifiedSl != sl) { trade.PositionModify(ticket, modifiedSl, tp); } }
Other models, same or similar prompt
Responses were produced in different, uncontrolled contexts (system prompts, settings, prior turns). This is not a benchmark.