pub enum CommissionModel {
PerLotPerSide {
amount: f64,
currency: String,
},
NotionalRatePerSide {
buy_rate: f64,
sell_rate: f64,
},
}Expand description
How commission is charged for one instrument.
The tag accepts both the snake_case spelling this type writes and the PascalCase spelling the service request and cost file use, so a specification read back out of a stored run can be fed straight into a new request.
Variants§
PerLotPerSide
Fixed amount per 1.0 lot per side, already expressed in the account currency. The declared currency is validated against the run’s account currency when one is known.
NotionalRatePerSide
Fraction of traded notional per side, charged in the instrument’s native profit-and-loss currency. Buy and sell rates are separate because some venues charge asymmetrically; use equal values for a symmetric venue.
Implementations§
Source§impl CommissionModel
impl CommissionModel
Sourcepub fn declared_currency(&self) -> Option<&str>
pub fn declared_currency(&self) -> Option<&str>
Account currency this model is denominated in, when it declares one.
Trait Implementations§
Source§impl Clone for CommissionModel
impl Clone for CommissionModel
Source§impl Debug for CommissionModel
impl Debug for CommissionModel
Source§impl<'de> Deserialize<'de> for CommissionModel
impl<'de> Deserialize<'de> for CommissionModel
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 PartialEq for CommissionModel
impl PartialEq for CommissionModel
Source§impl Serialize for CommissionModel
impl Serialize for CommissionModel
impl StructuralPartialEq for CommissionModel
Auto Trait Implementations§
impl Freeze for CommissionModel
impl RefUnwindSafe for CommissionModel
impl Send for CommissionModel
impl Sync for CommissionModel
impl Unpin for CommissionModel
impl UnsafeUnpin for CommissionModel
impl UnwindSafe for CommissionModel
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