Skip to content

Glossary

What Is Pine Script? Indicators vs Strategies

Pine Script is TradingView's language for chart indicators and strategy simulations. An indicator computes visual or signal outputs, while a strategy can issue simulated order instructions. TradingLead offers its own documented Pine v5/v6 subset, called TLScript-Pine; it is not TradingView's hosted execution engine and does not guarantee that every script will work.

Indicator and strategy are different contracts

A script declared with indicator() might draw a moving average or mark a crossover. A script declared with strategy() can specify simulated entries and exits.

An arrow does not, by itself, say how many shares to buy, when an order becomes eligible, what fees apply or how to exit. Those details are essential to a meaningful backtest.

What Pine-style code looks like

Scripts commonly use candle series such as open, high, low, close and volume. A calculation like ta.sma(close, 20) describes a 20-bar simple moving average; an input lets the user adjust a setting.

The timeframe matters: 20 bars on a daily chart is not the same horizon as 20 bars on a five-minute chart.

Pine support on TradingLead

TLScript-Pine runs in Indicator Studio alongside Python. TradingLead validates source and supports a documented v5/v6 subset rather than promising every Pine feature.

Supported strategy() scripts use a separate Pine emulator in Backtesting. They do not become Python directional signals and do not send broker orders.

When porting code, inspect unsupported features, input types, data requests, warmup and actual trade timing. Matching source text does not ensure matching results on different data or engines.

Use the indicator guide for plots or the Pine strategy guide for simulated trades.

Limitations

  • Language similarity is not proof of identical data, execution, numerical or repainting behaviour.
  • A compiling script can still contain flawed logic or use future information.

Frequently asked questions

Does every Pine indicator produce a backtest?
No. Plotting arrows or conditions does not define order sizing, exits or executable strategy instructions.
Can all TradingView scripts run on TradingLead?
No. TradingLead implements a documented subset with validation and runtime limits. Compatibility, numerical equality and repainting behaviour are not guaranteed.
Does a Pine strategy place real orders on TradingLead?
No. Supported strategy() scripts run through Backtesting's Pine emulator; this is simulation, not broker order execution.

Last updated: