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