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
use ;
use HashMap;
use cratestring_to_f64;
/// Represents kline/candlestick data for a trading pair on Binance.
///
/// Each `Klines` instance represents a single kline/candlestick.
/// Klines are often used in financial analysis and trading strategies.
/// [Kline/Candlestick Data](https://binance-docs.github.io/apidocs/spot/en/#kline-candlestick-data)
///
/// ## Fields
/// - `open_time`: The time that the kline/candlestick opened, represented as a Unix timestamp.
/// - `open_price`: The price at the opening of the kline/candlestick.
/// - `high_price`: The highest price reached during the period of the kline/candlestick.
/// - `low_price`: The lowest price reached during the period of the kline/candlestick.
/// - `close_price`:The price at the closing of the kline/candlestick.
/// - `volume`: The volume traded during the period of the kline/candlestick.
/// - `close_time`: The time that the kline/candlestick closed, represented as a Unix timestamp.
/// - `quote_asset_volume`: The volume of the quote asset traded.
/// - `number_of_trades`: The number of trades executed during the period of the kline/candlestick.
/// - `taker_buy_base_asset_volume`: The volume of the base asset bought by takers.
/// - `taker_buy_quote_asset_volume`: The volume of the quote asset bought by takers.
/// - `unused_field`: This field is currently unused.
///
/// # Examples
///
/// Deserialization example:
///
/// ```rust
/// use crate::oscillatorsetups::exchange::binance::models::Klines;
/// use serde_json::from_str;
///
/// let data = r#"
/// [
/// 1685668560000,
/// "1862.40000000",
/// "1862.40000000",
/// "1861.64000000",
/// "1861.74000000",
/// "1.66780000",
/// 1685668619999,
/// "3105.19194600",
/// 10,
/// "0.87900000",
/// "1636.72362600",
/// "0"
/// ]
/// "#;
/// let klines: Klines = from_str(data).unwrap();
/// ```
/// Represents the parameters needed to make a request to the Binance API
///
/// This struct includes the following fields:
/// * `base_url` : Exchange host name
/// * `endpoint` : The specific API path requesting data from, e.g. "/api/v3/klines".
/// * `params` : A HashMap containing additional request query parameters like "symbol", "interval", and "limit".
///
/// # Examples
///
/// ```rust
/// use crate::oscillatorsetups::exchange::binance::models::ApiParams;
/// use std::collections::HashMap;
///
/// let api_params = ApiParams {
/// base_url : "https://api.binance.us", // use Binance US API
/// endpoint : "/api/v3/klines",
/// params : &HashMap::from([
/// ("interval", "15m"),
/// ("limit", "10"),
/// ("symbol", "ETHUSD")
/// ]),
/// };
/// ```