strategy.order
A plain order: buys or sells qty contracts with no reversal and no pyramiding limit. With limit or stop it waits at that price; the same id replaces a waiting order. oca_name and oca_type as in strategy.entry.
strategy.order(id: string, direction: string, qty: float = na, limit: float = na, stop: float = na, comment: string = na, oca_name: string = na, oca_type: string = na)
Parameters
idstring: the order name; trades and the chart show itdirectionstring: strategy.long or strategy.shortqtyfloat: Contracts to buy or sell (default: the size set in strategy()).limitfloat: A limit price: the order waits at it (default na, a market order).stopfloat: A stop price: the order waits at it; with limit too it is a stop-limit order (default na).commentstring: Text kept with the order; the trade it closes keeps the closing order's comment (default none).oca_namestring: one-cancels-all group: the first order of the group to fill cancels the othersoca_typestring: strategy.oca.cancel (the default with oca_name) or strategy.oca.none
Example
if ta.crossunder(close, ta.sma(close, 20))
strategy.order("Sell 1", strategy.short, 1)