Indicator vs. Strategy: Key differences in TradingView
In TradingView, indicators and strategies serve distinct roles. Indicators compute calculations and draw plots, shapes, or tables on charts. They cannot track position size, calculate net profit, compute drawdowns, or record trade logs. Strategies, by contrast, run within TradingViews built-in broker emulator. Every signal is simulated as a simulated buy or sell order, populating the Strategy Tester tab with metrics like win rate, profit factor, maximum drawdown, and equity curves.
| Feature | indicator() script | strategy() script |
|---|---|---|
| Primary purpose | Visual charting and custom study plots | Automated trade simulation and backtesting |
| Order execution | Unsupported (no strategy.* calls) | Full support for market, limit, stop orders |
| Strategy Tester tab | Inactive | Active (displays trades, metrics, equity curve) |
| Alert mechanism | alertcondition() and alert() | alert() and built-in order execution alerts only |
| Position tracking | Manual calculation required | Built-in (strategy.position_size, avg_price) |