How to move stop loss to breakeven: after the first or second take-profit
Updated:
The Breakeven setting tells you how to move stop loss to breakeven in the Snapback bot, meaning after which take-profit the stop shifts from its original level above the entry to the entry level or slightly below. A general explanation of the idea is in the article on the breakeven stop loss.
What it means in plain words
At first the stop sits above the entry: if the price goes against the short, the trade closes at a loss. When the price has fallen and the first (or second) take-profit has filled, part of the profit is already locked in. To keep the rest of the position from turning that into a loss, the stop is pulled down to the entry. Now the worst that can happen to the remainder is an exit at roughly zero.
Why it exists
The setting removes the risk of losing after a trade has already gone partly into profit. The price of this is that an ordinary price wiggle can knock the position out at the moved stop before it reaches the far targets.
How it works in the code
There are three options: 0 (never), 1 (after the first take-profit) and 2 (after the second). When a take-profit with a number not less than the chosen one fills, the bot replaces the stop once. The new price depends on the fee adjustment:
- with the adjustment (on by default):
entry price x (1 - (3.6 + 10) / 10000), which is 0.136% below the entry, rounded down to the price step. The numbers 3.6 and 10 are the service's standard fees in basis points: for entry (maker) and for exit (market stop); - without the adjustment: exactly the entry price.
Illustration of the mechanism only, not advice: the entry is 100. With the adjustment the stop becomes 99.86, without it 100. If the stop triggers afterwards, the exit reason is recorded as "breakeven".
Validation: the take-profit number for breakeven must be less than the total number of take-profits. With two take-profits only "after the first" is possible. With one take-profit breakeven is unavailable, because the first take-profit is also the last.
In the wizard only the "when" choice can be changed; the fee adjustment always keeps the default from the code, which is on.
Allowed values and defaults
- Breakeven: 0, 1 or 2; the default in the code is 0 (don't apply); the wizard form starts at 1.
- Fee adjustment: on; it cannot be changed in the wizard.
What happens if it is earlier or later
- Earlier (after the first take-profit): protection kicks in sooner, but the stop can also be hit before the far targets fire.
- Later (after the second): the original, wider stop stays in force longer, but the moved stop switches on only when more profit has been collected.
- Don't apply: the stop stays at its original level to the end, and part of the position may close at it even after take-profits have filled (reason "partial_then_stop").
How it connects to other settings
- Number of take-profits and split: limits which take-profit number is allowed.
- Stop-loss: this is the original stop that gets moved.
- How a trading bot protects a position: the overall picture.
Common mistakes
- Thinking breakeven guarantees zero. The stop can fill with slippage, and the actual fee can differ slightly.
- Expecting the move to happen without a filled take-profit: it depends on exactly that.
- Choosing breakeven with a single take-profit: that combination is rejected.
Where to find it in the bot wizard
The "New bot" or "Edit" form, the "Exit" block, the "Breakeven" drop-down with the options "don't apply", "after the first take-profit" and "after the second take-profit".
Frequently asked questions
What does breakeven mean in the bot settings?
After the chosen take-profit fills, the bot moves the stop-loss from its original level above the entry to the entry level or slightly below it, so the rest of the position does not end in a loss.
After which take-profit can the stop be moved?
After the first or after the second. You can also choose not to move it at all.
Why can't I choose breakeven after the last take-profit?
After the last take-profit the position is already fully closed, so there is nothing to move. The configuration rejects such a choice.
What is the fee adjustment for breakeven?
Entering and exiting cost fees, so a stop exactly at the entry price would still give a small loss. With the adjustment the stop sits slightly below the entry so that a trigger comes out at about zero.