Tools & Platforms

Pine Script: Build Your Own TradingView Indicators

Pine Script is TradingView's scripting language — learn the basics to build custom indicators and alerts.

Key rules

  1. Pine Script v5 is the current standard — use it over v3/v4
  2. plot() renders a line; plotshape() renders symbols on the chart
  3. ta.crossover() and ta.crossunder() detect indicator crossovers
  4. Add alert conditions with alertcondition() for automated notifications
  5. Test scripts in the strategy tester before going live

Pine Script v5 is a domain-specific language for writing custom indicators and strategies. A basic indicator requires a few lines: define the source, apply a function (e.g. ta.ema()), and plot the result. More advanced scripts include alerts, conditions, and backtesting.

Most useful starting points: replicating an indicator you already use, adding alerts, or building a custom multi-condition entry signal.

Related lessons