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.

json
{
  "symbol": "{{ticker}}",
  "side": "buy",
  "position": "long",
  "secret": "1234567"
}

Sell alert message

The indicator's downward condition.

json
{
  "symbol": "{{ticker}}",
  "side": "sell",
  "position": "short",
  "secret": "1234567"
}

Close alert message (optional)

Only if your indicator goes to cash.

json
{
  "symbol": "{{ticker}}",
  "position": "flat",
  "secret": "1234567"
}
Don't use conditions that fire in both directions at once (such as Trend Change); the robot cannot tell the direction.

Setting up in TradingView

  1. On the chart, add the indicator and open Alerts → Create alert.
  2. Condition: the indicator and its buy condition (e.g. “Crossing up”). Trigger: once per bar close is usually best.
  3. Notifications → Webhook URL: your TransisTrade URL. Message: the Buy message.
  4. Repeat for the sell condition with the Sell message, and — if your system has an exit — for the exit with the Close message.
Create a separate alert for each, with the matching indicator condition as the alert condition.

“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.

Related guides

Want to contribute?
Spot an inaccuracy or missing detail? Send us a note from the contact page — real humans read every message.