pub struct PositionAmendment { /* private fields */ }Expand description
Change to the stop loss and take profit of a position.
The amendment starts from the position as it was read; the request states both prices, and one it does not state is taken off the position.
Implementations§
Source§impl PositionAmendment
impl PositionAmendment
Sourcepub const fn of(account: AccountId, position: &Position) -> Self
pub const fn of(account: AccountId, position: &Position) -> Self
Starts an amendment that leaves the position of the account as it is.
Sourcepub const fn stop_loss(self, price: Option<Price>) -> Self
pub const fn stop_loss(self, price: Option<Price>) -> Self
Sets the stop loss to the given price, or removes it with None.
Sourcepub const fn take_profit(self, price: Option<Price>) -> Self
pub const fn take_profit(self, price: Option<Price>) -> Self
Sets the take profit to the given price, or removes it with None.
Sourcepub const fn position(&self) -> PositionId
pub const fn position(&self) -> PositionId
Returns the position the amendment changes.
Trait Implementations§
Source§impl Clone for PositionAmendment
impl Clone for PositionAmendment
impl Copy for PositionAmendment
Source§impl Debug for PositionAmendment
impl Debug for PositionAmendment
impl Eq for PositionAmendment
Source§impl Hash for PositionAmendment
impl Hash for PositionAmendment
Source§impl PartialEq for PositionAmendment
impl PartialEq for PositionAmendment
impl StructuralPartialEq for PositionAmendment
Auto Trait Implementations§
impl Forget for PositionAmendment
impl Freeze for PositionAmendment
impl Move for PositionAmendment
impl RefUnwindSafe for PositionAmendment
impl Send for PositionAmendment
impl Sync for PositionAmendment
impl Unpin for PositionAmendment
impl UnsafeUnpin for PositionAmendment
impl UnwindSafe for PositionAmendment
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more