Alert Request Format v1.x
This guide details the required JSON format for TradingView alerts to work with Xerolite. Each field in the alert message must follow the specified format below.
Built-in Tools to Help You
Alert Request Builder: Use Xerolite’s built-in tool to easily construct your alert requests in the correct JSON format.
Alert Message Validator & Sender: Test and validate your orders before sending them to TradingView.
Important Note About Alert Names
When multiple orders share the same alert name, they are considered part of the same trading strategy. This ensures accurate profit/loss tracking and allows the system to manage pending orders effectively. Always use consistent alert names for related orders.
Field | Description | Mandatory | TradingView PlaceHolder |
---|---|---|---|
name | The alert name is a critical identifier that groups related orders together. It is used for PnL calculation and order management. | – | |
symbol | The stock ticker symbol (e.g., ‘AAPL’). | – | |
currency | The currency of the trade (e.g., ‘USD’). | {{syminfo.currency}} | |
asset_class | The class of the asset, e.g., ‘STOCK’, ‘FOREX’, ‘FUTURE’, or ‘INDEX’. | – | |
exch | The exchange where the order will be placed (e.g., ‘SMART’ for US STOCK). | – | |
acc_no | IB account number. Required only if multiple accounts are linked to the same TWS login. If a single account is used, this field is optional and will be ignored if provided. |
– | |
action | The order action, either ‘BUY’ or ‘SELL’. | {{strategy.order.action}} | |
qty | The quantity of the asset to trade (e.g., ‘10.00’). | {{strategy.order.contracts}} | |
tif | Time-in-Force for the order, such as ‘DAY’ or ‘GTC’ (Good Til Cancel) or ‘IOC’ (Immediate or Cancel). Default to ‘DAY’ if not specified. |
– | |
order_type | The type of order, such as ‘LIMIT’, ‘MARKET’. Default to ‘MARKET’ if not specified |
– | |
price | The price for the order if ‘order_type’ is ‘LIMIT’ (e.g., ‘210.00’).
Mandatory if ‘order_type’ = ‘LIMIT’:
For limit order, the price will be rounded to the nearest valid increment based on IB market rules. Learn more. |
{{strategy.order.price}} | |
sl | The stop-loss price for the order (e.g., ‘110.00’).
The price will be rounded to the nearest valid increment based on IB market rules. Learn more. |
– | |
sl_offset | The stop-loss offset as a percentage or fixed value. Will be ignored if ‘sl’ is configured. Examples:
|
– | |
tp | The take-profit price for the order (e.g., ‘130.00’).
The price will be rounded to the nearest valid increment based on IB market rules. Learn more. |
– | |
tp_offset | The take-profit offset as a percentage or fixed value. Will be ignored if ‘tp’ is configured. Examples:
|
– |
Need Help?
If you encounter any issues or need assistance, please contact our support team at support@xeroflex.com