pub enum FeeModelConfig {
Zero(ZeroFeeModel),
PerContract(PerContractFeeModel),
Percentage(PercentageFeeModel),
}Expand description
Enum-dispatched fee model for use in types that require Clone, PartialEq,
Serialize, and Deserialize (e.g. InstrumentState).
Prefer this over Box<dyn FeeModel> when the field must be part of a derived
serde struct. Defaults to ZeroFeeModel.
§Double-counting warning
Only enable a non-Zero fee model when the ExecutionClient
reports Trade.fees.fees = 0 for fills (i.e., commission is not already embedded in
fill reports). If the client already includes fees in fees.fees and a fee model
is also active, fees will be counted twice.
§Variants
Zero: No fees (backtests where fees are excluded).PerContract: Flat per-contract commission (options).Percentage: Percentage of notional (spot/futures).
Variants§
Trait Implementations§
Source§impl Clone for FeeModelConfig
impl Clone for FeeModelConfig
Source§fn clone(&self) -> FeeModelConfig
fn clone(&self) -> FeeModelConfig
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for FeeModelConfig
impl Debug for FeeModelConfig
Source§impl Default for FeeModelConfig
impl Default for FeeModelConfig
Source§impl<'de> Deserialize<'de> for FeeModelConfig
impl<'de> Deserialize<'de> for FeeModelConfig
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>,
Deserialize this value from the given Serde deserializer. Read more
Source§impl FeeModel for FeeModelConfig
impl FeeModel for FeeModelConfig
Source§impl Hash for FeeModelConfig
impl Hash for FeeModelConfig
Source§impl Ord for FeeModelConfig
impl Ord for FeeModelConfig
Source§fn cmp(&self, other: &FeeModelConfig) -> Ordering
fn cmp(&self, other: &FeeModelConfig) -> Ordering
1.21.0 (const: unstable) · Source§fn max(self, other: Self) -> Selfwhere
Self: Sized,
fn max(self, other: Self) -> Selfwhere
Self: Sized,
Compares and returns the maximum of two values. Read more
Source§impl PartialEq for FeeModelConfig
impl PartialEq for FeeModelConfig
Source§fn eq(&self, other: &FeeModelConfig) -> bool
fn eq(&self, other: &FeeModelConfig) -> bool
Tests for
self and other values to be equal, and is used by ==.Source§impl PartialOrd for FeeModelConfig
impl PartialOrd for FeeModelConfig
Source§impl Serialize for FeeModelConfig
impl Serialize for FeeModelConfig
impl Copy for FeeModelConfig
impl Eq for FeeModelConfig
impl StructuralPartialEq for FeeModelConfig
Auto Trait Implementations§
impl Freeze for FeeModelConfig
impl RefUnwindSafe for FeeModelConfig
impl Send for FeeModelConfig
impl Sync for FeeModelConfig
impl Unpin for FeeModelConfig
impl UnsafeUnpin for FeeModelConfig
impl UnwindSafe for FeeModelConfig
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
Mutably borrows from an owned value. Read more
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<Q, K> Comparable<K> for Q
impl<Q, K> Comparable<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key and return true if they are equal.Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§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>
Converts
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>
Converts
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