pub struct OrderAmendment { /* private fields */ }Expand description
Change to a pending order.
The amendment starts from the order as it was read and carries every value the request can state, changed or not, so the order ends up exactly as the amendment describes it: a stop loss, a take profit or an expiry the amendment does not hold is taken off the order.
Implementations§
Source§impl OrderAmendment
impl OrderAmendment
Sourcepub fn of(account: AccountId, order: &Order) -> Self
pub fn of(account: AccountId, order: &Order) -> Self
Starts an amendment that leaves the order of the account as it is.
Sourcepub const fn price(self, price: Price) -> Self
pub const fn price(self, price: Price) -> Self
Changes the price the order waits at: the limit price of a limit order, the stop price of a stop or stop-limit order.
Sourcepub const fn good_till(self, expiry: Timestamp) -> Self
pub const fn good_till(self, expiry: Timestamp) -> Self
Keeps the order in force till the given moment.
Sourcepub const fn good_till_cancelled(self) -> Self
pub const fn good_till_cancelled(self) -> Self
Keeps the order in force until it is executed or cancelled.
Sourcepub fn stop_loss(self, price: Option<Price>) -> Self
pub fn stop_loss(self, price: Option<Price>) -> Self
Sets the stop loss to the given price, or takes it off the order with None.
Sourcepub fn take_profit(self, price: Option<Price>) -> Self
pub fn take_profit(self, price: Option<Price>) -> Self
Sets the take profit to the given price, or takes it off the order with None.
Sourcepub const fn slippage(self, points: u32) -> Self
pub const fn slippage(self, points: u32) -> Self
Changes the slippage of a stop-limit order, in points of the symbol.
The slippage is bound as that of NewOrder::stop_limit, against the stop price the
amendment holds, before the amendment is sent.