input
A number the trader can change in the script inputs UI.
name = input 9 as "Fast EMA"
Default value is the number after input. The quoted title is what the UI shows. Put every length, factor, or threshold the trader will change on an input line, then use the variable: ema(close, fastLen). The old word ask means the same thing and still runs; new scripts should use input (ask is easy to confuse with bid/ask price). Add options to show a dropdown instead of a number box: each choice is a number with an optional quoted label, e.g. input 5 as "Exit TF" options 1 "1m", 5 "5m", 15 "15m". The variable gets the chosen number.
Return value
number
Also accepted: ask.
Example
fastLen = input 9 as "Fast EMA" slowLen = input 21 as "Slow EMA" fast = ema(close, fastLen) slow = ema(close, slowLen) when fast crosses above slow buy