1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
use serde::Serialize;
#[derive(Debug, Default, Serialize)]
pub struct QuotesParam {
/**
* Comma separated list of symbol(s) to look up a quote
*
* Example : MRAD,EATOF,EBIZ,AAPL,BAC,AAAHX,AAAIX,$DJI,$SPX,MVEN,SOBS,TOITF,CNSWF,AMZN 230317C01360000,DJX 231215C00290000,/ESH23,./ADUF23C0.55,AUD/CAD
*/
pub symbols: String,
/**
* Request for subset of data by passing coma separated list of root nodes,
* possible root nodes are quote, fundamental, extended, reference, regular.
* Default value : all
*/
pub fields: Option<String>,
/**
* Include indicative symbol quotes for all ETF symbols in request.
* If ETF symbol ABC is in request and indicative=true API will return quotes for ABC and its corresponding indicative quote for $ABC.IV
*/
pub indicative: Option<bool>,
}
#[derive(Debug, Default, Serialize)]
#[serde(rename_all = "camelCase")]
pub struct OptionChainParam {
pub symbol: String,
/**
* Contract Type
* Available values : CALL, PUT, ALL
*/
pub contract_type: Option<String>,
/**
* The Number of strikes to return above or below the at-the-money price
*/
pub strike_count: Option<i32>,
/**
* Underlying quotes to be included
*/
pub include_underlying_quote: Option<bool>,
/**
* OptionChain strategy. Default is SINGLE. ANALYTICAL allows the use of volatility, underlyingPrice, interestRate, and daysToExpiration params to calculate theoretical values.
* Available values : SINGLE, ANALYTICAL, COVERED, VERTICAL, CALENDAR, STRANGLE, STRADDLE, BUTTERFLY, CONDOR, DIAGONAL, COLLAR, ROLL
*/
pub strategy: Option<String>,
/**
* Strike interval for spread strategy chains (see strategy param)
*/
pub interval: Option<f64>,
/**
* Strike Price
*/
pub strike: Option<f64>,
/**
* Range(ITM/NTM/OTM etc.)
*/
pub range: Option<String>,
/**
* From date(pattern: yyyy-MM-dd)
*/
pub from_date: Option<String>,
/**
* To date (pattern: yyyy-MM-dd)
*/
pub to_date: Option<String>,
/**
* Volatility to use in calculations. Applies only to ANALYTICAL strategy chains (see strategy param)
*/
pub volatility: Option<f64>,
/**
* Underlying price to use in calculations. Applies only to ANALYTICAL strategy chains (see strategy param)
*/
pub underlying_price: Option<f64>,
/**
* Interest rate to use in calculations. Applies only to ANALYTICAL strategy chains (see strategy param)
*/
pub interest_rate: Option<f64>,
/**
* Days to expiration to use in calculations. Applies only to ANALYTICAL strategy chains (see strategy param)
*/
pub days_to_expiration: Option<i32>,
/**
* Expiration month
* Available values : JAN, FEB, MAR, APR, MAY, JUN, JUL, AUG, SEP, OCT, NOV, DEC, ALL
*/
pub exp_month: Option<String>,
/**
* Option Type
*/
pub option_type: Option<String>,
/**
* Applicable only if its retail token, entitlement of client PP-PayingPro, NP-NonPro and PN-NonPayingPro
* Available values : PN, NP, PP
*/
pub entitlement: Option<String>
}
#[derive(Debug, Default, Serialize)]
#[serde(rename_all = "camelCase")]
pub struct PriceHistoryParam {
pub symbol: String,
/**
* The chart period being requested.
*
* Available values : day, month, year, ytd
*/
pub period_type: Option<String>,
/**
* The number of chart period types.
*
* day - valid values are 1, 2, 3, 4, 5, 10. default period is 10.
* month - valid values are 1, 2, 3, 6. default period is 1.
* year - valid values are 1, 2, 3, 5, 10, 15, 20. default period is 1.
* ytd - valid values are 1. default period is 1.
*/
pub period: Option<i32>,
/**
* The time frequencyType
*
* day - valid value is minute. defaulted to minute.
* month - valid values are daily, weekly. defaulted to weekly.
* year - valid values are daily, weekly, monthly. defaulted to monthly.
* ytd - valid values are daily, weekly. defaulted to weekly.
*/
pub frequency_type: Option<String>,
/**
* The time frequency duration
*
* minute - valid values are 1, 5, 10, 15, 30. default value is 1
* daily - valid value is 1
* weekly - valid value is 1
* monthly - valid value is 1
*/
pub frequency: Option<i32>,
/**
* The start date, Time in milliseconds since the UNIX epoch eg 1451624400000
* If not specified startDate will be (endDate - period) excluding weekends and holidays.
*/
pub start_date: Option<i64>,
/**
* The end date, Time in milliseconds since the UNIX epoch eg 1451624400000
* If not specified, the endDate will default to the market close of previous business day.
*/
pub end_date: Option<i64>,
/**
* Need extended hours data
*/
pub need_extended_hours_data: Option<bool>,
/**
* Need previous close price/date
*/
pub need_previous_close: Option<bool>,
}
#[derive(Debug, Default, Serialize)]
pub struct MoversParam {
#[serde(skip_serializing)]
pub symbol_id: String,
/**
* Sort by a particular attribute
*
* Available values : VOLUME, TRADES, PERCENT_CHANGE_UP, PERCENT_CHANGE_DOWN
*/
pub sort: Option<String>,
/**
* To return movers with the specified directions of up or down
*
* Available values : 0, 1, 5, 10, 30, 60
* Default value : 0
*/
pub frequency: Option<i32>
}
#[derive(Debug, Serialize)]
pub struct InstrumentsParam {
/**
* symbol of a security
*/
pub symbol: String,
/**
* search by
*
* Available values : symbol-search, symbol-regex, desc-search, desc-regex, search, fundamental
*/
pub projection: String,
}