On Pro you can write an indicator as a script and run it on the Chart page. Open Indicators and choose + New under My scripts. Paste or type a script, then Save and run. It draws on the chart and is saved to your account, where only you can see it.
What runs
Scripts use a Pine Script®-compatible syntax, a subset of versions 5 and 6. Indicator scripts run with their variables, var, history, functions, if, switch, loops, arrays, plots, shapes, fills, backgrounds, bar colours, candles, lines, boxes, labels, tables, inputs, request.security, and the common ta., math., str. and color. functions.
What does not run yet: custom types, methods a script declares itself, matrix, map, strategies and libraries. A script that uses one tells you the line and the feature.
Settings
The gear on a script's row opens its settings: Inputs are the ones the script declares, Style its plots' colours and lines, Visibility the timeframes it shows on. Changes show on the chart as you make them; Ok keeps them and Cancel puts them back. The {} button opens its code.
Limits
5 scripts on a chart at once and 50 saved. A script can read 4 other symbols or timeframes. A script is stopped after 10 seconds, or if a loop runs too many times.
On your phone
Scripts that draw on the price pane can be switched on from the chart's menu. Writing and editing them is on the desktop.
Scripts written by someone else
Paste only code you wrote or are allowed to use, and keep its copyright and licence lines as they are: the script is saved exactly as you paste it. If a script says it is for non-commercial use, the editor asks you to confirm you have the right to use it here before it saves.
Results may differ
A script here can give different numbers from the same script elsewhere, particularly on the first bars of a chart. What a script shows is your own work, not advice.
Pine Script® and TradingView® are registered trademarks of TradingView, Inc. Ledger of Alpha is not affiliated with, sponsored by, or endorsed by TradingView. References to Pine Script® describe language compatibility only.