TP and SL Strategies

🔵 Intermediario · 2025-03-28

TP and SL Strategies

Take profit (TP) and stop loss (SL) are the two mechanisms that control when your grid bot exits positions. Grid-level TP handles individual trades, while global TP and SL manage the entire bot session. Understanding how these layers interact is essential for ambos maximizing profit and limiting downside.

Grid-Level Take Profit

Every time o bot compra at a nivel de grid, it places a corresponding take-profit ordem de venda at o proximo nivel de grid above. This is the core mechanic of grid trading: buy low, sell one level higher, pocket a diferenca.

The TP price for each entry level is simply o proximo nivel de grid up. Se vocer nivel de grids are at $95, $96, $97, $98, $99, and $100, a buy fill at $96 triggers a TP ordem de venda at $97. O lucro per trade equals one grid spacing minus fees.

This happens automatically and continuously. As long as o preco oscila within sua faixa de grid, o bot executes buy-sell cycles at each level, each capturing one grid spacing worth of profit.

The tp_mode Setting

The tp_mode configuration controls what happens after the global take profit target is reached. There are two modes:

tp_mode = “stop”: When the cumulative realized profit reaches your take_profit_pct target, o bot performs a clean shutdown. It cancels all open orders, closes any remaining positions, and exits. This is the conservative choice for traders who want to lock in a specific return.

tp_mode = “continue”: When the target is reached, o bot logs the event but continues trading. It resets the session PnL counter and keeps running. This suits traders who want o bot to run indefinitely and only stop manually or on grid break.

Setting Global Take Profit

The take_profit_pct parameter sets the total profit target as a percentage of your initial capital. Por exemplo, take_profit_pct: 5.0 means o bot trigger its TP action when cumulative realized profit reaches 5% of starting capital.

When choosing a global TP target, consider:

  • Grid spacing: If each trade profits 0.5%, voce precisa roughly 10 completed round trips to reach 5%. How long will that take given current volatility?
  • Time horizon: Altaer targets require more time and more favorable conditions. A 2-3% target for a weekly run is more realistic than targeting 20%.
  • Compounding: Profits from completed grid trades are available as margin for new trades, creating a mild compounding effect over time.

Setting Stop Loss

The stop_loss_pct parameter defines the maximum acceptable loss before o bot shuts down. When unrealized plus realized losses exceed this percentage, o bot triggers a clean shutdown.

Stop loss works as a last line of defense. It catches scenarios where o preco cai through your entire faixa de grid and keeps falling. Without a stop loss, a long grid bot would hold its accumulated positions indefinitely as they lose value.

Recommended stop loss settings depend on sua alavancagem and range:

LeverageSuggested SL Range
1x10-20%
2x8-15%
3x5-10%
5x3-7%

Layered Protection

The best gestao de risco uses multiple layers:

  1. Grid-level TP: Captures profit on each individual trade automatically.
  2. Grid break detection: Shuts down o bot when price exits the faixa de grid, before positions accumulate dangerously.
  3. Global SL: Catches extreme scenarios where grid break alone is insufficient.
  4. Global TP (with tp_mode=stop): Locks in profits when your target is reached.

These layers are independent and complementary. Grid break protects against range violations. Stop loss protects against total capital loss. Global TP secures your gains.

Erros Comuns

Setting SL too tight: A stop loss at 2% will trigger frequently during normal volatilidade do mercado, closing o bot before it can recover. Your SL should be outside the range of normal drawdowns.

No SL at all: Running sem a stop loss at leverage above 1x is dangerous. A flash crash or sustained downtrend can wipe out sua conta before voce pode react manually.

Conflicting TP and SL: Se vocer TP target requires 50 completed trades but your SL triggers after 5 unfilled levels, the SL will fire long before TP is reachable. Ensure your SL gives o bot enough room to reach its TP under normal conditions.

Ignoring tp_mode: Leaving tp_mode on “continue” when you intended to lock in profits means o bot keeps running past your target. Sempre set this deliberately based on sua estrategia.

Resumo

  • Grid-level TP automatically sells one nivel de grid above each buy, capturing the spacing as profit on every cycle.
  • Global TP and SL control the entire bot session; use tp_mode “stop” to exit at seu lucro target or “continue” to keep running.
  • Layer grid break, stop loss, and global TP together for comprehensive protection at every risk level.

Proximo Passo

Learn how to adapt your grid strategy to bullish conditions in Grid Trading in Bull Markets.

✨ Este artigo foi util?

Faca suas perguntas no Discord →