Telegram Web Link
๐ŸŒฒ #newfeature
A new hlcc4 built-in variable was added. It averages the high and low values with the double-weighted close.
๐ŸŒฒ #newfeature
The new last_bar_index and last_bar_time built-in variables return the index and time of the chart's last bar. This allows you to know in advance the number of bars in the dataset, and where it ends.
๐Ÿžโš”๏ธ #bugfix
On some symbols such as BINANCE:BNBUSDT it was not possible to issue strategy orders on fractional sizes. The problem was fixed.
๐ŸŒฒ #newfeature
Our selection team for Editors' Picks now includes the best Pine libraries in its picks. Picked libraries are hidden from the default EPs page because they tend to confuse script users who are not Pine programmers. To see the selected libraries, use the new "Libraries" item in the dropdown menu.
๐ŸŒฒ #newfeature
A new line.copy() function now allows line IDs to be copied. Note that the line is not copied; only its reference ID:
https://www.tradingview.com/pine-script-reference/v5/#fun_line{dot}copy
๐Ÿ”ˆ #news
Many categories were added to better identify the scripts you publish through the "Publish Script" window.
๐ŸŒฒ #newfeature
The ta.valuewhen() function can now return the state of "bool" and "color" variables when its condition argument is true. For example, you can now use:

ta.valuewhen(condition, boolVariable, 0)

to find the value of boolVariable the last time condition was true.
๐ŸŒฒ #newfeature
A new timeframe.in_seconds(timeframe) function provides a unified way to more easily compare timeframes. This will be useful in error-checking code, to disable indicators using request.security() when their timeframe would be lower than the chart's, or when deriving secondary timeframes from the chart's TF.

You can use it without an argument to get the chart's TF in seconds: timeframe.in_seconds():
https://www.tradingview.com/pine-script-reference/v5/#fun_timeframe{dot}in_seconds
๐ŸŒฒ #newfeature
A new `input.text_area()` function now provides a large input field for long text.
๐Ÿ”ˆ #news
We have updated the text in the Community Scripts page's "About" box. Many Pine coders use Pine to develop their own indicators/strategies. That's great, and why TV develops Pine. A few of those authors also publish their work for the benefit of all TradingViewers. We never miss a chance to thank them because they bring tremendous value to traders all around the world.

We think it's safe to say that TradingView has become the hotbed of new developments in indicators concepts. We owe this to the creativity and generosity of our authors. Warm thanks go to all of you who publish useful scripts. ๐Ÿ’™
๐ŸŒฒ #newfeature
New array functions
We have added 8 new array functions that allow you to sort, search and do other useful stuff with arrays:
https://www.tradingview.com/pine-script-docs/en/v5/Release_notes.html#march-2022
๐ŸŒฒ #newfeature
A new index keyword can now be used in for...in structures to refer to the index of the current iteration:
https://www.tradingview.com/pine-script-reference/v5/#op_for{dot}{dot}{dot}in
๐ŸŒฒ #newfeature
You can now use placeholders of the form {{strategy.*}} in the string used with the alert_message parameter of strategy.*() functions. This makes realtime information available in alert messages generated from scripts, just as can be done when using the placeholders from the "Create Alert" dialog box's "Message" field:

//@version=5
strategy("My strategy", overlay=true, margin_long=100, margin_short=100)

alertString = '{{strategy.order.action}} {{strategy.position_size}} {{ticker}} \nMarket position was {{strategy.prev_market_position}} and is now {{strategy.market_position}}'

longCondition = ta.crossover(ta.sma(close, 14), ta.sma(close, 28))
if (longCondition)
strategy.entry("My Long Entry Id", strategy.long, alert_message = alertString)

shortCondition = ta.crossunder(ta.sma(close, 14), ta.sma(close, 28))
if (shortCondition)
strategy.entry("My Short Entry Id", strategy.short, alert_message = alertString)
๐ŸŒฒ #newfeature
Improvements to request.security() were rolled out. Its expression parameter now supports arguments of "string" type, and "int[]/float[]/bool[]/color[]/string[]" arrays, including in tuples:

//@version=5
indicator("")

bool barUp = close > open
color barColor = barUp ? color.green : color.red
string barDesc = barUp ? "Bar is UP" : "Bar is DOWN"
bool[] arrayBool = array.from(barUp, barUp[1])
color[] arrayColor = array.from(barColor, barColor[1])
string[] arrayString = array.from(barDesc, barDesc[1])
float[] arrayFloat = array.from(close, open)
sBool = request.security(syminfo.tickerid, "1M", close > open)
sColor = request.security(syminfo.tickerid, "1M", barColor)
sString = request.security(syminfo.tickerid, "1M", timeframe.period)
sArrayBool = request.security(syminfo.tickerid, "1M", arrayBool)
sArrayColor = request.security(syminfo.tickerid, "1M", arrayColor)
sArrayString = request.security(syminfo.tickerid, "1M", arrayString)
sArrayFloat = request.security(syminfo.tickerid, "1M", arrayFloat)
[tArrayBool, tArrayColor, tArrayFloat] = request.security(syminfo.tickerid, "1M", [arrayBool, arrayColor, arrayFloat])

if barstate.islast
label.new(bar_index, 0,
sString + "\n" +
str.tostring(sBool) + "\n" +
str.tostring(sArrayBool) + "\n" +
str.tostring(sArrayString) + "\n" +
str.tostring(sArrayFloat) + "\n",
color = array.get(tArrayColor, 0))
๐Ÿ”ˆ #news
You are welcome to join our new Q&A forum for Pine Scriptโ„ข coders on Telegram: https://www.tg-me.com/PineCodersQA

Note that the TradingView channel and this PineCoders Squawk Box are the only two other official TradingView outlets on Telegram.

Our new Telegram Q&A forum complements the two other Q&A forums where we already answer questions:
โ€ข The Stack Overflow [pine-script] tag
โ€ข The "Pine Scriptโ„ข Q&A" public chat on TV
PineCoders Squawk Box
๐ŸŒฒ #newfeature Improvements to request.security() were rolled out. Its expression parameter now supports arguments of "string" type, and "int[]/float[]/bool[]/color[]/string[]" arrays, including in tuples: //@version=5 indicator("") bool barUp =โ€ฆ
๐ŸŒฒ #newfeature
The branches of if structures no longer need to return the same type when the if structure is not used to assign a value to a variable. This allows you to use if structures more liberally. Code like this will now compile:

//@version=5
indicator("", "", true)
var line e = na
if close > open
// This branch returns "void".
line.delete(e)
else
// This branch returns the "line" type.
e := line.new(bar_index - 10, high[10], bar_index, high)
2025/07/01 07:06:46
Back to Top
HTML Embed Code: