Value returned by slPriceToPercentShift (or passed to commitTrailingStop)
Original stop-loss price from the pending signal
Effective entry price (from getPositionEffectivePrice)
Position direction: "long" or "short"
Absolute stop-loss price corresponding to the given percentShift
Convert a percentShift for
commitTrailingStopback to an absolute stop-loss price.Inverse of
slPriceToPercentShift.newSlDistancePercent = originalSlDistancePercent + percentShift LONG: newStopLossPrice = effectivePriceOpen * (1 - newSlDistancePercent / 100) SHORT: newStopLossPrice = effectivePriceOpen * (1 + newSlDistancePercent / 100)
Example