Documentation/AlgoCode/Function reference

input

A number the trader can change in the script inputs UI.

Reference/Language/Language

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).

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

See also