Skip to main content

apple_quant_algorithmic/instrument/
spec.rs

1use crate::{price::PriceType, volume::VolumeType};
2use std::fmt::Debug;
3
4use super::InstrumentKind;
5
6mod decimal;
7mod floating_point;
8mod xspec;
9
10pub use decimal::*;
11pub use floating_point::*;
12pub use xspec::*;
13
14pub trait InstrumentSpec: Debug + Clone + Copy + PartialEq + Eq + PartialOrd + Ord {
15	const INSTRUMENT_KIND: InstrumentKind;
16	const BARE_SYMBOL: &'static str;
17
18	type PriceSpec: XSpec;
19	type VolumeSpec: XSpec;
20
21	type PriceType: PriceType<Self::PriceSpec>;
22	type VolumeType: VolumeType<Self::VolumeSpec>;
23}