PineCoders Squawk Box
Открыть в Telegram
News & Tips on TradingView's Pine programming language
Больше3 493
Подписчики
Нет данных24 часа
+157 дней
+4730 день
Архив постов
🔈 #news
The recent problem where existing scripts are throwing the:
Pine cannot determine the referencing length of a series. Try using max_bars_back in the study or strategy function.
error can usually be fixed by using
max_bars_back=300 in your study() or strategy() declaration statement.🔈 #news
The Pine news/updates/tips we periodically post here are also posted in the Pine Script room on TradingView.
📈 #newfeature
Plots disabled in Settings/Style no longer appear in the Data Window
Continuing to show plots in the Data Window when users disabled them from the Settings/Style db confused users, so unchecking them in the Settings/Style db now also hides them in the Data Window. See in these screenshots how
Plot 4 plot does not appear in the Data Window, nor in the Indicator's Values.
NOTE: This recent change has also introduced behavior which will cause user-selected transparency levels from the Settings/Style db to be reflected in the value rendered in the Data Window, whereas before, the value was always rendered with transparency zero. The transparency of Plot 1 was changed to 50% in the Settings/Style db here. We will try to have this side effect corrected.🐞⚔️ #bugfix
Plotting
na when using histogram, area or columns mode no longer puts zero in play in the indicator's scale
Prior to this fix, using either of:
style = plot.style_histogram style = plot.style_area style = plot.style_columnswith
plot() would always put the zero value in the indicator's scale, even when plotting na. This is no longer the case.🌲 #newfeature
Changes to
security()'s resolution= parameter.
The security() function was recently updated to accommodate an empty string or na as an argument to its resolution= parameter. In both cases, the chart's resolution (timeframe.period) will be used.
This will be handy in conjunction with the new "Same as Symbol" choice which is now part of the recent resolution widget's dropdown, which appears in the script's Inputs when you use:
r = input("D", type = input.resolution)
When users select "Same as Symbol" in the dropdown, the widget returns an empty string. As we had documented here, coders previously had to use special logic to process an empty string, as security() would throw an error if an empty string was used for the resolution. Now, we can forego the special logic and simply write:
r = input("D", type = input.resolution)
c = security(syminfo.tickerid, r, close)
Note that the default value we supply in the input() call must be one of the dropdown's choices (or an empty string for "Same as Symbol), otherwise "Same as Symbol" will be used in its place.🐞⚔️ #bugfix
display = display.none
A change was made to its behavior, to bring it in line with the original specs for the feature, which specified no display of the plot or its values anywhere, as it was meant to be used for plots intended for external signals and placeholders in alert messages.
Phase 1 of the new display= parameter for plot functions is now complete. Phase 2 has no ETA yet, but will include other arguments for the display= parameter:
display.chart display.data_window display.price_scale display.indicator_valueWhen Phase 2 is deployed, you will be able to combine these to control exactly where a plot's values are to appear.
🔈 #news
PineCoders Coding Conventions
We updated the Variable Names section of our Coding Conventions with a few additions. We also link, at the end, to a few scripts showing the Conventions in use.
🌲 #newfeature
security() can now return tuples.
//@version=4
study("", "", true)
f_hiLo() => [high, low]
[hi, lo] = security(syminfo.tickerid, "D", f_hiLo())
plot(hi, color=#FF0000ff)
plot(lo, color=#00FF00ff)🐞⚔️ #bugfix
Alerts configured on code using `barstate.isconfirmed` now work as expected.
Alerts based on this code would never fire before. They now do.
//@version=4
study("")
alertcondition(barstate.isconfirmed, "Alert")🔈 #news
"Maximum order quantity exceeded 3000" error
The error is caused by a problem introduced in a recent update. ETA on the fix is one week.
🌲 #newfeature
BTC is now a currency!
You can now use BTC as a currency in strategy parameters.
🐞⚔️ #bugfix
fill()
There was a bug with the fill() function where if you plotted a single value surrounded by na values, it could not be filled. The fill shown here would not appear before. Now it does.
https://www.tradingview.com/x/wxstnMDz/
💪 #tip
Keep in mind that to prevent fills between plots you have 2 options:
1. Plot na on one of the 2 plots or both.
2. Set the fill's color to na conditionally.💪 #tip
How to format values to tick precision with `tostring()`
We have a very useful new
f_tickFormat() function that does this in our FAQ. Kudos to DayTradingOil for the original idea.💪 #tip
Books
We have a short list of books on trading systems and techniques here:
https://www.pinecoders.com/books/
🔈 #news
For the quants out there, a new script publication by alexgrover to evaluate filters.
https://www.tradingview.com/script/oTEP9DJF-Filter-Information-Box-PineCoders-FAQ/
🔈 #news
Rounding code in the FAQ
We have added a few FAQ entries with rounding code starting here.
🔈 #news
New functions and a few other improvements have been made to our Color Gradient (16 colors) Framework - PineCoders FAQ script. They allow for more precise control over gradients, when it is needed. See:
f_gradientAdvPro(_source, _center, _gran, _start, _end, _c_bull, _c_bear) f_gradientRelativePro(_source, _min, _max, _start, _end, _c_bull, _c_bear) f_color(_c, _g)
🔈 #news
PineCoders has added two new functions to our How to avoid repainting when using security() - PineCoders FAQ script.
They make it safer to user
security() to avoid repainting:
f_secureSecurity(_symbol, _res, _src) f_security(_symbol, _res, _src, _repaint)
