Struct fxoanda_definitions::PositionBook
source · pub struct PositionBook {
pub buckets: Option<Vec<PositionBookBucket>>,
pub instrument: Option<String>,
pub price: Option<f32>,
pub bucket_width: Option<f32>,
pub time: Option<DateTime<Utc>>,
}
Fields§
§buckets: Option<Vec<PositionBookBucket>>
The partitioned position 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 position book’s instrument format: A string containing the base currency and quote currency delimited by a “_”.
price: Option<f32>
The price (midpoint) for the position book’s instrument at the time of the position 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 position 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 PositionBook
impl PositionBook
pub fn new() -> PositionBook
sourcepub fn with_buckets(self, x: Vec<PositionBookBucket>) -> Self
pub fn with_buckets(self, x: Vec<PositionBookBucket>) -> Self
The partitioned position 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 PositionBook
sourcepub fn with_instrument(self, x: String) -> Self
pub fn with_instrument(self, x: String) -> Self
The position book’s instrument format: A string containing the base currency and quote currency delimited by a “_”.
- param String
- return PositionBook
sourcepub fn with_price(self, x: f32) -> Self
pub fn with_price(self, x: f32) -> Self
The price (midpoint) for the position book’s instrument at the time of the position book snapshot format: A decimal number encodes as a string. The amount of precision provided depends on the Instrument.
- param f32
- return PositionBook
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 PositionBook
sourcepub fn with_time(self, x: DateTime<Utc>) -> Self
pub fn with_time(self, x: DateTime<Utc>) -> Self
The time when the position 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 PositionBook