Reviewed: 14 August 2026
The Pine Script changes from 2025 that still matter are the ones that affect how code runs, how inputs behave, and how scripts handle data. The biggest practical updates were dynamic for-loop boundaries, removal of the old scope-count ceiling, conditional inputs, longer strings, new plot line styles, and better time handling. They did not make every old script faster or safer automatically, but they removed several awkward workarounds.
This page is a verified archive of the 2025 changes. If you only need the current language version, read the current Pine Script version guide.
What changed in Pine Script during 2025?
| Release | Change | Why it matters |
|---|---|---|
| February | The total scope-count limit was removed | Large scripts with many functions, loops and conditional blocks no longer have to be restructured just to stay below the former limit. |
| February | bid and ask became available | Scripts can inspect the best realtime bid and ask, but only on the 1T timeframe. On other timeframes these values are na. |
| March | for-loop end boundaries became dynamic | The loop can re-evaluate its stopping value before each iteration. Code that changes the boundary inside a loop may now run a different number of iterations. |
| May | time_close improved on tick and price-based charts | Closed bars provide more useful closing timestamps. The open realtime bar can still return na when its closing time cannot yet be known. |
| June | Libraries could export constants | Shared libraries can expose fixed int, float, bool, color and string values without wrapping them in functions. |
| July | Inputs gained an active parameter | Related settings can be disabled until the user turns on the feature that needs them. |
| August | Maximum string length increased | Strings can contain up to 40,960 encoded characters, useful for larger messages and structured payloads. |
| September | Plots gained solid, dashed and dotted line styles | Scripts can distinguish lines without depending on color alone. |
| October | time() and time_close() gained timeframe_bars_back | You can offset calculations in the requested timeframe instead of only in the chart timeframe. |
| December | Line wrapping inside parentheses became more flexible | Wrapped function calls and expressions can use normal indentation without triggering the old continuation-line error. |
The three updates most likely to change existing code
1. Dynamic loop boundaries
Before the March 2025 change, a for loop calculated its end boundary once, before the first iteration. It now evaluates that boundary before every iteration. This is useful when the loop intentionally changes a collection or counter, but it can also surprise you.
Review any loop where the expression after to depends on a variable that changes inside the loop. A boundary that keeps growing can make the loop do far more work than expected. A boundary that shrinks can stop it early. Where you need the old fixed behavior, save the boundary to a separate value before entering the loop.
2. Conditional inputs
The active parameter lets the settings panel reflect how the script actually works. In this example, the smoothing length is editable only when smoothing is enabled:
//@version=6
indicator("Conditional input example")
bool useSmoothing = input.bool(true, "Use smoothing")
int smoothLength = input.int(10, "Smoothing length", minval = 1, active = useSmoothing)
float value = useSmoothing ? ta.sma(close, smoothLength) : close
plot(value, "Value", linestyle = plot.linestyle_dashed)
The disabled setting is a usability improvement, not a runtime safeguard. Your code still needs valid defaults and sensible minimum values.
3. Time values on non-time-based charts
Renko, range, Kagi, point-and-figure and tick charts do not always know when the open realtime bar will close. The improved time_close behavior helps on completed bars, but the current open bar may still return na. Always handle that possibility before formatting or comparing the timestamp.
What did not change
These language improvements did not remove the normal risks of realtime scripts:
- A signal can still change before the candle closes.
- Higher-timeframe requests can still leak unconfirmed values if they are written incorrectly.
- Backtest fills are still simulations, not proof of live execution.
- Non-standard charts still use synthetic prices that may not match tradable market prices.
- More flexible code does not remove platform resource limits or the need to profile slow scripts.
For confirmed higher-timeframe values and realtime limitations, use the examples in the Pine Script repainting guide.
A practical upgrade checklist
- Keep the script on
//@version=6before using 2025 additions. - Compare the script against TradingView’s release notes instead of relying on a copied feature list.
- Review loops whose end condition changes during execution.
- Guard
bid,askand realtimetime_closevalues againstna. - Use
activeto simplify settings, but keep input validation. - Test on the exact symbol, timeframe and chart type used in production.
- Recreate alerts after changing script logic; existing TradingView alerts run a saved snapshot.
- Use Replay and live paper testing before connecting any alert to order execution.
Which 2025 features are worth adopting first?
For most scripts, start with conditional inputs and the new line styles because they improve usability without changing the trading logic. Review dynamic loop boundaries next because they can change behavior. Adopt bid/ask data only when you genuinely need tick-level information and understand that it is limited to the 1T timeframe.
If you maintain a large v5 script, migrate the language version separately from feature changes. That makes it easier to identify whether a difference came from the v6 migration or from a new 2025 behavior.
Primary sources
- TradingView Pine Script release notes
- TradingView v6 migration guide
- Pine Script v6 reference manual
Need a second set of eyes? Send the smallest script that reproduces the problem, the chart timeframe and the expected result. A focused review is more useful than a promise that an untested strategy will perform.


Leave a Reply