tg-me.com/PineCodersSquawkBox/42
Last Update:
🌲 #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.BY PineCoders Squawk Box

Share with your friend now:
tg-me.com/PineCodersSquawkBox/42