March 5, 2015

New input for selecting data source in Pine Script!

We are constantly improving the Pine Script Language and are happy to announce that it’s now possible to choose the data source in the inputs

pine1

You can choose any of the following as the default source:

  • open;

  • high;

  • low;

  • close;

  • hl2;

  • hlc3;

  • ohlc4.

Example 1. Simple

study("My Script")
src = input(close)
plot(src)

 

Example 2. Extended

study("My Script")
src = input(title="Source", type=source, defval=close)
plot(src)

Read more about the Pine Script Language in the Pine Script Tutorial and in the Pine Script Reference.