Pine Node Editor
Home Tutorial Guides Pricing
Add to Chrome
Guide

From the editor to a TradingView chart

Generate, paste, test, adjust.

1. Generate the script

When your graph is ready, use one of the two buttons in the toolbar:

  • Generate Pine Script shows the code in a window, with Copy and Download buttons.
  • Open in TradingView copies the code to the clipboard and switches to your TradingView tab (or opens a chart).

If the graph has a mistake, for example a required input that isn't connected, the editor tells you which node and port instead of producing broken code.

2. Paste it into the Pine Editor

  1. On the TradingView chart, open the Pine Editor panel at the bottom.
  2. Create a new script, select everything and paste (Ctrl+V / Cmd+V).
  3. Click Add to chart. The strategy's entries and exits appear on the candles and its results in the Strategy Tester.
Indicators in the wrong pane? TradingView remembers a script's pane when you paste new code over a script that is already on the chart. If an oscillator ends up over the candles, or an EMA in a separate pane, remove the strategy from the chart and add it again.

3. Change settings without regenerating

Every number you set in the editor (periods, thresholds, take-profit, stop-loss, levels) becomes an input in the strategy's Settings on TradingView. Tune them there and the backtest updates instantly. Regenerate only when you change the logic itself: add or remove nodes, or rewire them.

Position size, commission, slippage and starting capital come from the Strategy Settings node and also appear in the strategy's Properties tab.

4. Read the Strategy Tester

Look beyond net profit: number of trades, profit factor, maximum drawdown and the comparison with Buy & Hold. A backtest is a hypothesis, not a promise. See Can I trust this backtest?

How the generated strategy behaves

  • Signals are evaluated on closed bars; an entry fills at the next bar's open, like a real order placed after the bar closed.
  • Take-profit, stop-loss and trailing exits are resting orders, so they can fill inside a bar.
  • A new entry is skipped while a position is already open (unless you raise pyramiding or allow reversal in Risk Config).
  • Commission (0.1% by default) and slippage are included, so results aren't fee-free fantasy numbers.
  • Oscillators you choose to show (RSI, MACD, Stochastic…) are drawn in their own pane below the candles.

More guides: all guides · step-by-step tutorial · what's new

© Pine Node Editor. All rights reserved.
Guides Changelog Privacy Policy Terms of Service Contact