pub struct PlaybookEngine { /* private fields */ }Implementations§
Source§impl PlaybookEngine
impl PlaybookEngine
pub fn new( symbol: String, strategy_group: StrategyGroup, executor: Box<dyn OrderExecutor>, ) -> Self
Sourcepub fn new_with_risk_config(
symbol: String,
strategy_group: StrategyGroup,
executor: Box<dyn OrderExecutor>,
risk_config: Option<RiskConfig>,
) -> Self
pub fn new_with_risk_config( symbol: String, strategy_group: StrategyGroup, executor: Box<dyn OrderExecutor>, risk_config: Option<RiskConfig>, ) -> Self
Create an engine that wraps the executor with risk checks.
If risk_config is Some, the executor is wrapped in a
RiskCheckedOrderExecutor so every order goes through pre-trade
risk validation. If None, the inner executor is used directly
(identical to Self::new).
Sourcepub fn fsm_state(&self) -> &PlaybookState
pub fn fsm_state(&self) -> &PlaybookState
Return current FSM state (for external inspection / tests).
Sourcepub async fn tick_snapshot(
&mut self,
snapshot: &TaSnapshot,
now: u64,
) -> TickResult
pub async fn tick_snapshot( &mut self, snapshot: &TaSnapshot, now: u64, ) -> TickResult
Tick with a TaSnapshot (new API). Converts to TechnicalIndicators
internally via snapshot_to_indicators.
Sourcepub async fn tick(
&mut self,
indicators: &TechnicalIndicators,
now: u64,
) -> TickResult
pub async fn tick( &mut self, indicators: &TechnicalIndicators, now: u64, ) -> TickResult
Core tick — called once per interval.
Auto Trait Implementations§
impl Freeze for PlaybookEngine
impl !RefUnwindSafe for PlaybookEngine
impl Send for PlaybookEngine
impl Sync for PlaybookEngine
impl Unpin for PlaybookEngine
impl UnsafeUnpin for PlaybookEngine
impl !UnwindSafe for PlaybookEngine
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