Indicator vs Strategy
Both work with TradeAdapter — the key difference is how you create alerts in TradingView.
The key difference #
You create one alert per action (Buy, Sell, Close, TP, SL…). Each gets its own message.
- 1 alert = 1 action
- You pick the condition and set the message
- Full control over every signal
You create just 1 alert for the entire strategy. TradingView sends order events (entry, exit, TP, SL) automatically.
- 1 alert = all actions
- Orders come from strategy logic
- Backtest-friendly
How to know which one you have #
-
Open Pine Editor in TradingView
Look at the first lines of your script. You’ll see either
indicator(...)orstrategy(...). -
No code access?
Create an alert (Alt + A). If you see “Order fills only” under Condition, it’s a strategy — one alert handles everything. If instead you see individual conditions like Long, Short, Buy, Sell, TP, SL, Exit, Close, etc., it’s an indicator — you’ll create one alert per action.
Quick comparison #
| Indicator | Strategy | |
|---|---|---|
| Alerts needed | 1 per action (buy, sell, close…) | 1 total |
| Signal source | Alert conditions you define | Strategy order events |
| Message format | Fixed values: "order_action": "Buy" |
Placeholders: "order_action": "{{strategy.order.action}}" |
| Backtesting | Not built-in | Built-in |
| Flexibility | Maximum — full control | Tied to strategy logic |
Common pitfalls #
-
Duplicate alerts (indicators)
Indicators can fire multiple times per bar. Use “Once per bar close” to avoid repeated signals.
-
Missing exits
If your alerts don’t include close/exit logic, positions may stay open. Make sure every entry has a matching exit.
-
Wrong message format
Indicator alerts use fixed
order_action/order_contracts. Strategy alerts use{{strategy.order.action}}/{{strategy.order.contracts}}placeholders. Use our Message Generator to avoid errors.