Introdução
Booleano
b = input(title="On/Off", type=input.bool, defval=true)
plot(b ? open : na)
Cor
c = input(title="Color", type=input.color, defval=color.red)
plot(close, color=c)
Inteiro
i = input(title="Offset", type=input.integer, defval=7, minval=-10, maxval=10)
plot(offset(close, i))
Real
f = input(title="Angle", type=input.float, defval=-0.5, minval=-3.14, maxval=3.14, step=0.2)
plot(sin(f) > 0 ? close : open)
Ativo e Resolução
sym = input(title="Symbol", type=input.symbol, defval="SPY")
res = input(title="Resolution", type=input.resolution, defval="60")
plot(close, color=color.red)
plot(security(sym, res, close), color=color.green)
Sessão
s = input(title="Session", type=input.session, defval="24x7")
plot(time(timeframe.period, s))
Fonte do Dado
src = input(title="Source", type=input.source, defval=close)
ma = sma(src, 9)
plot(ma)
Horário
date = input(title="Date", type=input.time, defval=timestamp("20 Feb 2020 00:00 +0300"))
plot(date)
Lista de Opções
choice = input(title="Choice", defval="A", options=["A", "B"])
plot(choice == "A" ? close : choice == "B" ? open : na)