Start
Introduction
What Pine Script on Tradequix is, where your code runs, and how to read these docs.
Tradequix runs Pine Script v6, the language TradingView made popular for indicators and strategies. You write a script in the editor, and it draws on the live chart in front of you: lines, histograms, markers, labels, tables, and strategy backtests.
The engine underneath is PineTS, an open-source runtime for Pine Script. It runs the same bar-by-bar model as Pine, so most scripts written for TradingView run here unchanged. Where they don't, it is almost always because of the data, and these docs say exactly where that happens.
Where your code runs#
| Your script is | It runs | Who can read the code |
|---|---|---|
| A draft or a private script | In your browser, in a background worker | Only you |
| Published open source | In each viewer's browser | Anyone |
| Published protected or invite-only | On the Tradequix server | Only you. Subscribers receive computed values, never the source. |
Running in a worker means a slow script never freezes the chart. Running closed scripts on the server is what makes selling access possible without giving the code away.
A 60-second tour#
- Open the terminal at /chart and choose Pine Script in the side rail.
- The editor opens with a starter script. Press Add to chart (Ctrl Enter) and it draws.
- Change a number and add it again. The chart updates in place.
- Save (Ctrl S) keeps the script in your account.
- Publish puts it in the community catalogue, open or closed.
Every example in these docs has a Run button of its own. Try one:
//@version=6indicator("Two averages", overlay = true)fast = ta.ema(close, 21)slow = ta.ema(close, 55)plot(fast, "EMA 21", color = color.new(#8b7cff, 0), linewidth = 2)plot(slow, "EMA 55", color = color.new(#ffb547, 0), linewidth = 2)It runs on a fixed, generated EUR/USD-style series, so it works signed out and draws the same picture for everyone. Open in editor takes the code to the terminal, where it runs on the real feed.
How to read these docs#
- Start gets you running and explains the one idea everything else depends on: a script runs once per bar.
- Write covers each part of the language you will use: plots, inputs,
ta.*, drawings, other timeframes, strategies, alerts. - On Tradequix is what is specific to this platform: the data, publishing and selling, and debugging.
- Reference has the coverage tables, the built-in catalogue, a cookbook, and how to write Pine with an AI assistant.