pub struct ScalpingStrategy { /* private fields */ }Expand description
Scalping trading strategy.
This strategy implements a simple scalping approach:
- Place buy orders at the best bid price when conditions are favorable
- Track purchased lots and their prices
- Place sell orders at a price that ensures minimum profit
- Adjust orders as market conditions change
Implementations§
Source§impl ScalpingStrategy
impl ScalpingStrategy
Sourcepub fn new(settings: TradingSettings) -> Self
pub fn new(settings: TradingSettings) -> Self
Creates a new scalping strategy with the given settings.
Sourcepub fn settings(&self) -> &TradingSettings
pub fn settings(&self) -> &TradingSettings
Returns the settings.
Trait Implementations§
Source§impl Debug for ScalpingStrategy
impl Debug for ScalpingStrategy
Source§impl Strategy for ScalpingStrategy
impl Strategy for ScalpingStrategy
Source§fn decide<'life0, 'life1, 'async_trait>(
&'life0 self,
state: &'life1 MarketState,
) -> Pin<Box<dyn Future<Output = StrategyDecision> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn decide<'life0, 'life1, 'async_trait>(
&'life0 self,
state: &'life1 MarketState,
) -> Pin<Box<dyn Future<Output = StrategyDecision> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Makes a decision based on the current market state.
Source§fn on_order_filled<'life0, 'life1, 'async_trait>(
&'life0 mut self,
order: &'life1 Order,
) -> Pin<Box<dyn Future<Output = ()> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn on_order_filled<'life0, 'life1, 'async_trait>(
&'life0 mut self,
order: &'life1 Order,
) -> Pin<Box<dyn Future<Output = ()> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Called when an order is filled.
Source§fn on_order_cancelled<'life0, 'life1, 'async_trait>(
&'life0 mut self,
order: &'life1 Order,
) -> Pin<Box<dyn Future<Output = ()> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn on_order_cancelled<'life0, 'life1, 'async_trait>(
&'life0 mut self,
order: &'life1 Order,
) -> Pin<Box<dyn Future<Output = ()> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Called when an order is cancelled.
Source§fn reset<'life0, 'async_trait>(
&'life0 mut self,
) -> Pin<Box<dyn Future<Output = ()> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn reset<'life0, 'async_trait>(
&'life0 mut self,
) -> Pin<Box<dyn Future<Output = ()> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Resets the strategy state.
Source§fn is_enabled(&self) -> bool
fn is_enabled(&self) -> bool
Returns whether the strategy is enabled.
Auto Trait Implementations§
impl Forget for ScalpingStrategy
impl Freeze for ScalpingStrategy
impl Move for ScalpingStrategy
impl RefUnwindSafe for ScalpingStrategy
impl Send for ScalpingStrategy
impl Sync for ScalpingStrategy
impl Unpin for ScalpingStrategy
impl UnsafeUnpin for ScalpingStrategy
impl UnwindSafe for ScalpingStrategy
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