Five Numbers in Your Alert
Your TradingView alert message carries the plan for the trade. Distances are in points from your entry fill:
{
"action": "{{strategy.order.action}}",
"market_position": "{{strategy.market_position}}",
"symbol": "MGC1!",
"qty": 10,
"sl_points": 8,
"tp1_points": 4,
"partial_qty": 5,
"tp2_points": 8,
"be_buffer": 1
}
SL_POINTS
Stop-loss distance for the whole position.
TP1_POINTS + PARTIAL_QTY
First target, and how many contracts close there.
TP2_POINTS
Final target for the contracts that are left.
BE_BUFFER
After TP1, the stop moves to entry plus this many points.
A Long of 10 Micro Gold at 4200
Entry fills: three orders go in
Stop for 10 at 4192. TP1 limit for 5 at 4204. TP2 limit for 5 at 4208. All three are real orders at the broker, priced from the actual fill.
TP1 fills: the stop follows
5 contracts close at 4204. The stop becomes 5 contracts at 4201: entry plus the 1-point buffer. The rest of the trade can no longer turn into a loss, barring slippage.
The trade finishes at TP2 or the breakeven stop
Whichever fills, the other order is cancelled, so nothing is left behind to open a position you didn't want. The trade is logged with what closed it, for example "TP1 + TP2" or "TP1 + Breakeven stop".
Questions About Partial Exits and Breakeven
Does the breakeven move need CopyTrade to be online?
Your stop-loss and both targets are real orders at the broker from the moment you enter, so they work on their own. Moving the stop to breakeven after TP1 is done by CopyTrade, which runs on its own servers, not your computer.
What if my strategy sends another alert while I'm in the trade?
An alert in the same direction is ignored and your open trade is left as it is. An opposite alert closes the open trade first, then opens the new one. Exit alerts from your strategy are ignored, because the stop and targets close the trade.
Can I use it without TP2 or without breakeven?
Yes. Leave out tp2_points to have no final target, or leave out tp1_points to have a single stop and no partial exit. If you use TP1 without setting be_buffer, the stop moves to entry plus 1 point.
Which brokers does this work on?
Tradovate (including Apex, Tradeify and Lucid accounts on Tradovate), Rithmic prop firm accounts, and TopstepX.