Function commitTrailingStopCost

  • Adjusts the trailing stop-loss to an absolute price level.

    Convenience wrapper around commitTrailingStop that converts an absolute stop-loss price to a percentShift relative to the ORIGINAL SL distance.

    Automatically detects backtest/live mode from execution context. Automatically fetches current price via getAveragePrice.

    Parameters

    • symbol: string

      Trading pair symbol

    • newStopLossPrice: number

      Desired absolute stop-loss price

    Returns Promise<boolean>

    Promise - true if trailing SL was set/updated, false if rejected