1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
use crate::data::market::MarketEvent;
use crate::execution::fill::FillEvent;
use crate::portfolio::error::PortfolioError;
use crate::portfolio::order::OrderEvent;
use crate::strategy::signal::SignalEvent;
pub mod allocator;
pub mod error;
pub mod order;
pub mod portfolio;
pub mod position;
pub mod repository;
pub mod risk;
pub trait MarketUpdater {
fn update_from_market(&mut self, market: &MarketEvent) -> Result<(), PortfolioError>;
}
pub trait OrderGenerator {
fn generate_order(
&mut self,
signal: &SignalEvent,
) -> Result<Option<OrderEvent>, PortfolioError>;
}
pub trait FillUpdater {
fn update_from_fill(&mut self, fill: &FillEvent) -> Result<(), PortfolioError>;
}