May 22, 2020

Tuple Support for the Security Function in Pine Script

We’re excited to announce some new changes made to the security function in Pine script. Now you can specify not only series data, but also tuple data for the expression parameter.

Tuple is an unchangeable sequence of values. You can find out more about tuple data here.

Below is an example of tuple data:


study("My Script")

f() => [open, high]

[o, h] = security(syminfo.tickerid, "D", f())

[l, c] = security(syminfo.tickerid, "D", [low, close])

plot((o + h + l + c) / 4)

Please check out this graphic for a visual representation of the above data:

Look first / Then leap

Launch Chart