Most cloud trade copiers only support "all or nothing" — when an exit signal fires, the whole position closes. But serious strategies scale out: take 33% at TP1, 33% at TP2, and trail the rest. This guide shows exactly how to send partial close alerts from TradingView to MT5 so you can lock in profit in stages and let winners run.
Why Partial Closes Matter
Scaling out is one of the highest-impact changes you can make to a discretionary or systematic strategy. Instead of betting the entire position on a single exit, you bank profit as price moves in your favour and reduce risk on the remainder. The benefits:
- Lock in profit early — take money off the table at TP1 so a reversal can't turn a winner into a loser.
- Reduce drawdown — smaller remaining position means smaller swings against you.
- Let winners run — trail the final portion for the occasional outsized move.
- Pass prop firm challenges — staged exits smooth your equity curve and protect daily loss limits.
Key point: TradingView never touches your broker. It fires a webhook alert; your copier interprets it. To scale out, your copier must support a percent (partial volume) field — TradingView Copier Pro does.
How Partial Close Works
A partial close is just a normal close alert with one extra field: the percentage of the open position to close. When the alert arrives, the copier looks up the matching open trade on MT5 and closes that fraction of the volume, leaving the rest untouched with its existing stop loss and take profit.
- Your Pine Script hits TP1 → an alert fires
- TradingView sends the close-percent payload to your webhook URL
- TradingView Copier Pro finds the open position for that symbol
- It closes the requested percentage and keeps the remainder running
Partial Close JSON Templates
These map directly to the fields described in our TradingView alert JSON format guide.
Close 50% of a Position
{
"action": "close",
"symbol": "EURUSD",
"percent": 50
}
Close One-Third at TP1
{
"action": "close",
"symbol": "XAUUSD",
"percent": 33
}
Close the Remainder
{
"action": "close",
"symbol": "XAUUSD"
}
With no percent field, the copier closes the entire remaining position — perfect for your final exit or a stop-out.
Scaling Out at TP1, TP2 and Trailing the Rest
The most common pattern is a three-stage exit. Each stage is a separate TradingView alert mapped to the same symbol. Remember that percent applies to whatever volume is currently open, not the original size.
| Stage | Trigger | Alert | Result |
|---|---|---|---|
| Entry | Signal | buy 0.30 lots | 0.30 open |
| TP1 | +1R | close, percent 33 | ~0.20 remain |
| TP2 | +2R | close, percent 50 | ~0.10 remain |
| Trail | SL hit | close (full) | flat |
Pine Script: Firing the Right Alert at Each Level
In a Pine strategy you trigger alert() calls at each take-profit condition. Define the partial close message as a string and fire it when price reaches the level:
//@version=5
strategy("Scale Out Example", overlay=true)
// ... your entry logic sets strategy.entry ...
tp1 = strategy.position_avg_price * 1.01
tp2 = strategy.position_avg_price * 1.02
if strategy.position_size > 0 and high >= tp1
alert('{"action":"close","symbol":"EURUSD","percent":33}', alert.freq_once_per_bar)
if strategy.position_size > 0 and high >= tp2
alert('{"action":"close","symbol":"EURUSD","percent":50}', alert.freq_once_per_bar)
For a deeper walkthrough of firing alerts from strategies, see our TradingView Pine Script strategy alerts guide.
Moving to Break-Even After TP1
Once TP1 fills, most traders push the stop on the remaining position to entry so the trade is risk-free. Send a modify alert right after the partial close:
{
"action": "modify",
"symbol": "EURUSD",
"sl": 0
}
Your copier moves the stop loss on the remaining volume. Combine this with a trailing stop in your Pine logic to ride the final portion.
Common Partial Close Mistakes
- Percent of original vs. remaining —
percentalways acts on the currently open volume. Plan your stages accordingly. - Broker minimum lot — closing 33% of 0.03 lots can fall below the broker's 0.01 minimum. Size entries so each slice stays valid.
- Duplicate alerts — use
alert.freq_once_per_barso a single level doesn't fire repeatedly and over-close. - Wrong symbol mapping — the partial close must match the exact symbol of the open trade. Use your copier's symbol remapping if your broker suffixes pairs (e.g.
EURUSD.r).
If your exits fire but nothing happens on MT5, work through our TradingView webhook troubleshooting guide.
Scale Out in Under 50ms
TradingView Copier Pro supports partial closes, modify, and symbol remapping out of the box — bank profit at TP1/TP2 and trail the rest, fully automated on MT5.
Get TradingView Copier Pro →