Struct fxoanda_definitions::Instrument
source · pub struct Instrument {Show 13 fields
pub minimum_trade_size: Option<f32>,
pub display_name: Option<String>,
pub name: Option<String>,
pub display_precision: Option<i32>,
pub maximum_trailing_stop_distance: Option<f32>,
pub minimum_trailing_stop_distance: Option<f32>,
pub margin_rate: Option<f32>,
pub commission: Option<InstrumentCommission>,
pub trade_units_precision: Option<i32>,
pub pip_location: Option<i32>,
pub maximum_order_units: Option<f32>,
pub maximum_position_size: Option<f32>,
pub otype: Option<String>,
}
Fields§
§minimum_trade_size: Option<f32>
The smallest number of units allowed to be traded for this instrument. format: A decimal number encoded as a string. The amount of precision provided depends on what the number represents.
display_name: Option<String>
The display name of the Instrument
name: Option<String>
The name of the Instrument format: A string containing the base currency and quote currency delimited by a “_”.
display_precision: Option<i32>
The number of decimal places that should be used to display prices for this instrument. (e.g. a displayPrecision of 5 would result in a price of “1” being displayed as “1.00000”)
maximum_trailing_stop_distance: Option<f32>
The maximum trailing stop distance allowed for a trailing stop loss created for this instrument. Specified in price units. format: A decimal number encoded as a string. The amount of precision provided depends on what the number represents.
minimum_trailing_stop_distance: Option<f32>
The minimum trailing stop distance allowed for a trailing stop loss created for this instrument. Specified in price units. format: A decimal number encoded as a string. The amount of precision provided depends on what the number represents.
margin_rate: Option<f32>
The margin rate for this instrument. format: A decimal number encoded as a string. The amount of precision provided depends on what the number represents.
commission: Option<InstrumentCommission>
An InstrumentCommission represents an instrument-specific commission
trade_units_precision: Option<i32>
The amount of decimal places that may be provided when specifying the number of units traded for this instrument.
pip_location: Option<i32>
The location of the “pip” for this instrument. The decimal position of the pip in this Instrument’s price can be found at 10 ^ pipLocation (e.g. -4 pipLocation results in a decimal pip position of 10 ^ -4 = 0.0001).
maximum_order_units: Option<f32>
The maximum units allowed for an Order placed for this instrument. Specified in units. format: A decimal number encoded as a string. The amount of precision provided depends on what the number represents.
maximum_position_size: Option<f32>
The maximum position size allowed for this instrument. Specified in units. format: A decimal number encoded as a string. The amount of precision provided depends on what the number represents.
otype: Option<String>
The type of the Instrument
Implementations§
source§impl Instrument
impl Instrument
pub fn new() -> Instrument
sourcepub fn with_minimum_trade_size(self, x: f32) -> Self
pub fn with_minimum_trade_size(self, x: f32) -> Self
The smallest number of units allowed to be traded for this instrument. format: A decimal number encoded as a string. The amount of precision provided depends on what the number represents.
- param f32
- return Instrument
sourcepub fn with_display_name(self, x: String) -> Self
pub fn with_display_name(self, x: String) -> Self
The display name of the Instrument
- param String
- return Instrument
sourcepub fn with_name(self, x: String) -> Self
pub fn with_name(self, x: String) -> Self
The name of the Instrument format: A string containing the base currency and quote currency delimited by a “_”.
- param String
- return Instrument
sourcepub fn with_display_precision(self, x: i32) -> Self
pub fn with_display_precision(self, x: i32) -> Self
The number of decimal places that should be used to display prices for this instrument. (e.g. a displayPrecision of 5 would result in a price of “1” being displayed as “1.00000”)
- param i32
- return Instrument
sourcepub fn with_maximum_trailing_stop_distance(self, x: f32) -> Self
pub fn with_maximum_trailing_stop_distance(self, x: f32) -> Self
The maximum trailing stop distance allowed for a trailing stop loss created for this instrument. Specified in price units. format: A decimal number encoded as a string. The amount of precision provided depends on what the number represents.
- param f32
- return Instrument
sourcepub fn with_minimum_trailing_stop_distance(self, x: f32) -> Self
pub fn with_minimum_trailing_stop_distance(self, x: f32) -> Self
The minimum trailing stop distance allowed for a trailing stop loss created for this instrument. Specified in price units. format: A decimal number encoded as a string. The amount of precision provided depends on what the number represents.
- param f32
- return Instrument
sourcepub fn with_margin_rate(self, x: f32) -> Self
pub fn with_margin_rate(self, x: f32) -> Self
The margin rate for this instrument. format: A decimal number encoded as a string. The amount of precision provided depends on what the number represents.
- param f32
- return Instrument
sourcepub fn with_commission(self, x: InstrumentCommission) -> Self
pub fn with_commission(self, x: InstrumentCommission) -> Self
An InstrumentCommission represents an instrument-specific commission
- param InstrumentCommission
- return Instrument
sourcepub fn with_trade_units_precision(self, x: i32) -> Self
pub fn with_trade_units_precision(self, x: i32) -> Self
The amount of decimal places that may be provided when specifying the number of units traded for this instrument.
- param i32
- return Instrument
sourcepub fn with_pip_location(self, x: i32) -> Self
pub fn with_pip_location(self, x: i32) -> Self
The location of the “pip” for this instrument. The decimal position of the pip in this Instrument’s price can be found at 10 ^ pipLocation (e.g. -4 pipLocation results in a decimal pip position of 10 ^ -4 = 0.0001).
- param i32
- return Instrument
sourcepub fn with_maximum_order_units(self, x: f32) -> Self
pub fn with_maximum_order_units(self, x: f32) -> Self
The maximum units allowed for an Order placed for this instrument. Specified in units. format: A decimal number encoded as a string. The amount of precision provided depends on what the number represents.
- param f32
- return Instrument
sourcepub fn with_maximum_position_size(self, x: f32) -> Self
pub fn with_maximum_position_size(self, x: f32) -> Self
The maximum position size allowed for this instrument. Specified in units. format: A decimal number encoded as a string. The amount of precision provided depends on what the number represents.
- param f32
- return Instrument
sourcepub fn with_otype(self, x: String) -> Self
pub fn with_otype(self, x: String) -> Self
The type of the Instrument
- param String
- return Instrument