Struct fxoanda::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

source

pub fn new() -> Instrument

source

pub fn with_minimum_trade_size(self, x: f32) -> Instrument

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
source

pub fn with_display_name(self, x: String) -> Instrument

The display name of the Instrument

  • param String
  • return Instrument
source

pub fn with_name(self, x: String) -> Instrument

The name of the Instrument format: A string containing the base currency and quote currency delimited by a “_”.

  • param String
  • return Instrument
source

pub fn with_display_precision(self, x: i32) -> Instrument

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
source

pub fn with_maximum_trailing_stop_distance(self, x: f32) -> Instrument

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
source

pub fn with_minimum_trailing_stop_distance(self, x: f32) -> Instrument

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
source

pub fn with_margin_rate(self, x: f32) -> Instrument

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
source

pub fn with_commission(self, x: InstrumentCommission) -> Instrument

An InstrumentCommission represents an instrument-specific commission

  • param InstrumentCommission
  • return Instrument
source

pub fn with_trade_units_precision(self, x: i32) -> Instrument

The amount of decimal places that may be provided when specifying the number of units traded for this instrument.

  • param i32
  • return Instrument
source

pub fn with_pip_location(self, x: i32) -> Instrument

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
source

pub fn with_maximum_order_units(self, x: f32) -> Instrument

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
source

pub fn with_maximum_position_size(self, x: f32) -> Instrument

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
source

pub fn with_otype(self, x: String) -> Instrument

The type of the Instrument

  • param String
  • return Instrument

Trait Implementations§

source§

impl Debug for Instrument

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result<(), Error>

Formats the value using the given formatter. Read more
source§

impl<'de> Deserialize<'de> for Instrument

source§

fn deserialize<__D>( __deserializer: __D ) -> Result<Instrument, <__D as Deserializer<'de>>::Error>
where __D: Deserializer<'de>,

Deserialize this value from the given Serde deserializer. Read more
source§

impl Serialize for Instrument

source§

fn serialize<__S>( &self, __serializer: __S ) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>
where __S: Serializer,

Serialize this value into the given Serde serializer. Read more

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for T
where T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for T
where T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

source§

impl<T> Instrument for T

source§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
source§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
source§

impl<T, U> Into<U> for T
where U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
source§

impl<T> WithSubscriber for T

source§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
source§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more
source§

impl<T> DeserializeOwned for T
where T: for<'de> Deserialize<'de>,