
What Is Pine Script? A Plain-English Guide to TradingView's Language
The code behind every custom indicator and strategy on TradingView, explained without the jargon and without turning you into a programmer.
A plain walkthrough of the Inputs and Style tabs so you can tune lengths, colours, and alerts on any indicator, using a trend tool's sensitivity as the worked example.
Every TradingView indicator ships with a settings panel most people never open. They add the tool, glance at the default look, decide it is too noisy or too slow, and move on. That is a shame, because knowing how to customize TradingView indicator settings is the difference between fighting a tool and making it fit your chart.
The good news: almost every indicator, free or paid, uses the same handful of tabs. Learn them once and you can tune anything. We will use a trend indicator's sensitivity as the running example, because that is the setting people most often want to change, and it happens to mirror how you would set up something like Vektor.
There are two ways in, and both land in the same place.
That opens a panel with tabs across the top. For most indicators you get Inputs, Style, and Visibility. Some add a Properties tab. If you have never done this, add any indicator first. Our guide to adding an indicator to TradingView covers that step.
One quick note on scope. Changing settings here only affects this indicator on this chart, until you save it as a default. Nothing you do can break the tool or lose your data. Poke around freely.
Inputs is where the actual behaviour lives. Everything else is cosmetic. This is the tab worth understanding.
What you see depends on the indicator, but the common fields are:
Here is the mental model. Length is a trade-off between speed and steadiness.
A short length reacts fast. On a trend indicator that means it flips from long to short quickly, catches turns early, and also fires more false signals in choppy price. A long length is slow and calm. It ignores small wiggles, keeps you in a trend longer, and gives back more at the top or bottom of a move because it confirms late.
There is no magic number. A faster setting suits short holding periods and active charts. A slower setting suits swing trades and higher time frames. If you are weighing those two styles, our piece on swing trading vs day trading is a useful companion.
A sane way to tune it:
The goal is not the setting that looks best on the last month of price. That is curve-fitting, and it is how people fool themselves. The goal is a setting whose logic you can explain and would still trust on a chart you have not seen. To pressure-test a choice properly, run it through TradingView's bar replay and step through history bar by bar.
Most people leave source on close and never touch it. That is fine. Close is the honest price, the one the market agreed on when the bar finished.
Multiplier matters on band and trailing-stop tools. A bigger multiplier pushes the band or stop further from price, so you get shaken out less but sit through deeper pullbacks. A smaller one hugs price and stops you out sooner. If the tool draws a trailing exit, this is the setting that controls how much room it gives. Our explainer on what a trailing stop-loss is unpacks why that room is a real decision, not a detail.
Style changes nothing about the math. It changes whether you can actually read the chart. Do not skip it, because a cluttered indicator is a useless one.
Here you can:
| Setting | What it controls | When to change it |
|---|---|---|
| Plot checkboxes | Which lines actually draw | Hide clutter you never read |
| Colour | Line and label colour | Match your theme, split long vs short |
| Line width | Thickness of plots | Make the main signal stand out |
| Opacity | See-through level of fills | Stop bands from hiding the candles |
A practical habit: pick one colour for long, one for short, and mute everything else to a faint grey. If a plot does not change a decision you make, hide it. While you are at it, a clean chart background helps, which our notes on the best TradingView chart settings go into.
This tab is small but handy. It lets you set the time frames an indicator appears on. If you tuned a tool for the daily chart, you can hide it on the one-minute so it does not clutter a lower time frame where its length no longer makes sense. Set it and forget it.
Once the indicator behaves the way you want, you probably want it to tell you when something happens instead of you watching all day. That is the point of alerts.
Many indicators expose alert conditions you can pick when you create an alert, so you can be notified on a fresh long or short rather than staring at the screen. The exact steps live in our walkthrough on setting up TradingView alerts, including how to get them to your phone.
The honest caveat here: an alert is a message, not a trade. It tells you the tool changed its mind. What you do next, and how much you risk, is on you. Which is the whole reason to have a plan for risk management in trading before the alert ever fires. A common rule of thumb is to keep the risk on any single trade small, often around one percent of the account, though that is a guideline, not a promise.
You tuned the length, cleaned up the colours, set the visibility. Now save it. On desktop, open the settings panel and look bottom-left for the Defaults menu. Choose Save As Default. From now on, every fresh chart loads that indicator with your values instead of the factory ones.
The same menu has Reset Settings, which drops you back to the original values if a session of tinkering went sideways. No harm done.
One more tip for people who run several setups: save the whole chart as a template (Chart Settings, then the templates menu) so your indicators, colours, and time frames come back together in one click.
The reason to learn all this is not to fiddle. It is to understand what a tool is doing before you trust it. A trend indicator with a length you chose on purpose, colours you can read, and alerts you understand is a tool you can actually reason about. One you dropped on the chart and never opened is a black box.
That understand-before-you-trust habit is exactly the mindset behind Vektor, a one-time TradingView tool for gold and Bitcoin that reads the trend, says long, short, or flat, waits most of the time, and plots its exit as a trailing stop. You still get the same settings panel, so you can see and check what it is doing rather than take it on faith. It is information, not financial advice, and it does not place trades for you.
If you want to go deeper on tools worth tuning, our roundup of the best paid TradingView indicators is a fair starting point, and the Supertrend explainer is a good look at how a length-and-multiplier trend tool actually works.
Hover over the indicator's name in the top-left of the chart and click the gear icon, or double-click the indicator's line or label directly on the chart. Both open the same settings panel with Inputs, Style, and usually Visibility tabs.
Length is how many bars the indicator looks back to do its math. A shorter length reacts faster and flips more often. A longer length is slower and steadier. Lowering it makes a trend tool more sensitive; raising it makes it calmer.
In the settings panel, use the Defaults menu (bottom-left on desktop) and choose Save As Default. New charts will load the indicator with your values instead of the factory ones. You can reset to factory from the same menu.
Yes. The Inputs and Style tabs work the same on the free plan. Plan limits affect things like how many indicators you can stack and how many alerts you can run, not whether you can change a length or a colour.

The code behind every custom indicator and strategy on TradingView, explained without the jargon and without turning you into a programmer.

How to run TradingView on your phone without kidding yourself about what the mobile app can and cannot do versus desktop.

One sells a broad signal toolkit on a subscription. The other sells a single focused trend call for a one-time price. Here is the honest breakdown.