PineCoders Squawk Box
3.84K subscribers
60 photos
166 links
News & Tips on TradingView's Pine programming language
Download Telegram
🌲 #newfeature
You can now initialize arrays with a list of values using the new array.from():

//@version=4
study("")
int[] v = array.from(1, 2, 12)
plot(array.avg(v))


https://www.tradingview.com/pine-script-reference/v4/#fun_array{dot}from
🌲 #newfeature
You can now use tables to place content like display panels that won't move on charts!
https://www.tradingview.com/blog/en/introducing-pine-tables-24604/
❀1
🌲 #newfeature
When updating a published script, you can now choose to keep your previously published chart as is, only updating the script’s code.
πŸ‘1
🌲 #newfeature
color.new() now accepts arguments of "series" form for its color and transp parameters:
https://www.tradingview.com/pine-script-reference/v4/#fun_color{dot}new
πŸ‘1
🌲 #newfeature
Script authors can now filter their user profile's SCRIPTS page on the access type of their scripts.
πŸ‘1
🌲 #newfeature
The "Publish Script" window was redesigned to make our options clearer.
πŸ‘1
🌲 #newfeature
tostring() now accepts three new formatting arguments:
format.mintick to format to tick precision.
format.volume to abbreviate large values.
format.percent to format percentages.
https://www.tradingview.com/pine-script-reference/v4/#fun_tostring
❀1
🌲 #newfeature
The new round_to_mintick() function makes it possible to round numeric values to tick precision.
https://www.tradingview.com/pine-script-reference/v4/#fun_round_to_mintick
❀1
🌲 #newfeature
Script authors can now filter their user profile's SCRIPTS page on private/public publications.
πŸ‘2
🌲 #newfeature
You can now use nz() to protect against division by zero. This will return zero when close == open: nz(1 / (close - open))
❀3πŸ‘1
🌲 #newfeature
A new barstate.islastconfirmedhistory built-in allows you to detect the last bar in history. This can be useful to restrict calculations to the point just before the script begins execution on an open market.
https://www.tradingview.com/pine-script-reference/v4/#var_barstate{dot}islastconfirmedhistory
❀1
🌲 #newfeature
When drawing lines, labels or boxes and using xloc.bar_index to position them, you can now use offsets of up to 500 bars into the future, e.g.: label.new(bar_index + 10, high, "Text")
❀1
🌲 #newfeature
Values changed in the "Settings/Inputs" and "Settings/Properties" tabs are now preserved as you save new versions of a script already loaded on a chart.
❀1
🌲 #newfeature
You can now use explicit_plot_zorder = true with study()/strategy() so that the order of plot, fills and hlines in your code determines their z-order, i.e., which ones appear on top of others. Other drawings are not affected.
❀1
🌲 #newfeature
Horizontal lines and boxes starting on early bars in history are now displayed on the chart, even if their starting point is not visible on the chart's bars:

//@version=4
study("", "", true)
var firstBarTime = time
if barstate.islastconfirmedhistory
line.new(firstBarTime, close, time, close, xloc=xloc.bar_time)
🌲 #newfeature
Strategy results now show the Sortino ratio.
πŸ‘1
πŸ”ˆ #news
If you are wondering why the Pine team has been quiet lately, it's because they and other TV teams are hard at work on Pine v5, which is coming soon. Fasten your seatbelts!
Channel photo updated
πŸ”ˆ #news
A PineCoders team will publish indicators in Pine in the monthly Traders' Tips section of the Technical Analysis of Stocks & Commodities (TASC) magazine.
The indicators will be published from the PineCodersTASC account on TV.
See the current month's publications here:
https://www.tradingview.com/u/PineCodersTASC/#published-scripts