#[non_exhaustive]pub struct TradingRules {
pub symbol: String,
pub quantity_step: f64,
pub min_quantity: f64,
pub max_quantity: Option<f64>,
pub point_value: f64,
pub pip_value: Option<f64>,
pub time_in_force: Vec<TimeInForce>,
pub leverage: Option<f64>,
}Expand description
How a symbol trades at the broker. The order ticket sizes orders by these rules.
Fields (Non-exhaustive)§
This struct is marked as non-exhaustive
Struct { .. } syntax; cannot be matched against without a wildcard ..; and struct update syntax will not work.symbol: StringThe symbol as the feed knows it.
quantity_step: f64Positive: quantities are whole multiples of it.
min_quantity: f64The smallest quantity, positive.
max_quantity: Option<f64>The largest quantity, if the broker limits it.
point_value: f64The profit or loss in the account’s currency of one unit moving by one price unit: 1 for a share, the contract multiplier for a future.
pip_value: Option<f64>The profit or loss in the account’s currency of one unit moving by one pip. None when the
broker reports none: the ticket then takes the instrument’s
pip_size times
point_value, and shows no pip value for an instrument without pips.
time_in_force: Vec<TimeInForce>The times in force the broker accepts for the symbol, the default first. Never empty.
leverage: Option<f64>The trade value per unit of margin, such as 20 for 20:1, if the broker trades the symbol on margin. The order ticket estimates the margin an order needs from it.
Implementations§
Trait Implementations§
Source§impl Clone for TradingRules
impl Clone for TradingRules
Source§fn clone(&self) -> TradingRules
fn clone(&self) -> TradingRules
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for TradingRules
impl Debug for TradingRules
Source§impl PartialEq for TradingRules
impl PartialEq for TradingRules
impl StructuralPartialEq for TradingRules
Auto Trait Implementations§
impl Freeze for TradingRules
impl RefUnwindSafe for TradingRules
impl Send for TradingRules
impl Sync for TradingRules
impl Unpin for TradingRules
impl UnsafeUnpin for TradingRules
impl UnwindSafe for TradingRules
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
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