Skip to content
Sign In

Learning / Syntax / stoploss

stoploss - Standalone Stop Loss Order

Place a standalone stop loss order to protect an existing position.

What is stoploss?

stoploss places a standalone stop loss order to close (or reduce) an existing position when price reaches a specified level. This protects your position from excessive losses.

The stop loss order triggers when price moves AGAINST your position:

  • Long position: Stop loss triggers when price falls below your level

  • Short position: Stop loss triggers when price rises above your level

Syntax

Smart Syntax
stoploss off <value>
stoploss at <price>
stoploss @ <price>
stoploss long|short <amount> off <value>
stoploss long|short <amount> @ <price> trigger mark|last|index

Note: Side and amount are optional. If omitted, the system infers direction from your current position and uses 100% of position size.

Argument Order

When specifying stoploss parameters, the order is important:

PositionArgumentRequiredDescription
1amountOptionalQuantity to close (default: 100%p). E.g., 50%p, 0.01
2priceRequiredPrice WITH PREFIX: off 2%, at 50000, e2%
3triggerOptionalTrigger type (default: mark). Values: mark, last, index

Examples:

Smart Syntax
// price only (100%p default)
stoploss off 2%
// amount + price
stoploss 50%p off 2%
// amount + price + trigger
stoploss 50%p off 2% trigger last
// side + amount + absolute price
stoploss short 0.01 @ 48000

Parameters

long|shortOptional

Type: keyword | Values: long (or buy), short (or sell)

Direction to close. Usually inferred from your position automatically. Use short to close long positions,long to close short positions.


amountOptional

Type: number or string | Default: 100%p (entire position)

How much of your position to close when stop loss triggers:

FormatExampleMeaning
100%p100%p100% of position (close all)
50%p50%p50% of position (partial close)
number0.01Absolute amount (0.01 BTC)

off value / at price / @ priceRequired

Type: number or string

Where to trigger the stop loss:

  • off 2% - 2% away from current price
  • off e2% - 2% away from entry price (recommended for SL!)
  • at 49000 or @ 49000 - Absolute price of $49,000
  • off 100 - $100 away from current price

triggerOptional

Type: keyword | Values: mark, last, index | Default: mark

Which price to use for triggering the stop loss:

TriggerDescriptionBest For
markMark price (default)Most reliable, manipulation-resistant
lastLast traded priceFastest response, but can be manipulated
indexIndex priceBased on spot exchanges, very stable

Real-World Examples

1. Basic Stop Loss (2% from Entry)

Enter a long position and add stop loss 2% below your entry price.

Smart Syntax
BTCUSDT on My_API_Key
// Enter position
market long 0.01
// Add stop loss 2% below entry
stoploss off e2%

The e2% calculates 2% from your entry price, not current price. This ensures consistent risk management.

2. Absolute Price Stop Loss

Set stop loss at a specific price level (e.g., key support).

Smart Syntax
ETHUSDT on My_API_Key
market long 0.5
// Stop loss at $3,000 support
stoploss @ 3000

Triggers when ETH falls to $3,000, regardless of your entry price.

3. Tiered Stop Loss (Partial Closes)

Close position in stages: 50% at -2%, remaining 50% at -4%.

Smart Syntax
BTCUSDT on My_API_Key
market long 0.02
// First SL: close 50% at -2%
stoploss short 50%p off e2%
// Second SL: close remaining at -4%
stoploss short 100%p off e4%

Reduces risk incrementally. First stop closes half, second closes the rest.

4. Fast Trigger with Last Price

Use last price for fastest response (but higher manipulation risk).

Smart Syntax
BTCUSDT on My_API_Key
market long 0.01
// Fast stop loss with last price trigger
stoploss off e2% trigger last

Triggers on last traded price instead of mark price. Faster, but can be manipulated in thin markets.

5. Stop Loss Only (No Take Profit)

When you want protection but plan to manually close at profit.

Smart Syntax
ETHUSDT on My_API_Key
market long 1
// Only stop loss, no take profit
stoploss off e3%
// Will manually close when ready

Use this when you want downside protection but prefer to exit manually at the right time.

Best Practices

  • Always use stop losses - Protect every position from unexpected moves

  • Prefer entry-relative offsets - Use off e% instead of off % for consistent risk

  • Use mark price trigger (default) - Most reliable and manipulation-resistant

  • Consider tiered stops - Close position in stages to reduce risk incrementally

Exchange-Specific Behavior

Standalone stop loss implementation varies by exchange:

ExchangeImplementationNotes
BitgetNative SLPosition-level TP/SL, partial supported
ByBitNative SLVia set_trading_stop endpoint
BitunixNot supportedSL standalone fails in reduce-only mode
BinanceStop orderCreates separate STOP_MARKET order
ToobitInvisibleWorks but not queryable via API
HTXTrigger orderCreates trigger order (trigger_type=ge/le)
KuCoinErrorset_trading_stop raises NotImplementedError

Related Commands

takeprofit

- Standalone take profit order (exit at profit)

sl-or-tp

- Combined SL+TP with automatic OCO monitoring

market

- Use inline sl property for immediate protection (e.g., market long 0.01 sl off 2%)

rem

- Cancel stop loss orders with rem sl or rem stoploss