PineCoders Squawk Box
3.84K subscribers
60 photos
166 links
News & Tips on TradingView's Pine programming language
Download Telegram
πŸ”ˆ #news
Pine v5 is here!
It brings Pine libraries, switch structures, while loops and much more! You can learn more about new v5 features in the Release Notes of our User Manual. Our Migration Guide will help you with the transition. Enjoy!
πŸ”ˆ #news
Script authors who publish their scripts and get user questions on repainting can now link them to our new User Manual page on Repainting. It goes into more detail than the previous one, and contains a section dedicated to script users.
🌲 #newfeature
array.sort() now sorts string[] arrays.
🌲 #newfeature
Interactive inputs for price and time
Have a look at how this script uses a new interactive mode where script users can select time inputs from the chart. We explain in the publication's description how it works. Try it out and experiment with your own code. If you have suggestions for improvement, please leave us comments on the publication's page.
https://www.tradingview.com/script/SkmMrMe0-CAGR-Custom-Range/
🌲 #newfeature
You can now use ALT+SHIFT+πŸ „ and ALT+SHIFT+πŸ † to move to the first or last bar in history.
πŸ‘1
🌲 #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.
πŸ‘2❀1
🌲 #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