Take-Profit and Stop-Loss Guide
What are take-profit and stop-loss orders?
Take-profit and stop-loss orders are conditional trigger orders that automatically close your position when the market reaches a price you set in advance. You do not need to be watching the market for them to fire.
A take-profit order closes your position when the price reaches your target profit level. For a long position, the take-profit triggers when the price rises to your target. For a short position, it triggers when the price falls to your target.
A stop-loss order closes your position when the price moves against you by a set amount. For a long position, the stop-loss triggers when the price drops to your floor. For a short position, it triggers when the price rises to your ceiling.
Together, TP and SL let you define the range you are comfortable with before you enter a trade, so your exits are handled automatically regardless of what happens while the position is open.
How are they different from regular sell orders?
This distinction is critical and a common source of mistakes.
A limit sell at a given price means "sell at that price or higher." If the market is already above that price when you place the order, it fills immediately at market price. This is not a stop-loss.
A stop-loss waits. It is a conditional trigger that only fires when the market reaches your specified level. It does not execute until that condition is met.
Using a limit sell to simulate a stop-loss is one of the most common mistakes in perps trading. If you set a limit sell below the current price, it fills immediately because the market is already above it.
How to attach TP/SL when opening a position
Add --tp and --sl to any order market or order limit command. This places your main order and the trigger orders together as a group, so your exits are set from the moment the trade opens:
byreal-perps-cli order market long 0.01 BTC --tp 110000 --sl 90000
byreal-perps-cli order limit buy 1 ETH 3000 --sl 2800The trigger orders are reduce-only, meaning they can only close your position. They cannot accidentally open a new one.
How to set TP/SL on a position you already have open
Use position tpsl with the coin name and your target prices:
To set only a stop-loss without a take-profit, use --sl on its own. To view what you currently have set, run position tpsl BTC with no flags. To cancel one or both:
byreal-perps-cli position tpsl BTC --cancel-tpremoves the take-profitbyreal-perps-cli position tpsl BTC --cancel-slremoves the stop-loss
When you set new TP/SL on a position that already has them, the old orders are cancelled first before the new ones are placed. The CLI retries up to twice and restores the old orders if the new ones fail to place.
Common mistakes to avoid
Set a stop-loss on an open BTC long
Place a market sell order
Closes the position immediately at market price
position tpsl BTC --sl 90000
Open a long with a stop-loss
Place a limit sell at the stop price
If price is already above that level, it fills right away
order market long 0.01 BTC --sl 90000
Update a stop-loss on an existing position
Place a new sell order
Opens a new short or closes the position at market
position tpsl BTC --sl <new price>