nautilus_execution/matching_engine/
config.rs1#[derive(Debug, Clone)]
18pub struct OrderMatchingEngineConfig {
19 pub bar_execution: bool,
20 pub trade_execution: bool,
21 pub liquidity_consumption: bool,
22 pub reject_stop_orders: bool,
23 pub support_gtd_orders: bool,
24 pub support_contingent_orders: bool,
25 pub use_position_ids: bool,
26 pub use_random_ids: bool,
27 pub use_reduce_only: bool,
28 pub price_protection_points: Option<u32>,
29}
30
31impl OrderMatchingEngineConfig {
32 #[must_use]
34 #[allow(clippy::too_many_arguments)]
35 pub const fn new(
36 bar_execution: bool,
37 trade_execution: bool,
38 liquidity_consumption: bool,
39 reject_stop_orders: bool,
40 support_gtd_orders: bool,
41 support_contingent_orders: bool,
42 use_position_ids: bool,
43 use_random_ids: bool,
44 use_reduce_only: bool,
45 ) -> Self {
46 Self {
47 bar_execution,
48 trade_execution,
49 liquidity_consumption,
50 reject_stop_orders,
51 support_gtd_orders,
52 support_contingent_orders,
53 use_position_ids,
54 use_random_ids,
55 use_reduce_only,
56 price_protection_points: None,
57 }
58 }
59
60 #[must_use]
62 pub const fn with_price_protection_points(
63 mut self,
64 price_protection_points: Option<u32>,
65 ) -> Self {
66 self.price_protection_points = price_protection_points;
67 self
68 }
69}
70
71#[allow(clippy::derivable_impls)]
72impl Default for OrderMatchingEngineConfig {
73 fn default() -> Self {
75 Self {
76 bar_execution: false,
77 trade_execution: false,
78 liquidity_consumption: false,
79 reject_stop_orders: false,
80 support_gtd_orders: false,
81 support_contingent_orders: false,
82 use_position_ids: false,
83 use_random_ids: false,
84 use_reduce_only: false,
85 price_protection_points: None,
86 }
87 }
88}