Pine strategy() vs indicator: which for prop-firm alerts?
Both can fire alerts, but only one carries order details a bridge can execute. Here's the practical difference and which to pick for automated prop trading.
In Pine, the script type decides what your alerts can say.
| strategy() | indicator (study) | |
|---|---|---|
| Backtests | Yes (Strategy Tester) | No |
| Order-aware alerts | Yes — {{strategy.order.*}} | No — alert()/alertcondition() only |
| Carries action + qty | Yes | You must hardcode it |
| Best for | Automation via a bridge | Manual signals / lightweight alerts |
Why strategy() wins for automation
A bridge needs to know buy or sell, how many, and entry or exit. A strategy() exposes those as placeholders, so one alert maps cleanly to one order. See the ready JSON templates.
The catch with strategy()
Because it backtests, it's easy to trust the tester's optimistic fills. A strategy is only as honest as its fill and cost model — read why backtests don't match live before you rely on the curve.
When an indicator is fine
If you trade manually and just want a heads-up, an indicator with alert() is lighter and flexible. You read the alert and place the order yourself — no order placeholders needed.
For prop automation
Use a strategy() so entries, exits and size flow to the bridge automatically, but validate fills realistically. That's the setup behind automating MNQ on a funded account.
FAQ
Should I use a strategy or an indicator for automated trading?
A strategy(), because it exposes order-aware alert placeholders ({{strategy.order.action}}, contracts, price) that a bridge can execute directly. Indicators only plot and fire generic alerts.
Can an indicator send alerts to TradersPost or PineConnector?
It can fire an alert, but without order placeholders you must hardcode the action and size, which is error-prone. A strategy() is cleaner for automation.
Is a strategy backtest reliable for live trading?
Only if its fills, commission and slippage are modelled realistically and it's validated out-of-sample. An optimistic Strategy Tester curve will not match live results.
Not financial advice. Performance figures referenced are hypothetical, modeled outputs (1,500-path Monte Carlo on a 12-month sample). Past performance does not guarantee future results. Tool names are referenced for education; verify current features and prop-firm rules directly.