Indicator alerts
Alerts from an indicator (e.g. a moving-average cross) instead of a strategy: one alert per action.
Strategy or indicator?
A strategy alert fires on the strategy's own orders, so its message can carry the direction in placeholders ({{strategy.order.action}}, {{strategy.market_position}}). An indicator — a moving-average cross, an RSI level — has no orders: those placeholders stay empty and the alert arrives without a direction.
If the alert condition is the strategy's orders, use the Strategy message. If it is an indicator condition, use one Indicator message per action, with the direction written in.
Alert messages
Copy them from the terminal page (TradingView alert box → Indicator) — there they already carry your Account ID. 1234567 below is a placeholder.
If your indicator only has buy and sell conditions, two alerts are enough. Don't set up Close; when the opposite alert arrives the robot reverses the position on its own. If your indicator also goes to cash in between, that is, it has moments that say "exit and wait" (take profit, stop, end of session and the like), set up the Close alert for that condition as well.
Buy alert message
The indicator's upward condition.
{
"symbol": "{{ticker}}",
"side": "buy",
"position": "long",
"secret": "1234567"
}Sell alert message
The indicator's downward condition.
{
"symbol": "{{ticker}}",
"side": "sell",
"position": "short",
"secret": "1234567"
}Close alert message (optional)
Only if your indicator goes to cash.
{
"symbol": "{{ticker}}",
"position": "flat",
"secret": "1234567"
}Setting up in TradingView
- On the chart, add the indicator and open Alerts → Create alert.
- Condition: the indicator and its buy condition (e.g. “Crossing up”). Trigger: once per bar close is usually best.
- Notifications → Webhook URL: your TransisTrade URL. Message: the Buy message.
- Repeat for the sell condition with the Sell message, and — if your system has an exit — for the exit with the Close message.
“No direction in alert”
An alert rejected with “The alert message has no direction” means a strategy message was pasted into an indicator alert. Replace it with the matching Indicator message.