0%
TRADINGVIEW

Pine Script Strategy vs Study: One of Those Words Was Retired

Heads up: some links below are affiliate links. If you sign up through them we may earn a commission at no extra cost to you - it never changes what we recommend.

Short answer

There is no study() in current Pine Script. TradingView renamed it indicator() in version 5, and Pine has been on version 6 since November 2024. The live comparison is indicator versus strategy: only a strategy simulates orders, and only an indicator can create alertcondition() alerts.

Not planning to write either one?

The LPFT Copilot runs a tested, rules-based method on your own Tradovate account, so there is no declaration to choose and no script to maintain. 7-day free trial.

Start your 7-day free trial

The short version: one of these two words was retired

If you searched for strategy versus study, you have almost certainly landed on pages that answer the question as though both words were current. They are not. The comparison you want is strategy versus indicator, and the reason nobody says so is that the material on this topic is old.

TradingView's own migration guide for version 5 lists the change in a single line: changing study() for indicator(), with a note that the function's signature has not changed. Same arguments, same behaviour, different word. In the same release strategy.entry() and strategy.order() swapped their long argument for direction, and the resolution arguments became timeframe.

Pine then moved on again. The release notes for November 2024 announce that Pine Script has graduated to version 6, and that from that day future Pine updates apply exclusively to that version. So the word study() has been out of the documentation for two major releases.

Why this is worth more than a vocabulary note

A tutorial that teaches study() was written before version 5. Everything else on that page is from the same era, including whatever it tells you about alerts, backtesting and automation, and those are the parts where being out of date actually costs you something.

What the rename tells you about the page you are reading

Pine Script version timeline showing study renamed to indicator at version 5 and version 6 as the current release
One word changed across three releases, which makes it a precise date stamp.

Use it as a filter. If the page says study(), treat every other claim on it as unverified until you check it against the current manual. This is not pedantry about naming. Pine has changed a great deal in two major versions, and the topics that moved most are exactly the ones people come here for.

If you are starting from zero rather than untangling an old tutorial, Pine Script for beginners is the version of this that assumes nothing.

Indicator versus strategy, the comparison that does still exist

Both are Pine scripts. The difference is declared on one line, and that line decides what the script is allowed to do for the rest of its life.

 indicator()strategy()
DeclaresA calculation and what it drawsA calculation plus simulated orders
Simulates tradesNoYes, through the built-in broker emulator
BacktestingTradingView states that indicators contain calculations but cannot be used in backtestingStrategy Tester report, with a maximum of 9,000 orders when backtesting
alertcondition()Works, and each call spends one of the sixty-four plot countsCompiles, but TradingView states no alert can be created from it
alert()WorksWorks, and complements alerts on order fill events
Alerts on order fillsNot applicableYes, with a custom alert_message per order call
Cost to runTradingView says indicators often use fewer resources and run fasterNeeds the broker emulator on every bar
On realtime barsExecutes as the data updatesNormally executes once, when the bar closes, unless configured to run on each update

TradingView draws the practical conclusion itself, in the primer: it is thus advantageous to use indicators whenever you can. That is a resource argument rather than a philosophical one, and it is the opposite of the advice you usually get, which is to declare everything as a strategy so you can see a backtest.

The alert difference is the one that decides automation

For anyone planning to send a signal out of TradingView, one row in that table matters more than all the others, and it is the row nobody warns you about.

TradingView's wording: while the presence of alertcondition() calls in a strategy script will not cause a compilation error, alerts cannot be created from them. So a strategy containing alert conditions compiles perfectly and produces no alert, ever, with no message anywhere explaining why.

There are two further limits on alertcondition() worth knowing before you build around it. Its message argument must be a const string, which TradingView says must be known at compilation time and cannot vary bar to bar, so it cannot carry a live price or a position size. And the calls must start at column zero of a line, so they cannot sit inside a conditional block the way an alert() call can.

