PineCoders Squawk Box
3.84K subscribers
60 photos
166 links
News & Tips on TradingView's Pine programming language
Download Telegram
🌲 #newfeature
Tooltips in the "Settings/Properties" tab of strategies now provide details on the values.
👍1
🔈 #news
With the advent of Pine Libraries, we renamed the "Public Library" to "Community Scripts" to avoid confusion.
👍1
🌲 #newfeature
The type-matching requirement for the return value of if and switch local blocks has been removed when the structure's return value is not assigned to a variable. This will now work in v5:

 //@version=5
indicator("", "", true)
var line myLine = na
if close > open
line.delete(myLine)
else
myLine := line.new(bar_index - 10, high[10], bar_index, high)
👍3
🌲 #newfeature
A new for ... in structure now allows you to loop across the elements of an array. See the Reference Manual for more information.
1
🔈 #news
The time limit for the execution of any single loop has been extended from 200 to 500ms. More processing power to you, Pine coders!
2
🌲 #newfeature
A new hlcc4 built-in variable was added. It averages the high and low values with the double-weighted close.
👍1
🌲 #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.
1
🐞⚔️ #bugfix
On some symbols such as BINANCE:BNBUSDT it was not possible to issue strategy orders on fractional sizes. The problem was fixed.
👍21
🌲 #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.
2👍1
🌲 #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
👍1
🔈 #news
Many categories were added to better identify the scripts you publish through the "Publish Script" window.
👍4
🌲 #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.
👍7
🌲 #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
👍4🔥1
🌲 #newfeature
A new `input.text_area()` function now provides a large input field for long text.
11👍10
🔈 #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. 💙
👍1110
🌲 #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
👍22🔥31
🌲 #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
👍13🔥112