
The TradingView Pine Script v6 release landed in November 20241, and it represents the most significant upgrade to TradingView's scripting language since Pine Script v4 introduced the modern syntax traders use today. Whether you write your own indicators, rely on community scripts, or automate strategies through platforms like TradersPost, this release changes what is possible inside the Pine Editor. In this guide, we cover what Pine Script v6 is, why TradingView built it, the features that matter most to traders and developers, and how to start using it.
Pine Script has been evolving steadily since TradingView first introduced it in 2013. Each major version addressed a specific set of limitations that the trading community had outgrown.
By late 2024, the Pine Script team had accumulated a long list of features that required foundational changes to the language. Booleans could still be na, which caused subtle bugs. Request functions were locked to global scope, limiting how scripts could pull multi-symbol data. There was no built-in way to log debug messages at runtime. And developers had been asking for enumerated types for years.
Rather than patch these issues into v5, TradingView chose to graduate to v6. The result is a release that cleans up long-standing inconsistencies while adding the features that modern trading script development demands. Starting with the v6 release, all future Pine Script updates apply exclusively to v6, meaning existing v5 scripts continue to work but will not receive new capabilities2.
If you use Pine Script indicators or strategies on your charts, these are the v6 features that will have the biggest impact on the tools available to you.
Before v6, every request.security() call had to know its symbol and timeframe at compile time. If you wanted data from five symbols, you needed five separate function calls written out in your code. There was no way to loop through a list of tickers or change the requested symbol based on a condition.
Pine Script v6 changes this completely. All request.*() functions now accept "series" arguments by default, which means the symbol, timeframe, and other parameters can change on every bar2. More importantly, these functions can now be called inside loops, conditional blocks, and even library functions3.
Here is what a dynamic request looks like in practice:
//@version=6
indicator("Multi-symbol RSI", overlay = false)
symbols = array.from("AAPL", "MSFT", "GOOGL")
for i = 0 to symbols.size() - 1
float rsi = request.security(symbols.get(i), timeframe.period, ta.rsi(close, 14))
plot(rsi, symbols.get(i))
Why it matters for traders: Indicator developers can now build multi-symbol dashboards, screener-style tools, and rotation strategies that were previously impossible or required clumsy workarounds. If you use community scripts that compare multiple assets, expect those tools to become significantly more powerful.
Enums, short for enumerations, let script authors define a fixed set of named options4. In v5, if a strategy offered three oscillator choices, the developer had to use string comparisons and hope the user typed the right value. In v6, enums create type-safe dropdown menus automatically.
//@version=6
indicator("Oscillator Selector")
enum OscType
rsi = "Relative Strength Index"
mfi = "Money Flow Index"
cci = "Commodity Channel Index"
OscType oscInput = input.enum(OscType.rsi, "Oscillator type")
calcOsc(float source, simple int length, OscType selection) =>
switch selection
OscType.rsi => ta.rsi(source, length)
OscType.mfi => ta.mfi(source, length)
OscType.cci => ta.cci(source, length)
plot(calcOsc(close, 14, oscInput))
Why it matters for traders: The settings panel for your indicators and strategies becomes cleaner and less error-prone. Dropdown menus replace free-text fields, and you can no longer accidentally type an invalid option. Script authors can also build more sophisticated configuration UIs without increasing complexity.
Debugging Pine Script has historically meant adding plot() or label.new() calls to display intermediate values on the chart. It worked, but it was clumsy and cluttered your visuals.
v6 introduces the log.info(), log.warning(), and log.error() functions3. These send formatted messages to a dedicated Pine Logs pane in the editor, separate from your chart. You can log from any scope, including inside loops, conditionals, and even within requested data contexts.
//@version=6
indicator("Logging Demo", overlay = true)
if barstate.isfirst
log.info("Script started on {0}", syminfo.tickerid)
if ta.crossover(ta.sma(close, 10), ta.sma(close, 50))
log.info("Golden cross detected at bar {0}, price {1}", bar_index, close)
Why it matters for traders: If you have ever tried to figure out why a strategy is not entering trades when you expect it to, runtime logging gives you a straightforward way to trace exactly what your script is doing on each bar without polluting your chart with debug plots.
Pine Script v6 includes polyline objects that let scripts draw complex shapes by connecting multiple chart.point coordinates with a single drawing object3. Polylines can be straight or curved, open or closed, and filled with color.
Why it matters for traders: Indicators can now render Zig Zag patterns, channel boundaries, custom chart patterns, and other complex visuals that previously required dozens of individual line objects. The result is cleaner code and more visually polished tools.
Two changes in v6 directly reduce the number of subtle bugs in Pine scripts:
na. In v5, a bool could be true, false, or na, which led to confusing three-state logic. In v6, booleans are strictly true or false2.if myFloat would treat any non-zero value as true and zero as false. In v6, you must write an explicit comparison like if myFloat != 02.Why it matters for traders: Scripts that compile in v6 are more predictable. Conditions behave exactly as written, and the category of bugs caused by ambiguous na-boolean states is eliminated entirely. If a script compiles, its logic is doing what the code says.
If you write Pine Script professionally or maintain libraries, v6 includes several features targeted at you.
Libraries can now export enums and user-defined types more effectively. Combined with dynamic requests, library authors can build reusable multi-symbol analysis functions that were impossible to distribute before. Libraries can also now contain request.*() calls within their functions when dynamic requests are enabled, which dramatically expands what shared code can accomplish.
Pine Script v5 limited the depth of nested scopes (if/else blocks, for loops, function calls) to a fixed number2. In v6, this restriction has been removed. Scripts can nest conditional structures, loops, and function calls as deeply as the logic requires without hitting artificial compiler limits1.
Why it matters: Complex strategies with multiple layers of conditions, filters, and position management logic no longer need to be artificially flattened. You can write code that reflects your actual trading logic without workarounds.
The input.enum() function and other input functions now support an active parameter1. When set to false, the input is grayed out in the settings panel, signaling to the user that it is not currently relevant. For example, a smoothing length input can be deactivated when the user disables smoothing.
//@version=6
indicator("Active Inputs Demo")
bool enableSmoothing = input.bool(true, "Enable smoothing")
int smoothLength = input.int(5, "Smooth length", active = enableSmoothing)
float rsi = ta.rsi(close, 14)
plot(enableSmoothing ? ta.ema(rsi, smoothLength) : rsi)
Why it matters: Professional-quality scripts can now present context-aware settings panels. Inputs that do not apply to the current configuration are visually disabled, reducing confusion and making scripts feel more polished.
The v6 migration is not just about new features. Several v5 behaviors have been changed or removed, and some of these changes can break existing scripts. Here is a summary of the most impactful changes:
na. The na(), nz(), and fixnan() functions no longer accept bool arguments2.int and float values no longer implicitly convert to bool. You must use explicit comparisons2.when parameter removed: All strategy.*() functions that accepted a when parameter no longer support it. Use if blocks instead2.const int values now returns a fractional result (e.g., 5/2 = 2.5) instead of performing integer division (5/2 = 2)2.and and or operators now use short-circuit evaluation, skipping the right-hand expression when the result is already determined2.request.*() functions execute dynamically in v6. Scripts that relied on non-dynamic behavior may need to set dynamic_requests = false in their declaration2.The Pine Editor includes an automatic converter that handles many of these changes4. Open your v5 script, and the editor will offer to convert it to v6. In most cases, the converter handles the transition cleanly. For scripts with complex boolean logic or heavy use of the when parameter, you may need to make manual adjustments after conversion.
For a detailed walkthrough of every breaking change and how to fix it, see our companion post on adapting to type system changes in Pine Script v6.
One of the advantages of the v6 release model is that TradingView now ships all new features exclusively to v6. Since the November 2024 launch, updates have arrived nearly every month. Here is a timeline of the most significant additions:
The strategy.exit() function received updated calculation behavior1. When a call includes both absolute and relative parameters for the same exit order (for example, both limit and profit), the function now evaluates both and uses the level that the market price is expected to activate first, rather than always ignoring the relative parameter3.
TradingView added bid and ask price variables for use on tick-based timeframes1. The bid and ask built-in variables provide real-time Level 1 quote data, available on the "1T" (one tick) timeframe3. This opened the door for scripts that analyze the bid-ask spread and order flow dynamics.
The scope depth limitation was also removed in this period, allowing unlimited nesting of conditional structures, loops, and function calls1.
New setter functions arrived for box drawings (box.set_xloc()), and the Renko, Point & Figure, and Kagi chart functions gained a percentage-based box sizing option (PercentageLTP)1.
The time_close variable was fixed to correctly return values on realtime bars of tick charts and price-based charts, resolving a long-standing issue where it returned na1.
Active inputs launched with the active parameter on input functions, allowing script authors to gray out irrelevant settings dynamically1. This was accompanied by broader improvements to how enum inputs display in the settings panel.
New plot line styles expanded the visual options for plot() and related functions, giving developers more ways to distinguish between multiple data series on a single chart1.
The biggest post-launch addition arrived with request.footprint(), a new function that retrieves volume footprint data for chart bars1. Along with two new data types, footprint and volume_row, this feature enables scripts to analyze buy and sell volume at each price level, identify the Point of Control (POC) and Value Area (VA), and calculate volume deltas3. This is available to Premium and Ultimate plan subscribers.
//@version=6
indicator("Footprint Demo", overlay = true)
int ticksInput = input.int(100, "Ticks per row", minval = 1)
int vaInput = input.int(70, "Value Area %", minval = 1)
footprint fp = request.footprint(ticksInput, vaInput)
if not na(fp)
float buyVol = fp.buy_volume()
float sellVol = fp.sell_volume()
float delta = fp.delta()
log.info("Bar {0}: Buy={1}, Sell={2}, Delta={3}", bar_index, buyVol, sellVol, delta)
This timeline shows that v6 is not a one-time release but a living platform that receives meaningful updates on a regular cadence. Traders and developers who stay on v6 benefit from each of these additions automatically.
Getting started with Pine Script v6 is straightforward regardless of whether you are writing new code or migrating existing scripts.
When you open the Pine Editor on TradingView and create a new script, it automatically starts with //@version=6 at the top4. All new scripts are v6 by default, and you get access to every feature described in this guide without any extra setup.
If you have v5 scripts that you want to upgrade, the Pine Editor includes a built-in converter. Open your script, and the editor will display a prompt offering to convert it to v6. The converter handles the majority of changes automatically, including:
when parameter in strategy functions with if blocksna handling for boolean variablesdynamic_requests parameter where neededAfter conversion, compile the script and check for any remaining errors. The editor highlights issues and provides error messages that point to the specific line and migration guide section that explains the fix.
if conditions that used to check numeric values as booleans. These are the most common source of post-conversion issues.log.info() to trace execution flow during testing. It is the fastest way to verify that your converted script behaves as expected.Pine Script v6 strategies generate alerts just like their v5 predecessors, which means they integrate seamlessly with TradersPost for automated trade execution5. When your v6 strategy fires a strategy.entry() or strategy.exit() on TradingView, TradersPost receives the alert webhook and routes the order to your connected broker.
Several v6 features make this automation pipeline more powerful:
TradersPost supports all the major brokers that traders pair with TradingView strategies, including TradeStation, Alpaca, Tradier, Robinhood, and Interactive Brokers for equities, as well as futures brokers like Tradovate and NinjaTrader5. Your v6 strategy sends the same alert payload format, so no changes to your TradersPost configuration are needed when you upgrade a script from v5 to v6.
If you are building a new v6 strategy specifically for automation, take advantage of the improved strategy.exit() behavior that correctly evaluates both absolute and relative exit levels. This gives TradersPost more precise signals for take-profit and stop-loss orders.
The TradingView Pine Script v6 release is more than a version bump. It is a foundational upgrade that fixes long-standing language limitations, adds features that developers have requested for years, and establishes a platform for continuous monthly improvements. Dynamic requests, enums, runtime logging, stricter types, and polyline drawing make v6 the most capable version of Pine Script ever released.
For traders, the practical impact is better indicators, more reliable strategies, and cleaner configuration panels on every script that adopts v6. For developers, it means fewer workarounds, more expressive code, and a growing set of tools like footprint data analysis that continue to arrive with each update.
New scripts already default to v6, and the built-in converter makes migrating existing v5 scripts straightforward. If you have been waiting for a reason to upgrade, the sixteen months of post-launch features since November 2024 have made that case decisively. Start building in v6 today, and pair your strategies with TradersPost to automate execution across your brokerage accounts.
1 Pine Script Release Notes
2 Pine Script v5 to v6 Migration Guide
3 Pine Script v6 Language Reference
4 Pine Script User Manual
5 TradersPost - Automated Trading Platform