pub struct OrderExtras {
pub time_in_force: Option<String>,
pub expiry_date: Option<String>,
pub stop_price: Option<Decimal>,
pub take_price: Option<Decimal>,
pub visible: Option<i64>,
pub execution_take_profit_type: Option<i32>,
pub execution_stop_loss_type: Option<i32>,
pub spread: Option<Decimal>,
pub spread_type: Option<i32>,
pub offset: Option<Decimal>,
pub offset_type: Option<i32>,
}Expand description
Optional order parameters of the current docs (POST /api/v1/orders, /orders/edit, and their
/sync twins): time in force, stop-loss and take-profit, iceberg, trailing spread and offset.
Everything is optional and omitted when None. What a combination means for the broker is in the
docs. The connector fills them for its stop orders (conditional orders).
§Examples
use brokapi_bcs_protocol::http::models::OrderExtras;
// Good Till Date: valid until the given day.
let extras = OrderExtras {
time_in_force: Some("3".into()),
expiry_date: Some("20261120".into()),
..Default::default()
};
let json = serde_json::to_value(&extras)?;
assert_eq!(json["timeInForce"], "3");
assert!(json.get("stopPrice").is_none()); // unset fields are not sentFields§
§time_in_force: Option<String>1 Day (default), 2 Fill Or Kill, 3 Good Till Date (algorithmic orders only).
expiry_date: Option<String>YYYYMMDD, required with time_in_force = "3", at most 30 days ahead.
stop_price: Option<Decimal>Stop price of a conditional order. Required for scenarios with a stop-loss.
take_price: Option<Decimal>Take-profit price of a conditional order. Required for scenarios with a take-profit.
visible: Option<i64>Shown quantity of an iceberg order, below order_quantity.
execution_take_profit_type: Option<i32>1 market, 2 limit.
execution_stop_loss_type: Option<i32>1 market, 2 limit.
spread: Option<Decimal>Protective spread of a conditional order.
spread_type: Option<i32>0 price currency, 1 percent.
offset: Option<Decimal>Offset of a conditional order.
offset_type: Option<i32>0 price currency, 1 percent.
Trait Implementations§
Source§impl Clone for OrderExtras
impl Clone for OrderExtras
Source§fn clone(&self) -> OrderExtras
fn clone(&self) -> OrderExtras
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for OrderExtras
impl Debug for OrderExtras
Source§impl Default for OrderExtras
impl Default for OrderExtras
Source§fn default() -> OrderExtras
fn default() -> OrderExtras
Source§impl PartialEq for OrderExtras
impl PartialEq for OrderExtras
Source§fn eq(&self, other: &OrderExtras) -> bool
fn eq(&self, other: &OrderExtras) -> bool
self and other values to be equal, and is used by ==.