pub struct SandboxExecutionClientConfig {Show 19 fields
pub trader_id: TraderId,
pub account_id: AccountId,
pub venue: Venue,
pub starting_balances: Vec<Money>,
pub base_currency: Option<Currency>,
pub oms_type: OmsType,
pub account_type: AccountType,
pub default_leverage: Decimal,
pub leverages: AHashMap<InstrumentId, Decimal>,
pub book_type: BookType,
pub frozen_account: bool,
pub bar_execution: bool,
pub trade_execution: 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,
}Expand description
Configuration for SandboxExecutionClient instances.
Fields§
§trader_id: TraderIdThe trader ID for this client.
account_id: AccountIdThe account ID for this client.
venue: VenueThe venue for this sandbox execution client.
starting_balances: Vec<Money>The starting balances for this sandbox venue.
base_currency: Option<Currency>The base currency for this venue (None for multi-currency).
oms_type: OmsTypeThe order management system type used by the exchange.
account_type: AccountTypeThe account type for the client.
default_leverage: DecimalThe account default leverage (for margin accounts).
leverages: AHashMap<InstrumentId, Decimal>Per-instrument leverage overrides.
book_type: BookTypeThe order book type for the matching engine.
frozen_account: boolIf True, account balances won’t change (frozen).
bar_execution: boolIf bars should be processed by the matching engine (and move the market).
trade_execution: boolIf trades should be processed by the matching engine (and move the market).
reject_stop_orders: boolIf stop orders are rejected on submission if trigger price is in the market.
support_gtd_orders: boolIf orders with GTD time in force will be supported by the venue.
support_contingent_orders: boolIf contingent orders will be supported/respected by the venue.
use_position_ids: boolIf venue position IDs will be generated on order fills.
use_random_ids: boolIf all venue generated identifiers will be random UUID4’s.
use_reduce_only: boolIf the reduce_only execution instruction on orders will be honored.
Implementations§
Source§impl SandboxExecutionClientConfig
impl SandboxExecutionClientConfig
Sourcepub fn new(
trader_id: TraderId,
account_id: AccountId,
venue: Venue,
starting_balances: Vec<Money>,
) -> Self
pub fn new( trader_id: TraderId, account_id: AccountId, venue: Venue, starting_balances: Vec<Money>, ) -> Self
Creates a new SandboxExecutionClientConfig instance.
Sourcepub fn to_matching_engine_config(&self) -> OrderMatchingEngineConfig
pub fn to_matching_engine_config(&self) -> OrderMatchingEngineConfig
Creates an [OrderMatchingEngineConfig] from this sandbox config.
Sourcepub fn with_base_currency(self, currency: Currency) -> Self
pub fn with_base_currency(self, currency: Currency) -> Self
Sets the base currency.
Sourcepub fn with_oms_type(self, oms_type: OmsType) -> Self
pub fn with_oms_type(self, oms_type: OmsType) -> Self
Sets the OMS type.
Sourcepub fn with_account_type(self, account_type: AccountType) -> Self
pub fn with_account_type(self, account_type: AccountType) -> Self
Sets the account type.
Sourcepub fn with_default_leverage(self, leverage: Decimal) -> Self
pub fn with_default_leverage(self, leverage: Decimal) -> Self
Sets the default leverage.
Sourcepub fn with_book_type(self, book_type: BookType) -> Self
pub fn with_book_type(self, book_type: BookType) -> Self
Sets the book type.
Sourcepub fn with_frozen_account(self, frozen: bool) -> Self
pub fn with_frozen_account(self, frozen: bool) -> Self
Sets whether the account is frozen.
Sourcepub fn with_bar_execution(self, enabled: bool) -> Self
pub fn with_bar_execution(self, enabled: bool) -> Self
Sets whether bar execution is enabled.
Sourcepub fn with_trade_execution(self, enabled: bool) -> Self
pub fn with_trade_execution(self, enabled: bool) -> Self
Sets whether trade execution is enabled.
Trait Implementations§
Source§impl ClientConfig for SandboxExecutionClientConfig
impl ClientConfig for SandboxExecutionClientConfig
Source§impl Clone for SandboxExecutionClientConfig
impl Clone for SandboxExecutionClientConfig
Source§fn clone(&self) -> SandboxExecutionClientConfig
fn clone(&self) -> SandboxExecutionClientConfig
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for SandboxExecutionClientConfig
impl Debug for SandboxExecutionClientConfig
Source§impl<'de> Deserialize<'de> for SandboxExecutionClientConfig
impl<'de> Deserialize<'de> for SandboxExecutionClientConfig
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Source§impl<'py> IntoPyObject<'py> for SandboxExecutionClientConfig
impl<'py> IntoPyObject<'py> for SandboxExecutionClientConfig
Source§type Target = SandboxExecutionClientConfig
type Target = SandboxExecutionClientConfig
Source§type Output = Bound<'py, <SandboxExecutionClientConfig as IntoPyObject<'py>>::Target>
type Output = Bound<'py, <SandboxExecutionClientConfig as IntoPyObject<'py>>::Target>
Source§fn into_pyobject(
self,
py: Python<'py>,
) -> Result<<Self as IntoPyObject<'_>>::Output, <Self as IntoPyObject<'_>>::Error>
fn into_pyobject( self, py: Python<'py>, ) -> Result<<Self as IntoPyObject<'_>>::Output, <Self as IntoPyObject<'_>>::Error>
Source§impl PyClass for SandboxExecutionClientConfig
impl PyClass for SandboxExecutionClientConfig
Source§impl PyClassImpl for SandboxExecutionClientConfig
impl PyClassImpl for SandboxExecutionClientConfig
Source§const IS_BASETYPE: bool = false
const IS_BASETYPE: bool = false
Source§const IS_SUBCLASS: bool = false
const IS_SUBCLASS: bool = false
Source§const IS_MAPPING: bool = false
const IS_MAPPING: bool = false
Source§const IS_SEQUENCE: bool = false
const IS_SEQUENCE: bool = false
Source§const IS_IMMUTABLE_TYPE: bool = false
const IS_IMMUTABLE_TYPE: bool = false
Source§const RAW_DOC: &'static CStr = /// Configuration for `SandboxExecutionClient` instances.
const RAW_DOC: &'static CStr = /// Configuration for `SandboxExecutionClient` instances.
Source§const DOC: &'static CStr
const DOC: &'static CStr
text_signature if a constructor is defined. Read moreSource§type ThreadChecker = SendablePyClass<SandboxExecutionClientConfig>
type ThreadChecker = SendablePyClass<SandboxExecutionClientConfig>
Source§type PyClassMutability = <<PyAny as PyClassBaseType>::PyClassMutability as PyClassMutability>::MutableChild
type PyClassMutability = <<PyAny as PyClassBaseType>::PyClassMutability as PyClassMutability>::MutableChild
Source§type BaseNativeType = PyAny
type BaseNativeType = PyAny
PyAny by default, and when you declare
#[pyclass(extends=PyDict)], it’s PyDict.fn items_iter() -> PyClassItemsIter
fn lazy_type_object() -> &'static LazyTypeObject<Self>
fn dict_offset() -> Option<isize>
fn weaklist_offset() -> Option<isize>
Source§impl PyClassNewTextSignature for SandboxExecutionClientConfig
impl PyClassNewTextSignature for SandboxExecutionClientConfig
const TEXT_SIGNATURE: &'static str = "(venue, starting_balances, trader_id=None, account_id=None, base_currency=None, oms_type=None, account_type=None, default_leverage=None, book_type=None, frozen_account=False, bar_execution=True, trade_execution=False, reject_stop_orders=True, support_gtd_orders=True, support_contingent_orders=True, use_position_ids=True, use_random_ids=False, use_reduce_only=True)"
Source§impl PyMethods<SandboxExecutionClientConfig> for PyClassImplCollector<SandboxExecutionClientConfig>
impl PyMethods<SandboxExecutionClientConfig> for PyClassImplCollector<SandboxExecutionClientConfig>
fn py_methods(self) -> &'static PyClassItems
Source§impl PyTypeInfo for SandboxExecutionClientConfig
impl PyTypeInfo for SandboxExecutionClientConfig
Source§fn type_object_raw(py: Python<'_>) -> *mut PyTypeObject
fn type_object_raw(py: Python<'_>) -> *mut PyTypeObject
§fn type_object(py: Python<'_>) -> Bound<'_, PyType>
fn type_object(py: Python<'_>) -> Bound<'_, PyType>
§fn is_type_of(object: &Bound<'_, PyAny>) -> bool
fn is_type_of(object: &Bound<'_, PyAny>) -> bool
object is an instance of this type or a subclass of this type.§fn is_exact_type_of(object: &Bound<'_, PyAny>) -> bool
fn is_exact_type_of(object: &Bound<'_, PyAny>) -> bool
object is an instance of this type.impl DerefToPyAny for SandboxExecutionClientConfig
impl ExtractPyClassWithClone for SandboxExecutionClientConfig
Auto Trait Implementations§
impl Freeze for SandboxExecutionClientConfig
impl RefUnwindSafe for SandboxExecutionClientConfig
impl Send for SandboxExecutionClientConfig
impl Sync for SandboxExecutionClientConfig
impl Unpin for SandboxExecutionClientConfig
impl UnwindSafe for SandboxExecutionClientConfig
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
§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§impl<'py, T> IntoPyObjectExt<'py> for Twhere
T: IntoPyObject<'py>,
impl<'py, T> IntoPyObjectExt<'py> for Twhere
T: IntoPyObject<'py>,
§fn into_bound_py_any(self, py: Python<'py>) -> Result<Bound<'py, PyAny>, PyErr>
fn into_bound_py_any(self, py: Python<'py>) -> Result<Bound<'py, PyAny>, PyErr>
self into an owned Python object, dropping type information.§fn into_py_any(self, py: Python<'py>) -> Result<Py<PyAny>, PyErr>
fn into_py_any(self, py: Python<'py>) -> Result<Py<PyAny>, PyErr>
self into an owned Python object, dropping type information and unbinding it
from the 'py lifetime.§fn into_pyobject_or_pyerr(self, py: Python<'py>) -> Result<Self::Output, PyErr>
fn into_pyobject_or_pyerr(self, py: Python<'py>) -> Result<Self::Output, PyErr>
self into a Python object. Read more§impl<'py, T> IntoPyObjectNautilusExt<'py> for Twhere
T: IntoPyObjectExt<'py>,
impl<'py, T> IntoPyObjectNautilusExt<'py> for Twhere
T: IntoPyObjectExt<'py>,
§fn into_py_any_unwrap(self, py: Python<'py>) -> Py<PyAny>
fn into_py_any_unwrap(self, py: Python<'py>) -> Py<PyAny>
§impl<T> PolicyExt for Twhere
T: ?Sized,
impl<T> PolicyExt for Twhere
T: ?Sized,
§impl<T> PyErrArguments for T
impl<T> PyErrArguments for T
§impl<T> PyTypeCheck for Twhere
T: PyTypeInfo,
impl<T> PyTypeCheck for Twhere
T: PyTypeInfo,
§const NAME: &'static str = T::NAME
const NAME: &'static str = T::NAME
§fn type_check(object: &Bound<'_, PyAny>) -> bool
fn type_check(object: &Bound<'_, PyAny>) -> bool
§fn classinfo_object(py: Python<'_>) -> Bound<'_, PyAny>
fn classinfo_object(py: Python<'_>) -> Bound<'_, PyAny>
isinstance and issubclass function. Read more