PineCoders Squawk Box
3.84K subscribers
60 photos
166 links
News & Tips on TradingView's Pine programming language
Download Telegram
🌲 #newfeature
A new syminfo.volumetype variable was added, which can help distinguish between base, quote and tick volumes on feeds for which the data vendor makes that information available. See it in use in the most recent "24-hour Volume" built-in indicator:
https://www.tradingview.com/blog/en/new-built-in-indicator-24-hour-volume-31718/
🔥6👍3
🌲 #newfeature
Six new parameters for `strategy.exit()` now allow you to generate different comments and alert messages depending on whether the order was triggered by a take profit, a stop loss or a trailing stop.
🔥10👍8👏1😁1
🌲 #newfeature
A new chart.bg_color variable returns the color of the chart's background. Another one, chart.fg_color, returns a color producing optimal contrast with that background.
👏102👍1🔥1
🌲 #newfeature
To complement the recently introduced chart.is_* variables, a new `chart.is_standard` variable detects when a standard chart type is used. Standard chart types are ones where the close is not synthetic, so bars, candles, hollow candles, line, area or baseline.
5🔥3👏1💩1
🌲 #newfeature
A new `currency.USDT` constant was added for Tether.
👍5🥰21💩1
🌲 #newfeature
`ta.change()` can now be called with a "bool" variable to detect state changes. You can now write:

//@version=5
indicator("", "", true)
bool upBar = close > open
bool directionChange = ta.change(upBar)
plotchar(directionChange, "directionChange", "•", location.top, size = size.tiny)
🔥22👍63💩1
🌲 #newfeature
The historical states of arrays and matrices can now be referenced with the `[]` operator. In the example below, we reference the historic state of a matrix 10 bars ago:

//@version=5
indicator("")
m = matrix.new<float>(1, 1, close)
float x = na
if bar_index > 10
x := matrix.get(m[10], 0, 0)
plot(x)
🔥23👍8💩21
🌲 #newfeature
10 second charts are now available. timeframe.period will return "10S" on them, as expected.
👍106🔥5💩1
💪 #tip
You can access the Pine Script Editor from anywhere, including on phones, by using this link:
https://www.tradingview.com/pine/
🔥2814👍12👏4😁1💩1🏆1
🌲 #newfeature
You can now use timeframe.change("D") instead of ta.change(time("D")):
https://www.tradingview.com/pine-script-reference/v5/#fun_timeframe{dot}change
👍10🔥4💩1
🌲 #newfeature
ta.vwap() now allows you to specify an anchor timeframe, and it can return stdev bands:
https://www.tradingview.com/pine-script-reference/v5/#fun_ta{dot}vwap
15👍2💩1
🌲 #newfeature
A new ta.pivot_point_levels() function calculates pivot levels using different types of calcs that reset on a condition you specify:
https://www.tradingview.com/pine-script-reference/v5/#fun_ta{dot}pivot_point_levels
15🔥6👏1💩1
🛠 #fix
The behavior of qty_percent in strategy.exit() has changed. Instead of applying to whatever remains of the position, it now always applies to the initial position size.
See details in the Release notes.
👍11👎7🔥2
🔈 #news
The "Export chart data..." item was moved to the Layout menu.
👍14👏2
🔈 #news
A new "Limitations" page in the User Manual documents the most frequent limits you are susceptible to encounter when writing complex Pine scripts:
https://www.tradingview.com/pine-script-docs/en/v5/writing/Limitations.html
👍19🤔32🔥2
🌲 #newfeature
ta.min() and ta.max() are two new functions that return the low and high values of a series up to the point in the series where they are called.
https://www.tradingview.com/pine-script-reference/v5/#fun_ta{dot}min
https://www.tradingview.com/pine-script-reference/v5/#fun_ta{dot}max
🔥9👍4👏2
🌲 #newfeature
The display parameter of plot*() calls now supports more arguments, namely: display_data_window, display.pane, display_price_scale and display.status_line
https://www.tradingview.com/pine-script-docs/en/v5/Release_notes.html#july-2022
🔥22👍5
🔥6
🌲 #newfeature
A developing parameter was added to ta.pivot_point_levels(). When true the pivot values continue to recalculate between anchor points:
https://www.tradingview.com/pine-script-reference/v5/#fun_ta{dot}pivot_point_levels
🔥6❤‍🔥2
🌲 #newfeature
A new //@strategy_alert_message compiler annotation was added for strategies. The text following it will be used as the default alert message when users create alerts from the strategy.
🔥15👍3