Documentation/AlgoCode/Function reference

buy

Open or add a long (or cover a short if the script is short only).

Reference/Language/Language

buy

Inside a when body. Dovee draws a Buy arrow and the bar close (Buy @ 24150.00) — you do not need arrow, label, or paint. With long only, buy is the only entry. By default (one trade at a time), a second buy is ignored while already long — no extra Buy arrow until a sell or exit. Write re-entry to allow adds. Live size still comes from Deploy, not from this word.

Return value

signal +1

Example

when close crosses above ema(21)
  buy

See also