Pine Script can’t trade on its own. TradingView’s documentation says scripts “cannot directly place orders on exchanges.” To run one live, something outside the script has to turn its signals into orders. There are three ways to do that.
The three routes
| Route | How it works | Good | Bad |
|---|---|---|---|
| Alerts and webhooks | TradingView sends an alert to a service that places the order | Keeps your script as it is | More steps that can fail, needs a paid TradingView plan |
| Rewrite it | Port the logic to Python or similar and run it on a server | Full control | Takes time, and the port can behave differently |
| Run it in a bot platform | The platform reads your Pine Script and places the orders | No alert chain | You depend on how well it matches Pine |
Each step of the webhook route can fail, so log every step and compare with your exchange’s order history.
Check your script first
Repainting. A strategy that repaints looks better on history than it trades live. TradingView’s FAQ explains that historical bars are evaluated once, at the close, so realtime behaviour can differ. Leave calc_on_every_tick off when you backtest, and check how you use process_orders_on_close.
Trailing stops. Built-in trailing stops assume price movement inside historical bars, which can cause repainting. A custom trailing stop that updates at the bar close avoids this.
Chart type. Backtests on Heikin Ashi, Renko and similar charts can be unrealistic, because their prices aren’t real traded prices. Test on standard candles.
Fees and slippage. Set both in the strategy properties, so the backtest counts them.
Order sizes. Exchanges have minimum order sizes and step sizes. A size that works in a backtest can be refused live.
Going live safely
- Test the script with costs included.
- Run it on virtual money and compare signals bar by bar.
- Create an API key with withdrawals off.
- Start with a small amount, and watch the first trades.
In Tradenos, you paste your Pine Script and it runs inside the app, with no alert or webhook in between. Tradenos isn’t open yet, so join the waitlist if that’s what you want.