Documentation/AlgoCode/Function reference

sell

Open a short, or close a long when the script is long only.

Reference/Language/Language

sell

Inside a when body. Draws a Sell (or Exit, when long only) arrow and the fill price automatically. long only turns sell into an exit. Two-way scripts flip: sell while long closes long and opens short. A second sell while already short is ignored until a buy. short only uses sell as the entry.

Return value

signal -1

Example

short only
when ema(9) crosses below ema(21)
  sell

See also