oanda_v20_openapi/models/candlestick_data.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/// CandlestickData : The price data (open, high, low, close) for the Candlestick representation.
15#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)]
16pub struct CandlestickData {
17 /// The first (open) price in the time-range represented by the candlestick.
18 #[serde(rename = "o", skip_serializing_if = "Option::is_none")]
19 pub o: Option<String>,
20 /// The highest price in the time-range represented by the candlestick.
21 #[serde(rename = "h", skip_serializing_if = "Option::is_none")]
22 pub h: Option<String>,
23 /// The lowest price in the time-range represented by the candlestick.
24 #[serde(rename = "l", skip_serializing_if = "Option::is_none")]
25 pub l: Option<String>,
26 /// The last (closing) price in the time-range represented by the candlestick.
27 #[serde(rename = "c", skip_serializing_if = "Option::is_none")]
28 pub c: Option<String>,
29}
30
31impl CandlestickData {
32 /// The price data (open, high, low, close) for the Candlestick representation.
33 pub fn new() -> CandlestickData {
34 CandlestickData {
35 o: None,
36 h: None,
37 l: None,
38 c: None,
39 }
40 }
41}
42