ib_client/models/
history_data.rs

1/*
2 * Client Portal Web API
3 *
4 * Client Portal Web API
5 *
6 * The version of the OpenAPI document: 1.0.0
7 * 
8 * Generated by: https://openapi-generator.tech
9 */
10
11
12
13
14#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)]
15pub struct HistoryData {
16    /// Underlying Symbol of the corresponding contract
17    #[serde(rename = "symbol", skip_serializing_if = "Option::is_none")]
18    pub symbol: Option<String>,
19    /// companyName of the corresponding contract
20    #[serde(rename = "text", skip_serializing_if = "Option::is_none")]
21    pub text: Option<String>,
22    /// priceFactor is price increment obtained from display rule
23    #[serde(rename = "priceFactor", skip_serializing_if = "Option::is_none")]
24    pub price_factor: Option<i32>,
25    /// start date time in the format YYYYMMDD-HH:mm:ss
26    #[serde(rename = "startTime", skip_serializing_if = "Option::is_none")]
27    pub start_time: Option<String>,
28    /// High value during this time series with format %h/%v/%t. %h is the high price (scaled by priceFactor), %v is volume (volume factor will always be 100 (reported volume = actual volume/100)) and %t is minutes from start time of the chart 
29    #[serde(rename = "high", skip_serializing_if = "Option::is_none")]
30    pub high: Option<String>,
31    /// Low value during this time series with format %l/%v/%t. %l is the low price (scaled by priceFactor), %v is volume (volume factor will always be 100 (reported volume = actual volume/100)) and %t is minutes from start time of the chart 
32    #[serde(rename = "low", skip_serializing_if = "Option::is_none")]
33    pub low: Option<String>,
34    /// The duration for the historical data request
35    #[serde(rename = "timePeriod", skip_serializing_if = "Option::is_none")]
36    pub time_period: Option<String>,
37    /// The number of seconds in a bar
38    #[serde(rename = "barLength", skip_serializing_if = "Option::is_none")]
39    pub bar_length: Option<i32>,
40    /// Market Data Availability. The field may contain two chars. The first char is the primary code: S = Streaming, R = Realtime, D = Delayed, Z = Frozen, Y = Frozen Delayed. The second char is the secondary code: P = Snapshot Available, p = Consolidated. 
41    #[serde(rename = "mdAvailability", skip_serializing_if = "Option::is_none")]
42    pub md_availability: Option<String>,
43    /// The time it takes, in milliseconds, to process the historical data request
44    #[serde(rename = "mktDataDelay", skip_serializing_if = "Option::is_none")]
45    pub mkt_data_delay: Option<i32>,
46    /// The historical data returned includes outside of regular trading hours 
47    #[serde(rename = "outsideRth", skip_serializing_if = "Option::is_none")]
48    pub outside_rth: Option<bool>,
49    /// The number of seconds in the trading day
50    #[serde(rename = "tradingDayDuration", skip_serializing_if = "Option::is_none")]
51    pub trading_day_duration: Option<i32>,
52    #[serde(rename = "volumeFactor", skip_serializing_if = "Option::is_none")]
53    pub volume_factor: Option<i32>,
54    #[serde(rename = "priceDisplayRule", skip_serializing_if = "Option::is_none")]
55    pub price_display_rule: Option<i32>,
56    #[serde(rename = "priceDisplayValue", skip_serializing_if = "Option::is_none")]
57    pub price_display_value: Option<String>,
58    #[serde(rename = "negativeCapable", skip_serializing_if = "Option::is_none")]
59    pub negative_capable: Option<bool>,
60    #[serde(rename = "messageVersion", skip_serializing_if = "Option::is_none")]
61    pub message_version: Option<i32>,
62    #[serde(rename = "data", skip_serializing_if = "Option::is_none")]
63    pub data: Option<Vec<crate::models::HistoryDataData>>,
64    /// total number of points
65    #[serde(rename = "points", skip_serializing_if = "Option::is_none")]
66    pub points: Option<i32>,
67    #[serde(rename = "travelTime", skip_serializing_if = "Option::is_none")]
68    pub travel_time: Option<i32>,
69}
70
71impl HistoryData {
72    pub fn new() -> HistoryData {
73        HistoryData {
74            symbol: None,
75            text: None,
76            price_factor: None,
77            start_time: None,
78            high: None,
79            low: None,
80            time_period: None,
81            bar_length: None,
82            md_availability: None,
83            mkt_data_delay: None,
84            outside_rth: None,
85            trading_day_duration: None,
86            volume_factor: None,
87            price_display_rule: None,
88            price_display_value: None,
89            negative_capable: None,
90            message_version: None,
91            data: None,
92            points: None,
93            travel_time: None,
94        }
95    }
96}
97
98