Struct fxoanda_definitions::OrderBook
source · pub struct OrderBook {
pub buckets: Option<Vec<OrderBookBucket>>,
pub instrument: Option<String>,
pub price: Option<f32>,
pub bucket_width: Option<f32>,
pub time: Option<DateTime<Utc>>,
}
Fields§
§buckets: Option<Vec<OrderBookBucket>>
The partitioned order book, divided into buckets using a default bucket width. These buckets are only provided for price ranges which actually contain order or position data.
instrument: Option<String>
The order book’s instrument format: A string containing the base currency and quote currency delimited by a “_”.
price: Option<f32>
The price (midpoint) for the order book’s instrument at the time of the order book snapshot format: A decimal number encodes as a string. The amount of precision provided depends on the Instrument.
bucket_width: Option<f32>
The price width for each bucket. Each bucket covers the price range from the bucket’s price to the bucket’s price + bucketWidth. format: A decimal number encodes as a string. The amount of precision provided depends on the Instrument.
time: Option<DateTime<Utc>>
The time when the order book snapshot was created. format: The RFC 3339 representation is a string conforming to https://tools.ietf.org/rfc/rfc3339.txt. The Unix representation is a string representing the number of seconds since the Unix Epoch (January 1st, 1970 at UTC). The value is a fractional number, where the fractional part represents a fraction of a second (up to nine decimal places).
Implementations§
source§impl OrderBook
impl OrderBook
pub fn new() -> OrderBook
sourcepub fn with_buckets(self, x: Vec<OrderBookBucket>) -> Self
pub fn with_buckets(self, x: Vec<OrderBookBucket>) -> Self
The partitioned order book, divided into buckets using a default bucket width. These buckets are only provided for price ranges which actually contain order or position data.
- param Vec
- return OrderBook
sourcepub fn with_instrument(self, x: String) -> Self
pub fn with_instrument(self, x: String) -> Self
The order book’s instrument format: A string containing the base currency and quote currency delimited by a “_”.
- param String
- return OrderBook
sourcepub fn with_price(self, x: f32) -> Self
pub fn with_price(self, x: f32) -> Self
The price (midpoint) for the order book’s instrument at the time of the order book snapshot format: A decimal number encodes as a string. The amount of precision provided depends on the Instrument.
- param f32
- return OrderBook
sourcepub fn with_bucket_width(self, x: f32) -> Self
pub fn with_bucket_width(self, x: f32) -> Self
The price width for each bucket. Each bucket covers the price range from the bucket’s price to the bucket’s price + bucketWidth. format: A decimal number encodes as a string. The amount of precision provided depends on the Instrument.
- param f32
- return OrderBook
sourcepub fn with_time(self, x: DateTime<Utc>) -> Self
pub fn with_time(self, x: DateTime<Utc>) -> Self
The time when the order book snapshot was created. format: The RFC 3339 representation is a string conforming to https://tools.ietf.org/rfc/rfc3339.txt. The Unix representation is a string representing the number of seconds since the Unix Epoch (January 1st, 1970 at UTC). The value is a fractional number, where the fractional part represents a fraction of a second (up to nine decimal places).
- param DateTime
- return OrderBook