A compiling script is not a working one

This is the cleanest example in Pine of a script that is syntactically correct and functionally dead. It is also the most common reason a working indicator stops notifying anything the day somebody converts it. The full walkthrough is in turning a TradingView indicator into a strategy.

Whichever route raises the signal, the signal still has to leave TradingView and reach a broker, and no Pine script does that part. That handoff is covered in can you automate trading on TradingView and how to auto-execute a TradingView strategy on a futures broker.

Which one should you declare?

  1. You want to see something on the chart. Declare an indicator. It is lighter, it runs faster, and it can raise either kind of alert.
  2. You want a performance report on an idea. Declare a strategy. It is the only route to the Strategy Tester, because an indicator cannot be backtested at all.
  3. You want a webhook that fires when a rule triggers. Either works, but the mechanism differs. An indicator can use alertcondition() or alert(). A strategy must use alert() or alerts on order fill events.
  4. You want orders placed automatically. Neither, on its own. A strategy simulates orders inside TradingView. Real orders need something outside it.
  5. You are unsure. Start as an indicator. Converting later is a small job, and starting as a strategy hides the alert problem above until the worst moment.

Whatever you declare, read the Strategy Tester output with suspicion rather than relief. The habits that make a backtest worth anything are in how to backtest before you automate.

Trading futures carries a significant risk of loss. Choosing the right declaration makes a script correct, and a correct script can still lose money on every trade it takes.

How to date a Pine tutorial in ten seconds

None of this makes an old tutorial worthless. Concepts age well and the language is still recognisable. It just means you should keep the current reference manual open in a second tab and check every function name you meet, rather than assuming the page in front of you is describing the Pine you are typing into.

Frequently asked questions

The word study is obsolete. TradingView renamed study() to indicator() in Pine version 5 and noted that the signature had not changed. The current comparison is indicator versus strategy: an indicator calculates and draws, while a strategy also simulates orders through the built-in broker emulator and produces a backtest report.

It is not part of current Pine. It was replaced by indicator() at version 5, and TradingView announced in November 2024 that Pine had graduated to version 6 and that future updates apply exclusively to that version. Write indicator(), and treat any tutorial still using study() as predating that rename.

No. TradingView states that Pine Script indicators contain calculations but cannot be used in backtesting. Only a script declared with strategy() reaches the broker emulator and the Strategy Tester. If you need a performance report, you need a strategy declaration.

Start with an indicator unless you specifically need simulated orders. TradingView says indicators often use fewer resources and run faster because they do not require the broker emulator, and its own primer concludes that it is advantageous to use indicators whenever you can. Converting to a strategy later is a small job.

Because they cannot. TradingView states that while the presence of alertcondition() calls in a strategy script will not cause a compilation error, alerts cannot be created from them. The script compiles and the alert simply never exists. In a strategy, use alert() calls or alerts on order fill events instead.

Version 6. TradingView's release notes for November 2024 state that Pine Script has graduated to v6 and that from that point future Pine updates apply exclusively to this version. Any new script should start with a version 6 annotation on its first line.

Eli Y., founder of Live Prop Firm Trading

Eli Y.

Founder · Live Prop Firm Trading

Eli builds and runs rules-based automated futures systems on TradingView and Tradovate, and helps traders take emotion out of the screen. He writes about futures automation, prop-firm evaluations, and the tools that connect them - plainly, and without hype.

Risk disclosure: Trading futures involves substantial risk of loss and is not suitable for everyone. This article is educational content only and is not financial advice or a recommendation to trade. Past performance is not indicative of future results. Some links are affiliate links.

Free · Subscribers hear it first · Unsubscribe anytime

Hear about every sale and market shift first.

Flash sales and prop-firm promo codes before they go public, a heads-up before the big market days (CPI, FOMC, earnings weeks), and the weekly results recap from the desk that actually trades this. Free, straight to your inbox.