pub struct SimulatedVenueConfig {Show 35 fields
pub venue: Venue,
pub oms_type: OmsType,
pub account_type: AccountType,
pub book_type: BookType,
pub starting_balances: Vec<Money>,
pub base_currency: Option<Currency>,
pub default_leverage: Option<Decimal>,
pub leverages: AHashMap<InstrumentId, Decimal>,
pub margin_model: Option<MarginModelAny>,
pub modules: Vec<Box<dyn SimulationModule>>,
pub fill_model: FillModelAny,
pub fee_model: FeeModelAny,
pub latency_model: Option<Box<dyn LatencyModel>>,
pub routing: bool,
pub reject_stop_orders: bool,
pub support_gtd_orders: bool,
pub support_contingent_orders: bool,
pub use_position_ids: bool,
pub use_random_ids: bool,
pub use_reduce_only: bool,
pub use_message_queue: bool,
pub use_market_order_acks: bool,
pub bar_execution: bool,
pub bar_adaptive_high_low_ordering: bool,
pub trade_execution: bool,
pub liquidity_consumption: bool,
pub allow_cash_borrowing: bool,
pub frozen_account: bool,
pub queue_position: bool,
pub oto_full_trigger: bool,
pub price_protection_points: u32,
pub settlement_prices: AHashMap<InstrumentId, Price>,
pub liquidation_enabled: bool,
pub liquidation_trigger_ratio: f64,
pub liquidation_cancel_open_orders: bool,
}Expand description
Imperative-API configuration for registering a simulated venue on
crate::engine::BacktestEngine.
Constructed via [bon::Builder] so callers only specify what differs from
the documented defaults. Field types mirror the internal
SimulatedExchange shapes (trait objects for modules/latency, typed
Money balances), which is why this is distinct from the YAML-friendly
BacktestVenueConfig used by BacktestNode.
Fields§
§venue: Venue§oms_type: OmsType§account_type: AccountType§book_type: BookType§starting_balances: Vec<Money>§base_currency: Option<Currency>§default_leverage: Option<Decimal>§leverages: AHashMap<InstrumentId, Decimal>§margin_model: Option<MarginModelAny>§modules: Vec<Box<dyn SimulationModule>>§fill_model: FillModelAny§fee_model: FeeModelAny§latency_model: Option<Box<dyn LatencyModel>>§routing: bool§reject_stop_orders: bool§support_gtd_orders: bool§support_contingent_orders: bool§use_position_ids: bool§use_random_ids: bool§use_reduce_only: bool§use_message_queue: bool§use_market_order_acks: bool§bar_execution: bool§bar_adaptive_high_low_ordering: bool§trade_execution: bool§liquidity_consumption: bool§allow_cash_borrowing: bool§frozen_account: bool§queue_position: bool§oto_full_trigger: bool§price_protection_points: u32§settlement_prices: AHashMap<InstrumentId, Price>Settlement prices for expiring instruments keyed by instrument ID.
liquidation_enabled: boolIf liquidation of positions should be triggered when maintenance margin is breached.
liquidation_trigger_ratio: f64The ratio of equity to maintenance margin at which liquidation is triggered.
A value of 1.0 means liquidation triggers when equity <= maintenance_margin.
liquidation_cancel_open_orders: boolIf open orders should be canceled before closing positions during liquidation.
Implementations§
Source§impl SimulatedVenueConfig
impl SimulatedVenueConfig
Sourcepub fn builder() -> SimulatedVenueConfigBuilder
pub fn builder() -> SimulatedVenueConfigBuilder
Create an instance of SimulatedVenueConfig using the builder syntax
Auto Trait Implementations§
impl !RefUnwindSafe for SimulatedVenueConfig
impl !Send for SimulatedVenueConfig
impl !Sync for SimulatedVenueConfig
impl !UnwindSafe for SimulatedVenueConfig
impl Freeze for SimulatedVenueConfig
impl Unpin for SimulatedVenueConfig
impl UnsafeUnpin for SimulatedVenueConfig
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more