sl-or-tp - Combined Stop Loss + Take Profit
Place Take Profit and Stop Loss together with automatic One-Cancels-Other monitoring.
What is sl-or-tp?
sl-or-tp is the easiest way to protect your positions with both upside (take profit) and downside (stop loss) protection in a single command.
Atomic Placement
Places both TP and SL orders simultaneously - no delay between them
Automatic OCO Monitoring
When one order fills (TP or SL), the other is automatically cancelled. No manual cleanup needed.
Set and Forget
Perfect for swing trades - set your exit levels and let the system manage them
How OCO Monitoring Works
After placing both orders, flipr.cloud actively monitors them. As soon as one fills or is cancelled, the system immediately cancels the other. This ensures you never have orphaned orders left on the exchange.
Syntax
sl-or-tp [long|short] <amount> sl off <sl_value> tp off <tp_value>
sl-or-tp [long|short] <amount> sl off <sl_value> tp off <tp_value> #tag
sl-or-tp [long|short] <amount> sl off <sl_value> tp off <tp_value> mark|last|indexParameters
long|shortOptionalType: keyword | Values: long, short (or buy, sell as aliases)
Optional when a preceding market command identifies the position, or when the exchange reports a single open position—even in a separate webhook.
With both sides open in hedge mode and no preceding market command, select the closing side: short protects the long; long protects the short. Explicit side selection is supported on Bybit, OKX and WEEX Futures.
amountRequiredType: number or string
How much of your position to close with TP/SL. Most commonly use 100%p to close entire position:
| Format | Example | Meaning |
|---|---|---|
%p | 100%p | 100% of position (full exit) |
%p | 50%p | 50% of position (partial exit) |
number | 0.01 | 0.01 BTC (absolute amount) |
tp off valueRequiredType: number or string
Take Profit offset. Places a limit order at this distance INTO profit:
tp off 100- Take profit after $100 move into profittp off 5%- Take profit after 5% price move into profittp off e5%- 5% from average entry (recommended for open positions)tp @ 52000- Absolute price of $52,000tp rr3- Risk/Reward ratio: TP at 3x the SL distance (3:1 R/R)tp rr2.5- Risk/Reward ratio: TP at 2.5x the SL distance (2.5:1 R/R)
TP order is placed as a post-only limit order - you'll get maker fees (usually lower or even rebates)
sl off valueRequiredType: number or string
Stop Loss offset. Places a stop market order at this distance INTO loss:
sl off 50- Stop loss after $50 move into losssl off 2%- Stop loss after 2% price move into losssl off e2%- 2% from average entry (recommended for open positions)sl @ 48000- Absolute price of $48,000
SL order is a stop market order - guaranteed to fill but price may slip in fast markets
#tagOptionalType: tag identifier
Label both orders for later reference. Use #tag syntax. Useful for managing multiple positions.
reduceOptionalType: flag keyword
Add reduce keyword to ensure orders can only reduce position size, not increase it. Usually not needed as this command is designed for closing positions.
mark | last | indexOptionalType: keyword | Default: last
Which price to use for triggering both SL and TP orders:
| Trigger | Description | Best For |
|---|---|---|
mark | Mark price | Most reliable, manipulation-resistant |
last | Last traded price (default) | Fastest response |
index | Index price | Based on spot exchanges, very stable |
When specified, the trigger type applies to both SL and TP orders. Not all exchanges support all trigger types - check your exchange's capabilities.
Real-World Examples
1. Basic Long Trade with 2:1 Risk/Reward
Enter a long position, take profit at +4%, stop loss at -2%. This gives you 2:1 reward to risk ratio.
BTCUSDT on My_API_Key
// Enter long position
market long 0.01
// Protect with 4% TP and 2% SL
sl-or-tp short 100%p sl off 2% tp off 4%Risk:Reward = 1:2 - Risk $100 to make $200. When either TP or SL hits, the other is auto-cancelled.
2. Entry-Relative Offsets (Best Practice)
Use entry-relative offsets (e%) for more precise TP/SL based on YOUR entry price.
ETHUSDT on My_API_Key
market long 0.5
// TP/SL relative to entry price
sl-or-tp short 100%p sl off e2.5% tp off e5%Using e5% means "5% from MY entry price", not from current market price. This is more accurate when market is moving quickly.
3. Partial Exit Strategy
Take profit on 50% of position, let the rest run with a separate stop.
BTCUSDT on My_API_Key
market long 0.02
// Exit 50% at 3% profit
sl-or-tp short 50%p sl off 1.5% tp off 3%
// Let remaining 50% run with wider stop
sl off e2%This secures partial profits while keeping exposure for bigger moves. First 50% exits at 3% profit, remaining position has a 2% stop loss.
4. Absolute Price Targets
Take profit at a specific resistance level, stop loss at support.
BTCUSDT on My_API_Key
// Buy at market (assuming ~$50,000)
market long 0.01
// TP at resistance, SL at support
sl-or-tp short 100%p sl @ 49000 tp @ 52000Using absolute prices (@ 52000) is perfect when trading at key levels. TP at $52k resistance, SL at $49k support.
5. Automatic Risk/Reward Ratio
Use the rr notation to automatically calculate TP based on SL distance.
BTCUSDT on My_API_Key
// Set SL at 2%, TP automatically at 6% (3:1 R/R)
market long 0.01
sl-or-tp short 100%p sl off 2% tp rr3tp rr3 automatically calculates TP at 3× the SL distance. If SL is 2% away, TP becomes 6% away (3:1 reward to risk). This works with any SL value: sl off e1.5% tp rr2.5 would set TP at 3.75% (2.5× of 1.5%).
6. Short Position with TP/SL
Enter a short and protect it with TP below and SL above.
BTCUSDT on My_API_Key
// Enter short position
market short 0.01
// TP below, SL above (for shorts)
sl-or-tp long 100%p sl off 1.5% tp off 3%For shorts, use long to close (buy back). TP/SL offsets work the same way - positive values automatically go in the correct direction (TP below, SL above for shorts).
Important Limitations
- OCO monitoring continues for the duration of your session, but will stop if backend restarts
- OCO monitoring automatically cancels remaining orders if you manually close your position on the exchange
- For best results, use this immediately after entering a position with
market
Best Practices
Always define both TP and SL - Never trade without protecting both sides
Use 2:1 or better R:R - Aim for at least 2x reward compared to risk (e.g., tp=4%, sl=2%)
Prefer entry-relative offsets - Use
e%for more accurate TP/SL based on your actual entryUse 100%p for full exits - Closes entire position regardless of size
Place immediately after entry - Don't wait, protect your position right away
Exchange-Specific Behavior
sl-or-tp creates two orders and monitors them with OCO logic. Implementation varies:
| Exchange | Native OCO | Implementation |
|---|---|---|
| Binance | Yes | Native OCO with GTE_GTC (requires workaround for SHORT) |
| ByBit | Yes | Native position TP/SL |
| BitMEX | Yes | Native OCO via clOrdLinkID |
| Bitget | No | Flipr.Cloud OCO Monitor (polling) |
| Bitunix | No | Flipr.Cloud OCO Monitor (polling) |
| HTX | No | Flipr.Cloud OCO Monitor (polling) |
| KuCoin | No | Flipr.Cloud OCO Monitor (polling) |
Flipr.Cloud OCO Monitor: When native OCO isn't available, Flipr.Cloud monitors both orders and cancels the remaining one when either fills.
Polling interval is ~1 second. For faster cancellation on exchanges without native OCO, consider using smart-oco.
Related Commands
smart-oco- Position-aware OCO for advanced exit strategies
stoploss / takeprofit- Standalone SL or TP (no OCO monitoring)
oco- Monitor existing orders with OCO logic
market- Use inline sl/tp for simpler setups