Skip to main content

oanda_v20_openapi/models/
candlestick.rs

1/*
2 * OANDA v20 API
3 *
4 * The full OANDA v20 API Specification. This specification defines how to interact with v20 Accounts, Trades, Orders, Pricing and more.
5 *
6 * The version of the OpenAPI document: 0.2.1
7 * Contact: jmicoud02@gmail.com
8 * Generated by: https://openapi-generator.tech
9 */
10
11use crate::models;
12use serde::{Deserialize, Serialize};
13
14/// Candlestick : The Candlestick representation
15#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)]
16pub struct Candlestick {
17    /// A date and time value using either RFC3339 or UNIX time representation. 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).
18    #[serde(rename = "time", skip_serializing_if = "Option::is_none")]
19    pub time: Option<String>,
20    #[serde(rename = "bid", skip_serializing_if = "Option::is_none")]
21    pub bid: Option<Box<models::CandlestickData>>,
22    #[serde(rename = "ask", skip_serializing_if = "Option::is_none")]
23    pub ask: Option<Box<models::CandlestickData>>,
24    #[serde(rename = "mid", skip_serializing_if = "Option::is_none")]
25    pub mid: Option<Box<models::CandlestickData>>,
26    /// The number of prices created during the time-range represented by the candlestick.
27    #[serde(rename = "volume", skip_serializing_if = "Option::is_none")]
28    pub volume: Option<i32>,
29    /// A flag indicating if the candlestick is complete. A complete candlestick is one whose ending time is not in the future.
30    #[serde(rename = "complete", skip_serializing_if = "Option::is_none")]
31    pub complete: Option<bool>,
32}
33
34impl Candlestick {
35    /// The Candlestick representation
36    pub fn new() -> Candlestick {
37        Candlestick {
38            time: None,
39            bid: None,
40            ask: None,
41            mid: None,
42            volume: None,
43            complete: None,
44        }
45    }
46}
47