FUNCTIONS / SCRIPT

study

Study properties / general script settings.

  • title〈string〉— Layer title
  • overlay〈boolean〉— (optional) (default=false) Overlay it on the last existing pane (true) or new pane (false)
Examples:
study("My Script")
study("my script title", overlay=true)

input

User-defined options.

  • title〈string〉— Input label
  • value〈any〉— Default value
  • min〈float〉— (optional) Minimum value
  • max〈float〉— (optional) Maximum value
  • step〈float〉— (optional) Step value
  • options〈array〉— (optional) an array of possible options (e.g. ['a','b'])
Examples:
//@version=1
const myValue = input("My Label", 123)
const myBoolean = input("True/False option", false)
const myColor = input("My Color", color.green)
const mySlider = input("A Slider", 1, minval=0, maxval=100, step=5)
const myOption = input("My Option", 'b', options=['a','b','c'])

header

Just like input(), adds a title and descriptions inside user-defined options

  • title〈string〉— Title
  • overlay〈string〉— (optional) Description
Examples:
header("section")
header("cool settings", "optional description")