pub struct Order {
pub id: String,
pub direction: Direction,
pub qty: Option<f64>,
pub qty_percent: Option<f64>,
pub sizing_price: Option<f64>,
pub kind: OrderKind,
pub reduce_only: bool,
pub reverses: bool,
pub close_target: Option<String>,
pub oca_name: Option<String>,
pub oca_type: OcaType,
pub comment: String,
}Expand description
A submitted order, before it fills. Replaces any pending order with the same
id, as Pine’s order commands do.
Fields§
§id: String§direction: Direction§qty: Option<f64>Contracts to trade; None means the strategy’s default quantity, which
the broker supplies.
qty_percent: Option<f64>For a reducing order, the percentage of the position to close when qty
is absent (strategy.close’s qty_percent).
sizing_price: Option<f64>The price used to size a cash/percent_of_equity order without an
explicit qty — Pine sizes from the close of the bar the order is
generated on, not the later fill price. None falls back to the fill.
kind: OrderKind§reduce_only: boolTrue for strategy.close/close_all: only ever shrinks the position.
reverses: boolstrategy.entry reverses an opposite position and obeys pyramiding;
strategy.order does neither.
close_target: Option<String>For a reducing order, the entry id whose lots it closes; None closes
the whole position (strategy.close_all).
oca_name: Option<String>The One-Cancels-All group this order belongs to, if any.
oca_type: OcaType§comment: String