pub struct TrailingStopAlgorithm { /* private fields */ }Expand description
Simple trailing stop that arms once price trades through an activation level and fires a market sell when price retraces by the configured callback percentage.
Implementations§
Trait Implementations§
Source§impl ExecutionAlgorithm for TrailingStopAlgorithm
impl ExecutionAlgorithm for TrailingStopAlgorithm
Source§fn status(&self) -> AlgoStatus
fn status(&self) -> AlgoStatus
Returns the current status of the algorithm.
Source§fn start(&mut self) -> Result<Vec<ChildOrderRequest>>
fn start(&mut self) -> Result<Vec<ChildOrderRequest>>
Start the algorithm and return any initial child orders.
Source§fn on_child_order_placed(&mut self, _order: &Order)
fn on_child_order_placed(&mut self, _order: &Order)
Called when a child order has been successfully placed.
Source§fn on_fill(&mut self, fill: &Fill) -> Result<Vec<ChildOrderRequest>>
fn on_fill(&mut self, fill: &Fill) -> Result<Vec<ChildOrderRequest>>
Called when a fill is received for one of this algorithm’s child orders.
Source§fn on_tick(&mut self, tick: &Tick) -> Result<Vec<ChildOrderRequest>>
fn on_tick(&mut self, tick: &Tick) -> Result<Vec<ChildOrderRequest>>
Called when market tick data is received (mainly for VWAP algorithms).
Source§fn on_timer(&mut self) -> Result<Vec<ChildOrderRequest>>
fn on_timer(&mut self) -> Result<Vec<ChildOrderRequest>>
Called when a timer event occurs (mainly for TWAP algorithms).
Auto Trait Implementations§
impl Freeze for TrailingStopAlgorithm
impl RefUnwindSafe for TrailingStopAlgorithm
impl Send for TrailingStopAlgorithm
impl Sync for TrailingStopAlgorithm
impl Unpin for TrailingStopAlgorithm
impl UnwindSafe for TrailingStopAlgorithm
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