Skip to content

Pine Script editor

Paste or write Pine Script, check it and run it on a live chart of crypto, stocks, forex or commodities.

How it works

1. Open My scripts
On the chart open Indicators, then the My scripts tab.
2. Paste or write the code
Paste Pine Script, write it in the editor or import a file.
3. Check the script
The check flags errors and unsupported code, with the message and its position in the source.
4. Add it to the chart
The script runs on live candles. Its inputs are in the Settings window, like those of a built-in indicator.

What is Pine Script

Pine Script is a scripting language for trading indicators and strategies. A script reads price and volume bar by bar and draws lines, shapes and labels on the chart. Most custom indicators traders share are written in it.

What the editor does

Check before it runs
Before a script is added to the chart it is checked against the current chart. If it uses something Charts does not support, you see a diagnostic instead of a wrong plot.
Inputs from the source
Inputs come from the declarations in the code. Change them in Settings without touching the source.
Edit saved code
In My scripts open the row menu and choose Edit code. The editor keeps the source next to the chart.
Written from a description
Describe the indicator in plain words and get the Pine Script. AI Pine Script generator
Export to MetaTrader 5
A Pine indicator exported as an MQL5 file, on Premium. Pine Script to MQL5 converter
Access for other people
Give a person access to your script by Telegram ID in My scripts. Remove the ID to take it away.

Plans

My scripts is available on Plus and Premium. Plus runs Pine scripts. Premium adds MQL4 and MQL5 scripts (beta) and AI translation to MQL5.

Frequently asked questions

Can I run Pine Script online without installing anything?

Yes. The editor and the chart work in the browser, on desktop and on a phone.

What happens if my Pine Script uses something that is not supported?

The check shows a diagnostic with the message and the position in the source. Edit the code and check again. A successful check does not validate the trading logic.

Can I write Pine Script with AI?

Yes. In My scripts choose Describe, type what the indicator should do and generate the script. You can then change it with a sentence or edit the code yourself.

Can I use a Pine Script indicator in MetaTrader?

On Premium a Pine indicator can be exported as an MQL5 file for MetaTrader 5.

Is the Pine Script editor free?

My scripts is part of Plus and Premium. The Free plan has the chart, the built-in indicators, volume profiles, Replay and drawing tools.