
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-English walkthrough of TradingView alerts: price vs. condition alerts, why bar close beats every tick, notification channels, and the mistakes that turn your phone into a slot machine.
Your phone buzzes. Gold just did something. You look, and by the time you have your chart open the move is gone, or worse, it never really happened because the candle reversed before it closed. That is what a badly built alert feels like: noise that trains you to ignore your own phone.
Done right, TradingView alerts are the opposite. They let you stop babysitting the screen and go live your life, while the platform watches your levels and your conditions for you. This is a practical walkthrough of how to set up TradingView alerts that fire when they should and stay quiet when they shouldn't. No fluff, just the settings that matter and the traps that catch people.
An alert is a rule that runs on TradingView's servers. When the rule is met, it notifies you through whatever channels you picked. The key word is servers: once an alert is set, it keeps watching even when your browser is closed and your laptop is asleep. You are not relying on a tab staying open.
There are two broad flavors, and knowing which one you want saves a lot of frustration.
Most of the interesting work lives in condition alerts, because a price level is dumb on its own. Price tags 2400 all day. A condition can encode why you care.
Start with the easy one to learn the interface.
That is a working price alert. Now the part that separates a clean setup from a noisy one.
When you create an alert you choose how often the condition is checked. The two options that trip people up are Once Per Bar and Once Per Bar Close.
For almost any trend, crossover, or indicator-based alert, Once Per Bar Close is the sane default. It costs you a few minutes of lag, and in exchange it filters out a huge chunk of false signals. Intraday scalpers sometimes want the faster trigger on purpose, but if you are not one of them, close the bar first.
There is also Only Once, which fires a single time and then deactivates, and Once Per Minute, which you rarely need. When in doubt, bar close.
A quick note on repainting, because it connects here. If an indicator's signal can change after the candle closes, an alert built on it will lie to you. A non-repainting signal, checked on bar close, is about as honest as an alert gets. What you were pinged about is what actually happened.
This is where alerts earn their keep. If you have an indicator on your chart that exposes alert conditions, you can point an alert straight at it. In the Condition dropdown, instead of the raw symbol, you select the indicator, and its available signals appear.
Good setups usually let you alert on discrete events: a long signal, a short signal, an exit, a stop being hit. That is far more useful than raw price, because the indicator has already done the thinking. You are being told "the setup you care about just occurred," not "a number was touched."
If you trade gold or Bitcoin specifically, alerting on a trend flip or a trailing-stop hit is worth more than a hundred price pings, because it maps to an actual decision. If you are still building out your gold workflow, our guide on how to trade gold on TradingView covers how to structure the chart before you ever add the alert.
Creating the alert is half of it. The other half is making sure you actually receive it in a form you will notice.
| Channel | Best for | Watch out for |
|---|---|---|
| App push | Real-time, on your phone | Needs the TradingView mobile app installed and notifications enabled |
| A written log you can search later | Can lag a bit and get buried; not for time-sensitive entries | |
| Popup + sound | When you are already at the desk | Useless when the browser is closed |
| Webhook | Sending the alert to another service | Advanced, and easy to misconfigure |
For most people, app push is the workhorse. Install the mobile app, log in, enable notifications at the phone level, and your alerts follow you around. Email is a nice backup and a searchable record, but do not rely on it for anything you need to act on in the next thirty seconds.
A webhook is TradingView sending a little packet of data to a web address you specify when the alert fires. People use it to pipe alerts into other tools: a spreadsheet logger, a Discord channel, a third-party service. It is genuinely useful and completely optional. If you do not know what a webhook is, you do not need one yet. It does not make TradingView place trades by itself; it just hands the message to something else that might.
Most people do not have an alert problem, they have a discipline problem dressed up as an alert problem. Here are the four that do the most damage.
The reason bar close and a written plan matter so much is the same reason backtesting matters: you want your live behavior to match a rule you can trust. If you have never pressure-tested the logic behind your signals, our walkthrough on how to backtest a strategy on TradingView is worth a read before you wire it to an alert.
If you want a template to copy, here is a boring, reliable one:
That setup will not spam you, will not fake you out on wicks, and will not leave you staring at a ping wondering what it means.
Once Per Bar can fire the moment your condition is true, mid-candle, even if price later reverses and the bar closes without meeting the condition. Once Per Bar Close waits until the candle finishes before checking, so you only get pinged on a confirmed signal. For most trend and crossover setups, bar close is the safer default.
Yes. The free plan gives you a limited number of active alerts, but they work the same way as on paid tiers. You create them, pick a trigger, choose your notification channels, and they run server-side even when your browser is closed. If you want more simultaneous alerts, that is one of the main reasons people move to a paid plan.
Usually because you set it to trigger on every tick or every bar instead of bar close, or you left it on "Once Per Bar" when you meant "Only Once." Check the trigger setting first. Repeated pings almost always trace back to the alert firing on unconfirmed price rather than a closed candle.
Not on their own. An alert is a notification. It can send a push, an email, or a webhook payload to another service, and that external service could act on it. But TradingView itself is telling you something happened, it is not executing an order. Treat every alert as a prompt to make a decision, not as a trade.
Set fewer alerts, close the bar before you trust them, and decide what you will do before your phone ever buzzes. That is the whole game. The tool is only as sharp as the rule you hand it.

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.