This guide outlines three new alert commands you can use within TradingView to automate partial closes in lots, partial closes by percentage, and moving a position’s stop loss (SL) to breakeven. By the end, you’ll know exactly how to set up each command and what data is required.
Purpose:
These new commands enable more precise trade management directly from TradingView alerts. Rather than manually adjusting positions, you can automate partial closes and SL adjustments to breakeven.
Who Should Read This Guide:
Traders using TradingView who are comfortable creating custom alerts, and who have some understanding of order management and stop-loss strategies. Basic familiarity with JSON alert formatting is helpful but not strictly required.
Overview:
Required Parameters:
lotSize
(number, mandatory)
Alert JSON Structure:
{
"type": "partially_close_by_lot",
"assistId": "unique_assist_id",
"source": "forex",
"symbol": "forex_symbol",
"lotSize": 0.1,
"date": "{{time}}"
}
type
– Must be "partially_close_by_lot"
.assistId
– Unique identifier for your alert or assistant logic.source
– The market or strategy source, e.g., "forex"
.symbol
– Instrument symbol, e.g., "EURUSD"
.lotSize
– The lot size to close.date
– Recommended to pass {{time}}
from TradingView for timestamping.How to Add in TradingView:
Validation Steps:
lotSize
parameter.