apple_quant_algorithmic/
strategy.rs1use crate::{
2 backend::{OrderIdGenerator, OrdersBackend},
3 instrument::{InstrumentData, InstrumentSpec},
4 order::{DeferredOrderActions, StateGoal},
5 order_manager::{OrderManager, OrdersCapacitySpec},
6 timestamp::TickTimestamp, volume::DirectionalExposure,
7};
8
9pub trait Strategy<
10 IS: InstrumentSpec,
11 OB: OrdersBackend<IS>,
12 CS: OrdersCapacitySpec,
13> {
14 #[allow(unused_variables)]
15 fn initialize<'instrument_data, 'aggregated_data>(
16 &mut self,
17 tick_timestamp: &TickTimestamp,
18 instrument_data: &InstrumentData<'instrument_data, 'aggregated_data, IS>,
19 deferred_order_actions: &mut DeferredOrderActions<IS>,
20 order_id_generator: &mut OrderIdGenerator,
21 ) -> impl Future<Output = anyhow::Result<()>> {
22 async {
23 Ok(())
24 }
25 }
26
27 #[allow(unused_variables)]
28 fn data_update<'instrument_data, 'aggregated_data>(
29 &mut self,
30 tick_timestamp: &TickTimestamp,
31 instrument_data: &InstrumentData<'instrument_data, 'aggregated_data, IS>,
32 order_manager: &OrderManager<IS, CS>,
33 directional_exposure: &DirectionalExposure<IS>,
34 state_goal: &StateGoal,
35 deferred_order_actions: &mut DeferredOrderActions<IS>,
36 order_id_generator: &mut OrderIdGenerator,
37 ) -> impl Future<Output = anyhow::Result<()>> {
38 async {
39 Ok(())
40 }
41 }
42}