Pine Script
Pine Script is TradingView's programming language for creating custom indicators, strategies and alerts that run directly on its charts.
Explained
It is designed to be simple: a few lines can plot a moving average or define a strategy with entries, exits and backtest statistics. The current major version is Pine Script v5/v6.
Strategies written in Pine can be backtested in the Strategy Tester and connected to alerts that some brokers or third-party tools turn into orders.
Example
A basic Pine indicator: //@version=5, indicator("EMA"), plot(ta.ema(close, 20)).
Three lines plot a 20-period EMA on any chart.
Common mistakes
Trusting Strategy Tester results without realistic commissions and slippage.
Using future data by mistake (look-ahead bias) with request.security.
Copying public scripts without understanding them.
Questions traders ask
Is Pine Script hard to learn?
It is one of the easiest trading languages; basic indicators can be written in an afternoon.
Can Pine Script place real trades?
Not directly; it triggers alerts that can be routed to brokers via integrations or webhooks.