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
When to Use stoploss vs sl-or-tp
Use stoploss when you want ONLY stop loss protection without take profit.
Use sl-or-tp when you want BOTH stop loss AND take profit with automatic OCO monitoring.
Use inline sl property (e.g., market long 0.01 sl off 2%) for immediate protection at entry time.
Toobit Limitation
On Toobit, native stop loss orders are "invisible" to the API:
Native SL orders do NOT appear in open orders list
rem slwill NOT work (returns 0 orders cancelled)Cannot query or verify SL status programmatically
Workaround: Close position entirely (auto-cancels attached SL), or cancel via Toobit web UI.
Syntax
stoploss off <value>
stoploss at <price>
stoploss @ <price>
stoploss long|short <amount> off <value>
stoploss long|short <amount> @ <price> trigger mark|last|indexNote: Side and amount are optional. If omitted, the system infers direction from your current position and uses 100% of position size.
Price Prefix is REQUIRED
stoploss 2% is INVALID - will be rejected!stoploss off 2% is VALID - uses current price offset
Argument Order
When specifying stoploss parameters, the order is important:
| Position | Argument | Required | Description |
|---|---|---|---|
| 1 | amount | Optional | Quantity to close (default: 100%p). E.g., 50%p, 0.01 |
| 2 | price | Required | Price WITH PREFIX: off 2%, at 50000, e2% |
| 3 | trigger | Optional | Trigger type (default: mark). Values: mark, last, index |
Examples:
// 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 @ 48000Parameters
long|shortOptionalType: 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.
amountOptionalType: number or string | Default: 100%p (entire position)
How much of your position to close when stop loss triggers:
| Format | Example | Meaning |
|---|---|---|
100%p | 100%p | 100% of position (close all) |
50%p | 50%p | 50% of position (partial close) |
number | 0.01 | Absolute amount (0.01 BTC) |
off value / at price / @ priceRequiredType: number or string
Where to trigger the stop loss:
off 2%- 2% away from current priceoff e2%- 2% away from entry price (recommended for SL!)at 49000or@ 49000- Absolute price of $49,000off 100- $100 away from current price
For stop losses, off e% (entry-relative) is recommended because it calculates from YOUR entry price, not the current market price.
triggerOptionalType: keyword | Values: mark, last, index | Default: mark
Which price to use for triggering the stop loss:
| Trigger | Description | Best For |
|---|---|---|
mark | Mark price (default) | Most reliable, manipulation-resistant |
last | Last traded price | Fastest response, but can be manipulated |
index | Index price | Based on spot exchanges, very stable |
The trigger parameter is processed by the trading service and sent to the exchange. Not all exchanges support all trigger types - check your exchange's capabilities.
Real-World Examples
1. Basic Stop Loss (2% from Entry)
Enter a long position and add stop loss 2% below your entry price.
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).
ETHUSDT on My_API_Key
market long 0.5
// Stop loss at $3,000 support
stoploss @ 3000Triggers 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%.
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).
BTCUSDT on My_API_Key
market long 0.01
// Fast stop loss with last price trigger
stoploss off e2% trigger lastTriggers 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.
ETHUSDT on My_API_Key
market long 1
// Only stop loss, no take profit
stoploss off e3%
// Will manually close when readyUse 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 ofoff %for consistent riskUse 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:
| Exchange | Implementation | Notes |
|---|---|---|
| Bitget | Native SL | Position-level TP/SL, partial supported |
| ByBit | Native SL | Via set_trading_stop endpoint |
| Bitunix | Not supported | SL standalone fails in reduce-only mode |
| Binance | Stop order | Creates separate STOP_MARKET order |
| Toobit | Invisible | Works but not queryable via API |
| HTX | Trigger order | Creates trigger order (trigger_type=ge/le) |
| KuCoin | Error | set_trading_stop raises NotImplementedError |
For best compatibility, use inline SL with market/limit orders (e.g., market long 0.01 sl off 2%) instead of standalone stoploss.
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