pub struct SniperAlgorithm { /* private fields */ }Expand description
Fires a single aggressive order once a target price is touched.
Implementations§
Trait Implementations§
Source§impl ExecutionAlgorithm for SniperAlgorithm
impl ExecutionAlgorithm for SniperAlgorithm
Source§fn status(&self) -> AlgoStatus
fn status(&self) -> AlgoStatus
Returns the current status of the algorithm.
Source§fn start(&mut self) -> Result<Vec<ChildOrderRequest>, Error>
fn start(&mut self) -> Result<Vec<ChildOrderRequest>, Error>
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>, Error>
fn on_fill(&mut self, fill: &Fill) -> Result<Vec<ChildOrderRequest>, Error>
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>, Error>
fn on_tick(&mut self, tick: &Tick) -> Result<Vec<ChildOrderRequest>, Error>
Called when market tick data is received (mainly for VWAP algorithms).
Source§fn on_timer(&mut self) -> Result<Vec<ChildOrderRequest>, Error>
fn on_timer(&mut self) -> Result<Vec<ChildOrderRequest>, Error>
Called when a timer event occurs (mainly for TWAP algorithms).
Source§fn from_state(state: Value) -> Result<SniperAlgorithm, Error>where
SniperAlgorithm: Sized,
fn from_state(state: Value) -> Result<SniperAlgorithm, Error>where
SniperAlgorithm: Sized,
Restore algorithm from persisted state.
Auto Trait Implementations§
impl Freeze for SniperAlgorithm
impl RefUnwindSafe for SniperAlgorithm
impl Send for SniperAlgorithm
impl Sync for SniperAlgorithm
impl Unpin for SniperAlgorithm
impl UnsafeUnpin for SniperAlgorithm
impl UnwindSafe for SniperAlgorithm
Blanket Implementations§
impl<T> Allocation for T
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
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
Source§fn in_current_span(self) -> Instrumented<Self> ⓘ
fn in_current_span(self) -> Instrumented<Self> ⓘ
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§impl<T> IntoRequest<T> for T
impl<T> IntoRequest<T> for T
Source§fn into_request(self) -> Request<T>
fn into_request(self) -> Request<T>
Wrap the input message
T in a tonic::Request