├── .gitignore ├── .travis.yml ├── Cargo.toml ├── LICENSE ├── README.md ├── pretty.sh ├── rustfmt.toml ├── src ├── charts │ ├── candlestick.rs │ ├── mod.rs │ └── utils.rs ├── indicators │ ├── ema.rs │ ├── ichimoku.rs │ ├── mod.rs │ ├── sma.rs │ └── wma.rs └── lib.rs └── tests ├── charts ├── candlestick.rs └── mod.rs ├── data.json ├── indicators ├── mod.rs └── sma.rs └── tests.rs /.gitignore: -------------------------------------------------------------------------------- 1 | # Generated by Cargo 2 | # will have compiled files and executables 3 | /target/ 4 | 5 | # Remove Cargo.lock from gitignore if creating an executable, leave it for libraries 6 | # More information here http://doc.crates.io/guide.html#cargotoml-vs-cargolock 7 | Cargo.lock 8 | 9 | # These are backup files generated by rustfmt 10 | **/*.rs.bk 11 | -------------------------------------------------------------------------------- /.travis.yml: -------------------------------------------------------------------------------- 1 | language: rust 2 | rust: 3 | - stable 4 | - beta 5 | - nightly 6 | -------------------------------------------------------------------------------- /Cargo.toml: -------------------------------------------------------------------------------- 1 | [package] 2 | name = "technical_indicators" 3 | version = "0.5.0" 4 | authors = ["Alberto Leal "] 5 | description = "Library of technical indicators in Rust." 6 | license = "MIT" 7 | documentation = "https://docs.rs/technical_indicators" 8 | repository = "https://github.com/dashed/technical_indicators" 9 | keywords = ["technical-analysis", "trading", "charts", "candlestick", "investing"] 10 | 11 | 12 | [dev-dependencies] 13 | json = "0.11.12" 14 | lazy_static = "1.0" 15 | assert_approx_eq = "1" 16 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) 2017 Alberto Leal (github.com/dashed) 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | technical_indicators [![Build Status](https://travis-ci.org/dashed/technical_indicators.svg)](https://travis-ci.org/dashed/technical_indicators) [![crate version](https://img.shields.io/crates/v/technical_indicators.svg?style=flat)](https://crates.io/crates/technical_indicators) [![docs.rs](https://docs.rs/technical_indicators/badge.svg)](https://docs.rs/technical_indicators) 2 | ==================== 3 | 4 | > Library of technical indicators in Rust. 5 | 6 | ## What? 7 | 8 | A technical indicator is a tool that attempts to forecast a technical analysis feature (e.g. support / resistance) based on given data such as historical price and volume. 9 | 10 | Typically, a trader or an investor would use technical indicators against an asset (e.g. stocks), and then perform technical analysis to formulate a trading (or investing) decision. 11 | 12 | See: https://en.wikipedia.org/wiki/Technical_indicator 13 | 14 | ## Install 15 | 16 | Add to your `Cargo.toml`: 17 | 18 | ```toml 19 | [dependencies] 20 | technical_indicators = "0.5.0" 21 | ``` 22 | 23 | Next, add this to your crate: 24 | 25 | ```rust 26 | extern crate technical_indicators; 27 | ``` 28 | 29 | ## Usage 30 | 31 | *TBA.* 32 | 33 | Indicators 34 | ========== 35 | 36 | Implemented indicators. 37 | 38 | ## Simple Moving Average 39 | 40 | Read more: https://en.wikipedia.org/wiki/Moving_average#Simple_moving_average 41 | 42 | ## Exponential Moving Average 43 | 44 | Read more: https://en.wikipedia.org/wiki/Moving_average#Exponential_moving_average 45 | 46 | ## Ichimoku Kinkō Hyō 47 | 48 | Read more: https://en.wikipedia.org/wiki/Ichimoku_Kink%C5%8D_Hy%C5%8D 49 | 50 | Chores 51 | ====== 52 | 53 | - `./pretty.sh`: Run [`rustfmt`](https://github.com/rust-lang-nursery/rustfmt) 54 | - `cargo test`: Run tests. 55 | - `cargo check`: Quick compile check. 56 | 57 | Credits 58 | ======= 59 | 60 | Thanks to [Cryptowatch API](https://cryptowat.ch/docs/api#ohlc) for the bitcoin trading data of the GDAX (Coinbase) exchange. 61 | 62 | URL used to access the trading data: `https://api.cryptowat.ch/markets/gdax/btcusd/ohlc?periods=14400` (4 hour candles) 63 | 64 | License 65 | ======= 66 | 67 | MIT. 68 | -------------------------------------------------------------------------------- /pretty.sh: -------------------------------------------------------------------------------- 1 | #/usr/bin/env bash 2 | cargo fmt -- ./tests/**/*.rs 3 | -------------------------------------------------------------------------------- /rustfmt.toml: -------------------------------------------------------------------------------- 1 | normalize_comments = false 2 | write_mode = "overwrite" 3 | -------------------------------------------------------------------------------- /src/charts/candlestick.rs: -------------------------------------------------------------------------------- 1 | use charts::{Chart, DataPoint}; 2 | use std::collections::VecDeque; 3 | 4 | // candlestick chart 5 | // Ref: https://en.wikipedia.org/wiki/Open-high-low-close_chart 6 | 7 | pub struct CandleStick { 8 | candles: VecDeque, 9 | } 10 | 11 | impl CandleStick { 12 | pub fn new() -> Self { 13 | CandleStick { 14 | candles: VecDeque::new(), 15 | } 16 | } 17 | } 18 | 19 | impl Chart for CandleStick { 20 | fn as_chart(&self) -> &Chart { 21 | self 22 | } 23 | 24 | fn get(&self, index: usize) -> Option<&DataPoint> { 25 | let len = self.candles.len(); 26 | 27 | if len <= 0 { 28 | return None; 29 | } 30 | 31 | if index >= len { 32 | return None; 33 | } 34 | 35 | let len_index = len - 1; 36 | let normalized_index = len_index - index; 37 | 38 | self.candles.get(normalized_index) 39 | } 40 | 41 | fn push(&mut self, data_point: &DataPoint) { 42 | self.candles.push_back(data_point.clone()); 43 | } 44 | 45 | fn pop_front(&mut self) { 46 | self.candles.pop_front(); 47 | } 48 | 49 | fn len(&self) -> usize { 50 | self.candles.len() 51 | } 52 | } 53 | -------------------------------------------------------------------------------- /src/charts/mod.rs: -------------------------------------------------------------------------------- 1 | #[derive(Clone)] 2 | pub enum Source { 3 | Open, 4 | High, 5 | Low, 6 | Close, 7 | Volume, 8 | } 9 | 10 | impl AsRef for Source { 11 | fn as_ref(&self) -> &Source { 12 | self 13 | } 14 | } 15 | 16 | #[derive(Clone, Debug, PartialEq)] 17 | pub struct DataPoint { 18 | pub open: f64, 19 | pub high: f64, 20 | pub low: f64, 21 | pub close: f64, 22 | pub volume: f64, 23 | } 24 | 25 | impl DataPoint { 26 | pub fn get>(&self, source_type: T) -> f64 { 27 | match *source_type.as_ref() { 28 | Source::Open => self.open, 29 | Source::High => self.high, 30 | Source::Low => self.low, 31 | Source::Close => self.close, 32 | Source::Volume => self.volume, 33 | } 34 | } 35 | } 36 | 37 | #[derive(Clone)] 38 | pub struct SourceSeries<'chart> { 39 | chart: &'chart Chart, 40 | series_type: Source, 41 | offset: usize, 42 | } 43 | 44 | impl<'chart> SourceSeries<'chart> { 45 | pub fn new(chart: &'chart Chart, series_type: Source) -> Self { 46 | SourceSeries { 47 | chart: chart, 48 | series_type: series_type, 49 | offset: 0, 50 | } 51 | } 52 | 53 | /// Generate new `SourceSeries` by offsetting by `length` data points. 54 | pub fn offset(&self, length: usize) -> Self { 55 | SourceSeries { 56 | chart: self.chart.clone(), 57 | series_type: self.series_type.clone(), 58 | offset: length, 59 | } 60 | } 61 | 62 | /// Get the value of this `SourceSeries` at `index`. 63 | /// If there is `self.offset`, it is added to `index`. 64 | pub fn get(&self, index: usize) -> Option { 65 | match self.chart.get(index + self.offset) { 66 | None => None, 67 | Some(data_point) => Some(data_point.get(&self.series_type)), 68 | } 69 | } 70 | 71 | pub fn len(&self) -> usize { 72 | self.chart.len() 73 | } 74 | } 75 | 76 | pub trait Chart { 77 | fn as_chart(&self) -> &Chart; 78 | 79 | /// Get value of this `Chart` at `index`. 80 | fn get(&self, index: usize) -> Option<&DataPoint>; 81 | 82 | /// Get number of data points in this chart. 83 | fn len(&self) -> usize; 84 | 85 | /// Add newest data point to the chart. 86 | fn push(&mut self, data_point: &DataPoint); 87 | 88 | /// Remove oldest data point from the chart. 89 | fn pop_front(&mut self); 90 | 91 | fn open<'chart>(&'chart self) -> SourceSeries { 92 | let chart: &'chart Chart = self.as_chart(); 93 | SourceSeries::new(chart, Source::Open) 94 | } 95 | 96 | fn high<'chart>(&'chart self) -> SourceSeries { 97 | let chart: &'chart Chart = self.as_chart(); 98 | SourceSeries::new(chart, Source::High) 99 | } 100 | 101 | fn low<'chart>(&'chart self) -> SourceSeries { 102 | let chart: &'chart Chart = self.as_chart(); 103 | SourceSeries::new(chart, Source::Low) 104 | } 105 | 106 | fn close<'chart>(&'chart self) -> SourceSeries { 107 | let chart: &'chart Chart = self.as_chart(); 108 | SourceSeries::new(chart, Source::Close) 109 | } 110 | 111 | fn volume<'chart>(&'chart self) -> SourceSeries { 112 | let chart: &'chart Chart = self.as_chart(); 113 | SourceSeries::new(chart, Source::Volume) 114 | } 115 | } 116 | 117 | pub mod utils; 118 | 119 | // types of charts 120 | 121 | pub mod candlestick; 122 | -------------------------------------------------------------------------------- /src/charts/utils.rs: -------------------------------------------------------------------------------- 1 | // local imports 2 | 3 | use charts::SourceSeries; 4 | 5 | /// Utility functions. 6 | 7 | /// Get lowest value among `length` data points in given `source`. 8 | pub fn lowest(source: SourceSeries, length: usize) -> Option { 9 | if length <= 0 { 10 | return None; 11 | } 12 | 13 | let lowest = source.get(0); 14 | 15 | if lowest.is_none() { 16 | return None; 17 | } 18 | 19 | let mut lowest = source.get(0).unwrap(); 20 | 21 | for index in 1..(length) { 22 | match source.get(index) { 23 | None => {} 24 | Some(maybe_lowest) => if maybe_lowest < lowest { 25 | lowest = maybe_lowest; 26 | }, 27 | } 28 | } 29 | 30 | Some(lowest) 31 | } 32 | 33 | /// Get highest value among `length` data points in given `source`. 34 | pub fn highest(source: SourceSeries, length: usize) -> Option { 35 | if length <= 0 { 36 | return None; 37 | } 38 | 39 | let highest = source.get(0); 40 | 41 | if highest.is_none() { 42 | return None; 43 | } 44 | 45 | let mut highest = highest.unwrap(); 46 | 47 | for index in 1..(length) { 48 | match source.get(index) { 49 | None => {} 50 | Some(maybe_highest) => if maybe_highest > highest { 51 | highest = maybe_highest; 52 | }, 53 | } 54 | } 55 | 56 | Some(highest) 57 | } 58 | -------------------------------------------------------------------------------- /src/indicators/ema.rs: -------------------------------------------------------------------------------- 1 | use charts::SourceSeries; 2 | use indicators::sma::SimpleMovingAverage; 3 | 4 | // Exponential Moving Average (EMA) 5 | 6 | pub struct ExponentialMovingAverage<'source> { 7 | source: SourceSeries<'source>, 8 | 9 | // 2 / (length + 1) 10 | alpha: f64, 11 | 12 | // params 13 | length: usize, 14 | } 15 | 16 | impl<'source> ExponentialMovingAverage<'source> { 17 | pub fn new(source: SourceSeries<'source>, length: usize) -> Self { 18 | let alpha = 2.0 / ((length as f64) + 1.0); 19 | 20 | ExponentialMovingAverage { 21 | source: source, 22 | alpha: alpha, 23 | length: length, 24 | } 25 | } 26 | 27 | pub fn get(&self, index: usize) -> Option { 28 | // EMA = alpha * data + (1 - alpha) * EMA[1], where alpha = 2 / (length + 1) 29 | 30 | let last_index: i64 = (self.source.len() as i64) - 1; 31 | if last_index < 0 { 32 | return None; 33 | } 34 | 35 | // ensure the number of data points between index and last_index is at 36 | // least self.length 37 | let num_of_data_points_between_current_and_last = last_index - (index as i64) + 1; 38 | if num_of_data_points_between_current_and_last < (self.length as i64) { 39 | return None; 40 | } 41 | 42 | if num_of_data_points_between_current_and_last == (self.length as i64) { 43 | // set the first EMA point to be the SMA of the last self.length 44 | // data points 45 | 46 | let sma = SimpleMovingAverage::new(self.source.clone(), self.length); 47 | return sma.get(index); 48 | } 49 | 50 | let current_value = match self.source.get(index) { 51 | None => { 52 | return None; 53 | } 54 | Some(current_value) => current_value, 55 | }; 56 | 57 | let prev_value = match self.get(index + 1) { 58 | None => 0.0, 59 | Some(prev_value) => prev_value, 60 | }; 61 | 62 | let ema_value = self.alpha * current_value + (1.0 - self.alpha) * prev_value; 63 | 64 | Some(ema_value) 65 | } 66 | } 67 | -------------------------------------------------------------------------------- /src/indicators/ichimoku.rs: -------------------------------------------------------------------------------- 1 | // local imports 2 | 3 | use charts::Chart; 4 | use charts::utils::{highest, lowest}; 5 | 6 | // Ichimoku Kinkō Hyō 7 | 8 | pub struct Ichimoku<'chart> { 9 | chart: &'chart Chart, 10 | 11 | // params 12 | turning_line_period: usize, 13 | standard_line_period: usize, 14 | span_b_period: usize, 15 | lagging_span_displacement: usize, 16 | } 17 | 18 | impl<'chart> Ichimoku<'chart> { 19 | pub fn new( 20 | chart: &'chart Chart, 21 | 22 | // params 23 | turning_line_period: usize, 24 | standard_line_period: usize, 25 | span_b_period: usize, 26 | lagging_span_displacement: usize, 27 | ) -> Self { 28 | Ichimoku { 29 | chart: chart, 30 | 31 | // params 32 | turning_line_period: turning_line_period, 33 | standard_line_period: standard_line_period, 34 | span_b_period: span_b_period, 35 | lagging_span_displacement: lagging_span_displacement, 36 | } 37 | } 38 | 39 | /// Return Ichimoku chart with default settings. 40 | pub fn default(chart: &'chart Chart) -> Self { 41 | // reference: 42 | // http://www.ichimokutrader.com/elements.html 43 | // http://stockcharts.com/school/doku.php?id=chart_school:technical_indicators:ichimoku_cloud 44 | 45 | Ichimoku { 46 | chart: chart, 47 | 48 | // default params 49 | turning_line_period: 9, 50 | standard_line_period: 26, 51 | span_b_period: 52, 52 | lagging_span_displacement: 26, 53 | } 54 | } 55 | 56 | /// A moving average of the highest high and lowest low over the last 57 | /// `turning_line_period` data points. 58 | pub fn turning_line(&self, index: usize) -> Option { 59 | // aka Tenkan-sen, or conversion-line 60 | 61 | let lowest_val = match lowest(self.chart.low().offset(index), self.turning_line_period) { 62 | None => { 63 | return None; 64 | } 65 | Some(lowest_val) => lowest_val, 66 | }; 67 | 68 | let highest_val = match highest(self.chart.high().offset(index), self.turning_line_period) { 69 | None => { 70 | return None; 71 | } 72 | Some(highest_val) => highest_val, 73 | }; 74 | 75 | // get the average 76 | 77 | let result = (lowest_val + highest_val) / 2.0; 78 | 79 | Some(result) 80 | } 81 | 82 | /// A moving average of the highest high and lowest low over the last 83 | /// `standard_line_period` data points. 84 | pub fn standard_line(&self, index: usize) -> Option { 85 | // aka Kijun-sen or base-line 86 | 87 | let lowest_val = match lowest(self.chart.low().offset(index), self.standard_line_period) { 88 | None => { 89 | return None; 90 | } 91 | Some(lowest_val) => lowest_val, 92 | }; 93 | 94 | let highest_val = match highest(self.chart.high().offset(index), self.standard_line_period) 95 | { 96 | None => { 97 | return None; 98 | } 99 | Some(highest_val) => highest_val, 100 | }; 101 | 102 | let result = (lowest_val + highest_val) / 2.0; 103 | 104 | Some(result) 105 | } 106 | 107 | /// The average of the turning line (i.e Tenkan Sen) and 108 | /// standard line (i.e. Kijun Sen), plotted `lagging_span_displacement` 109 | /// data points ahead. 110 | pub fn span_a(&self, index: i64) -> Option { 111 | // Senkou Span A (Leading Span A) 112 | 113 | // Span A plotted at `index` relies on data that is self.lagging_span_displacement 114 | // data points behind. 115 | 116 | let normalized_index = index + (self.lagging_span_displacement as i64); 117 | 118 | if normalized_index < 0 { 119 | return None; 120 | } 121 | 122 | let normalized_index = normalized_index as usize; 123 | 124 | let turning_line_val = match self.turning_line(normalized_index) { 125 | None => { 126 | return None; 127 | } 128 | Some(x) => x, 129 | }; 130 | 131 | let standard_line_val = match self.standard_line(normalized_index) { 132 | None => { 133 | return None; 134 | } 135 | Some(x) => x, 136 | }; 137 | 138 | // get the average 139 | 140 | let result = (turning_line_val + standard_line_val) / 2.0; 141 | 142 | Some(result) 143 | } 144 | 145 | /// The average of the highest high and lowest low over the last `span_b_period` 146 | /// data points, plotted `lagging_span_displacement` data points ahead. 147 | pub fn span_b(&self, index: i64) -> Option { 148 | // Senkou Span B (Leading Span B) 149 | 150 | // Span B plotted at `index` relies on data that is self.lagging_span_displacement 151 | // data points behind. 152 | 153 | let normalized_index = index + (self.lagging_span_displacement as i64); 154 | 155 | if normalized_index < 0 { 156 | return None; 157 | } 158 | 159 | let normalized_index = normalized_index as usize; 160 | 161 | let lowest_val = match lowest( 162 | self.chart.low().offset(normalized_index), 163 | self.span_b_period, 164 | ) { 165 | None => { 166 | return None; 167 | } 168 | Some(lowest_val) => lowest_val, 169 | }; 170 | 171 | let highest_val = match highest( 172 | self.chart.high().offset(normalized_index), 173 | self.span_b_period, 174 | ) { 175 | None => { 176 | return None; 177 | } 178 | Some(highest_val) => highest_val, 179 | }; 180 | 181 | // get the average 182 | 183 | let result = (lowest_val + highest_val) / 2.0; 184 | 185 | Some(result) 186 | } 187 | 188 | /// The closing price plotted `lagging_span_displacement` data points behind. 189 | pub fn lagging_line(&self, index: i64) -> Option { 190 | // The ladding line plotted at `index` relies on data that is self.lagging_span_displacement 191 | // data points ahead. 192 | 193 | let normalized_index = index - (self.lagging_span_displacement as i64); 194 | 195 | if normalized_index < 0 { 196 | return None; 197 | } 198 | 199 | let normalized_index = normalized_index as usize; 200 | 201 | self.chart.close().get(normalized_index) 202 | } 203 | } 204 | -------------------------------------------------------------------------------- /src/indicators/mod.rs: -------------------------------------------------------------------------------- 1 | mod sma; 2 | pub use self::sma::SimpleMovingAverage; 3 | 4 | mod ema; 5 | pub use self::ema::ExponentialMovingAverage; 6 | 7 | mod wma; 8 | pub use self::wma::WeightedMovingAverage; 9 | 10 | mod ichimoku; 11 | pub use self::ichimoku::Ichimoku; 12 | -------------------------------------------------------------------------------- /src/indicators/sma.rs: -------------------------------------------------------------------------------- 1 | use charts::SourceSeries; 2 | 3 | // Simple Moving Average (SMA) 4 | 5 | pub struct SimpleMovingAverage<'source> { 6 | source: SourceSeries<'source>, 7 | 8 | // params 9 | period_length: usize, 10 | } 11 | 12 | impl<'source> SimpleMovingAverage<'source> { 13 | pub fn new(source: SourceSeries<'source>, length: usize) -> Self { 14 | SimpleMovingAverage { 15 | source: source, 16 | period_length: length, 17 | } 18 | } 19 | 20 | pub fn get(&self, index: usize) -> Option { 21 | let mut total = 0.0; 22 | 23 | for get_index in index..(index + self.period_length) { 24 | match self.source.get(get_index) { 25 | None => { 26 | return None; 27 | } 28 | Some(data) => { 29 | total += data; 30 | } 31 | } 32 | } 33 | 34 | Some(total / (self.period_length as f64)) 35 | } 36 | } 37 | -------------------------------------------------------------------------------- /src/indicators/wma.rs: -------------------------------------------------------------------------------- 1 | use charts::SourceSeries; 2 | 3 | // Weighted Moving Average (WMA) 4 | 5 | pub struct WeightedMovingAverage<'source> { 6 | source: SourceSeries<'source>, 7 | 8 | // params 9 | length: usize, 10 | } 11 | 12 | impl<'source> WeightedMovingAverage<'source> { 13 | pub fn new(source: SourceSeries<'source>, length: usize) -> Self { 14 | WeightedMovingAverage { 15 | source: source, 16 | length: length, 17 | } 18 | } 19 | 20 | pub fn get(&self, index: usize) -> Option { 21 | 22 | if self.length <= 0 { 23 | return None; 24 | } 25 | 26 | let offset_source = self.source.offset(index); 27 | 28 | let mut norm = 0.0; 29 | let mut total = 0.0; 30 | 31 | for normalized_index in 0..self.length { 32 | match offset_source.get(normalized_index) { 33 | None => { 34 | return None; 35 | } 36 | Some(data) => { 37 | let weight = (self.length - normalized_index) * self.length; 38 | let weight = weight as f64; 39 | norm = norm + weight; 40 | total = total + data * weight; 41 | } 42 | } 43 | } 44 | 45 | Some(total / norm) 46 | } 47 | } 48 | -------------------------------------------------------------------------------- /src/lib.rs: -------------------------------------------------------------------------------- 1 | pub mod charts; 2 | pub mod indicators; 3 | -------------------------------------------------------------------------------- /tests/charts/candlestick.rs: -------------------------------------------------------------------------------- 1 | // local imports 2 | 3 | use technical_indicators::charts::Chart; 4 | use technical_indicators::charts::candlestick::CandleStick; 5 | 6 | use TRADING_DATA; 7 | 8 | // tests 9 | 10 | #[test] 11 | fn push_get_data_points() { 12 | let mut candlestick: CandleStick = CandleStick::new(); 13 | 14 | match candlestick.get(0) { 15 | Some(_) => unreachable!(), 16 | None => {} 17 | }; 18 | 19 | for data in TRADING_DATA.iter() { 20 | candlestick.push(data); 21 | } 22 | 23 | for index in 0..TRADING_DATA.len() { 24 | match candlestick.get(index) { 25 | Some(data_point) => { 26 | let arr_index = TRADING_DATA.len() - 1 - index; 27 | assert_eq!(*data_point, TRADING_DATA[arr_index]); 28 | } 29 | None => unreachable!(), 30 | }; 31 | } 32 | 33 | match candlestick.get(TRADING_DATA.len()) { 34 | Some(_) => unreachable!(), 35 | None => {} 36 | } 37 | } 38 | -------------------------------------------------------------------------------- /tests/charts/mod.rs: -------------------------------------------------------------------------------- 1 | pub mod candlestick; 2 | -------------------------------------------------------------------------------- /tests/data.json: -------------------------------------------------------------------------------- 1 | { 2 | "result": { 3 | "14400": [ 4 | [ 5 | 1498780800, 6 | 2571.5, 7 | 2572.98, 8 | 2525.77, 9 | 2530, 10 | 1370.9825 11 | ], 12 | [ 13 | 1498795200, 14 | 2531.16, 15 | 2554.01, 16 | 2500, 17 | 2513.58, 18 | 1897.6097 19 | ], 20 | [ 21 | 1498809600, 22 | 2512.04, 23 | 2530.49, 24 | 2504, 25 | 2513.99, 26 | 987.4606 27 | ], 28 | [ 29 | 1498824000, 30 | 2513.98, 31 | 2549.69, 32 | 2512.15, 33 | 2540.01, 34 | 1054.6313 35 | ], 36 | [ 37 | 1498838400, 38 | 2540.01, 39 | 2542.25, 40 | 2472.61, 41 | 2511.16, 42 | 2057.8477 43 | ], 44 | [ 45 | 1498852800, 46 | 2511.16, 47 | 2529.6, 48 | 2478.06, 49 | 2499.24, 50 | 2029.7915 51 | ], 52 | [ 53 | 1498867200, 54 | 2499.14, 55 | 2503.66, 56 | 2446.2, 57 | 2455.19, 58 | 3827.8513 59 | ], 60 | [ 61 | 1498881600, 62 | 2455.19, 63 | 2469.33, 64 | 2428.03, 65 | 2436.11, 66 | 1488.2659 67 | ], 68 | [ 69 | 1498896000, 70 | 2436.11, 71 | 2509.29, 72 | 2430.8, 73 | 2506.99, 74 | 1512.6931 75 | ], 76 | [ 77 | 1498910400, 78 | 2506.68, 79 | 2515, 80 | 2475.03, 81 | 2509.17, 82 | 732.4834 83 | ], 84 | [ 85 | 1498924800, 86 | 2510, 87 | 2512.87, 88 | 2450, 89 | 2467.83, 90 | 1005.7055 91 | ], 92 | [ 93 | 1498939200, 94 | 2467.79, 95 | 2469.99, 96 | 2406.44, 97 | 2435.99, 98 | 1701.1327 99 | ], 100 | [ 101 | 1498953600, 102 | 2435.99, 103 | 2438.95, 104 | 2400, 105 | 2423.63, 106 | 2005.0464 107 | ], 108 | [ 109 | 1498968000, 110 | 2424.08, 111 | 2426, 112 | 2385, 113 | 2404.99, 114 | 1510.7845 115 | ], 116 | [ 117 | 1498982400, 118 | 2404.74, 119 | 2439.99, 120 | 2398.36, 121 | 2431.95, 122 | 936.54083 123 | ], 124 | [ 125 | 1498996800, 126 | 2431.99, 127 | 2461.99, 128 | 2427.76, 129 | 2449.6, 130 | 732.9912 131 | ], 132 | [ 133 | 1499011200, 134 | 2449.61, 135 | 2463.86, 136 | 2425.43, 137 | 2463, 138 | 985.62805 139 | ], 140 | [ 141 | 1499025600, 142 | 2462.74, 143 | 2526.72, 144 | 2462.17, 145 | 2492.61, 146 | 3098.2156 147 | ], 148 | [ 149 | 1499040000, 150 | 2492.79, 151 | 2545, 152 | 2488.01, 153 | 2516.66, 154 | 1819.3832 155 | ], 156 | [ 157 | 1499054400, 158 | 2515.37, 159 | 2519.9, 160 | 2487.04, 161 | 2490.83, 162 | 1688.059 163 | ], 164 | [ 165 | 1499068800, 166 | 2489.42, 167 | 2502, 168 | 2481.72, 169 | 2482.44, 170 | 1627.0966 171 | ], 172 | [ 173 | 1499083200, 174 | 2481.72, 175 | 2502.3, 176 | 2479.75, 177 | 2502.3, 178 | 912.3847 179 | ], 180 | [ 181 | 1499097600, 182 | 2502.3, 183 | 2584.78, 184 | 2502.05, 185 | 2569.98, 186 | 2581.924 187 | ], 188 | [ 189 | 1499112000, 190 | 2569.98, 191 | 2573.97, 192 | 2526.83, 193 | 2547.47, 194 | 1770.4672 195 | ], 196 | [ 197 | 1499126400, 198 | 2547.49, 199 | 2573.84, 200 | 2541.9, 201 | 2542.41, 202 | 1441.0585 203 | ], 204 | [ 205 | 1499140800, 206 | 2542.41, 207 | 2625, 208 | 2542.18, 209 | 2616.28, 210 | 2623.5442 211 | ], 212 | [ 213 | 1499155200, 214 | 2616.79, 215 | 2636.1, 216 | 2605.17, 217 | 2630.93, 218 | 1642.6313 219 | ], 220 | [ 221 | 1499169600, 222 | 2630.93, 223 | 2630.93, 224 | 2581.12, 225 | 2614.93, 226 | 963.55597 227 | ], 228 | [ 229 | 1499184000, 230 | 2614.93, 231 | 2626, 232 | 2577.88, 233 | 2587, 234 | 1747.9686 235 | ], 236 | [ 237 | 1499198400, 238 | 2583.85, 239 | 2595.89, 240 | 2560, 241 | 2566.51, 242 | 2108.0068 243 | ], 244 | [ 245 | 1499212800, 246 | 2567.88, 247 | 2611.45, 248 | 2563.02, 249 | 2602, 250 | 1569.841 251 | ], 252 | [ 253 | 1499227200, 254 | 2602, 255 | 2602.82, 256 | 2571.36, 257 | 2576.12, 258 | 1926.5687 259 | ], 260 | [ 261 | 1499241600, 262 | 2576.11, 263 | 2579, 264 | 2553.04, 265 | 2558.37, 266 | 1133.0255 267 | ], 268 | [ 269 | 1499256000, 270 | 2558.44, 271 | 2578.93, 272 | 2552.37, 273 | 2572.41, 274 | 844.58215 275 | ], 276 | [ 277 | 1499270400, 278 | 2572.41, 279 | 2576.99, 280 | 2551.06, 281 | 2573.91, 282 | 2405.6677 283 | ], 284 | [ 285 | 1499284800, 286 | 2573.9, 287 | 2624, 288 | 2570.71, 289 | 2623.79, 290 | 2214.889 291 | ], 292 | [ 293 | 1499299200, 294 | 2623.79, 295 | 2630.24, 296 | 2597.92, 297 | 2616.96, 298 | 1654.6016 299 | ], 300 | [ 301 | 1499313600, 302 | 2616.96, 303 | 2623.54, 304 | 2600.14, 305 | 2616.99, 306 | 1221.7396 307 | ], 308 | [ 309 | 1499328000, 310 | 2616.99, 311 | 2617, 312 | 2593.82, 313 | 2608.09, 314 | 947.81 315 | ], 316 | [ 317 | 1499342400, 318 | 2607.88, 319 | 2614.93, 320 | 2580.73, 321 | 2602.98, 322 | 1217.084 323 | ], 324 | [ 325 | 1499356800, 326 | 2602.98, 327 | 2607, 328 | 2580.77, 329 | 2583.95, 330 | 1726.7461 331 | ], 332 | [ 333 | 1499371200, 334 | 2583.94, 335 | 2600, 336 | 2580.69, 337 | 2600, 338 | 1546.6569 339 | ], 340 | [ 341 | 1499385600, 342 | 2600, 343 | 2608.98, 344 | 2590.76, 345 | 2604.84, 346 | 1546.4209 347 | ], 348 | [ 349 | 1499400000, 350 | 2604.89, 351 | 2607.61, 352 | 2589, 353 | 2597.31, 354 | 1828.8848 355 | ], 356 | [ 357 | 1499414400, 358 | 2597.32, 359 | 2599.42, 360 | 2568, 361 | 2575.71, 362 | 1393.0874 363 | ], 364 | [ 365 | 1499428800, 366 | 2575.72, 367 | 2586.62, 368 | 2556, 369 | 2556, 370 | 830.1582 371 | ], 372 | [ 373 | 1499443200, 374 | 2556.03, 375 | 2559.97, 376 | 2490.91, 377 | 2525.33, 378 | 2461.3616 379 | ], 380 | [ 381 | 1499457600, 382 | 2525.98, 383 | 2535.29, 384 | 2501.1, 385 | 2527.99, 386 | 2642.4092 387 | ], 388 | [ 389 | 1499472000, 390 | 2527.49, 391 | 2529.29, 392 | 2472, 393 | 2501.15, 394 | 2481.1245 395 | ], 396 | [ 397 | 1499486400, 398 | 2501.15, 399 | 2503.02, 400 | 2471.22, 401 | 2500, 402 | 1763.8671 403 | ], 404 | [ 405 | 1499500800, 406 | 2500, 407 | 2529.99, 408 | 2491.19, 409 | 2498.58, 410 | 1290.6307 411 | ], 412 | [ 413 | 1499515200, 414 | 2500.78, 415 | 2525.71, 416 | 2492.29, 417 | 2508.25, 418 | 563.5921 419 | ], 420 | [ 421 | 1499529600, 422 | 2509.65, 423 | 2537.33, 424 | 2509.07, 425 | 2526.18, 426 | 1761.0834 427 | ], 428 | [ 429 | 1499544000, 430 | 2527.43, 431 | 2549, 432 | 2506.41, 433 | 2541.86, 434 | 1050.655 435 | ], 436 | [ 437 | 1499558400, 438 | 2542.93, 439 | 2563.5, 440 | 2540.23, 441 | 2561.11, 442 | 1440.2737 443 | ], 444 | [ 445 | 1499572800, 446 | 2560.84, 447 | 2572.93, 448 | 2555.01, 449 | 2566.99, 450 | 1041.1605 451 | ], 452 | [ 453 | 1499587200, 454 | 2567, 455 | 2579.84, 456 | 2548.5, 457 | 2549.65, 458 | 795.7727 459 | ], 460 | [ 461 | 1499601600, 462 | 2549.65, 463 | 2559.46, 464 | 2548.5, 465 | 2553.34, 466 | 506.757 467 | ], 468 | [ 469 | 1499616000, 470 | 2552.6, 471 | 2567.43, 472 | 2524.17, 473 | 2561.8, 474 | 1026.725 475 | ], 476 | [ 477 | 1499630400, 478 | 2560.74, 479 | 2561.96, 480 | 2520.44, 481 | 2542.72, 482 | 1073.4314 483 | ], 484 | [ 485 | 1499644800, 486 | 2542.72, 487 | 2545.8, 488 | 2500, 489 | 2508.99, 490 | 1202.0089 491 | ], 492 | [ 493 | 1499659200, 494 | 2508, 495 | 2523, 496 | 2495.5, 497 | 2511.02, 498 | 964.0947 499 | ], 500 | [ 501 | 1499673600, 502 | 2511.02, 503 | 2520.99, 504 | 2499.3, 505 | 2515.91, 506 | 790.8697 507 | ], 508 | [ 509 | 1499688000, 510 | 2515.6, 511 | 2520.79, 512 | 2492.66, 513 | 2492.66, 514 | 764.0317 515 | ], 516 | [ 517 | 1499702400, 518 | 2492.66, 519 | 2501.07, 520 | 2369.71, 521 | 2383.14, 522 | 4029.488 523 | ], 524 | [ 525 | 1499716800, 526 | 2383.14, 527 | 2429.85, 528 | 2383.13, 529 | 2404.61, 530 | 2918.8005 531 | ], 532 | [ 533 | 1499731200, 534 | 2404.61, 535 | 2409.06, 536 | 2250, 537 | 2331.05, 538 | 5996.386 539 | ], 540 | [ 541 | 1499745600, 542 | 2330.93, 543 | 2381.04, 544 | 2318.65, 545 | 2331.18, 546 | 3484.6677 547 | ], 548 | [ 549 | 1499760000, 550 | 2333.4, 551 | 2352.14, 552 | 2265, 553 | 2345.59, 554 | 2875.5881 555 | ], 556 | [ 557 | 1499774400, 558 | 2345.59, 559 | 2374.99, 560 | 2322.34, 561 | 2360.1, 562 | 1540.5442 563 | ], 564 | [ 565 | 1499788800, 566 | 2361.23, 567 | 2410, 568 | 2335, 569 | 2365.7, 570 | 2922.073 571 | ], 572 | [ 573 | 1499803200, 574 | 2364.38, 575 | 2368.96, 576 | 2309, 577 | 2310.83, 578 | 2472.072 579 | ], 580 | [ 581 | 1499817600, 582 | 2310.92, 583 | 2356.73, 584 | 2300, 585 | 2310.01, 586 | 2367.4468 587 | ], 588 | [ 589 | 1499832000, 590 | 2310, 591 | 2310, 592 | 2250, 593 | 2261.42, 594 | 2752.6453 595 | ], 596 | [ 597 | 1499846400, 598 | 2261.29, 599 | 2322.03, 600 | 2258.25, 601 | 2309.27, 602 | 2123.0354 603 | ], 604 | [ 605 | 1499860800, 606 | 2309.26, 607 | 2365.49, 608 | 2297.03, 609 | 2353.23, 610 | 1583.4813 611 | ], 612 | [ 613 | 1499875200, 614 | 2353.22, 615 | 2380, 616 | 2340, 617 | 2370.03, 618 | 2021.4191 619 | ], 620 | [ 621 | 1499889600, 622 | 2370.03, 623 | 2415, 624 | 2367.05, 625 | 2397.69, 626 | 3073.146 627 | ], 628 | [ 629 | 1499904000, 630 | 2397.68, 631 | 2403.94, 632 | 2350.05, 633 | 2383.42, 634 | 2280.7869 635 | ], 636 | [ 637 | 1499918400, 638 | 2384.35, 639 | 2416.79, 640 | 2375.01, 641 | 2410, 642 | 1329.173 643 | ], 644 | [ 645 | 1499932800, 646 | 2410, 647 | 2410, 648 | 2371.04, 649 | 2371.04, 650 | 1512.1578 651 | ], 652 | [ 653 | 1499947200, 654 | 2371.04, 655 | 2385.76, 656 | 2362.5, 657 | 2385.76, 658 | 1092.3748 659 | ], 660 | [ 661 | 1499961600, 662 | 2385.76, 663 | 2389.95, 664 | 2320.52, 665 | 2330.98, 666 | 1948.7659 667 | ], 668 | [ 669 | 1499976000, 670 | 2330.98, 671 | 2341.39, 672 | 2308.14, 673 | 2335.22, 674 | 2202.561 675 | ], 676 | [ 677 | 1499990400, 678 | 2335.87, 679 | 2351.15, 680 | 2320.95, 681 | 2340, 682 | 1444.5264 683 | ], 684 | [ 685 | 1500004800, 686 | 2340, 687 | 2349.03, 688 | 2301, 689 | 2308.5, 690 | 1563.1309 691 | ], 692 | [ 693 | 1500019200, 694 | 2308.5, 695 | 2349.28, 696 | 2308.49, 697 | 2340, 698 | 1154.646 699 | ], 700 | [ 701 | 1500033600, 702 | 2340, 703 | 2342.79, 704 | 2327.01, 705 | 2328.09, 706 | 573.74524 707 | ], 708 | [ 709 | 1500048000, 710 | 2328.09, 711 | 2328.09, 712 | 2245, 713 | 2246.49, 714 | 3818.666 715 | ], 716 | [ 717 | 1500062400, 718 | 2246.22, 719 | 2262, 720 | 2178.92, 721 | 2200, 722 | 3727.4414 723 | ], 724 | [ 725 | 1500076800, 726 | 2200, 727 | 2228.14, 728 | 2150, 729 | 2217.02, 730 | 2610.2488 731 | ], 732 | [ 733 | 1500091200, 734 | 2217.2, 735 | 2224.82, 736 | 2100.59, 737 | 2101.02, 738 | 2574.4583 739 | ], 740 | [ 741 | 1500105600, 742 | 2101.02, 743 | 2145.34, 744 | 2056.55, 745 | 2064.96, 746 | 2426.965 747 | ], 748 | [ 749 | 1500120000, 750 | 2064.96, 751 | 2103.49, 752 | 2047.29, 753 | 2065.79, 754 | 1459.8611 755 | ], 756 | [ 757 | 1500134400, 758 | 2065.79, 759 | 2070.19, 760 | 1975.01, 761 | 2031.1, 762 | 4241.97 763 | ], 764 | [ 765 | 1500148800, 766 | 2031.42, 767 | 2110.06, 768 | 2021.82, 769 | 2085.96, 770 | 2589.3792 771 | ], 772 | [ 773 | 1500163200, 774 | 2085.96, 775 | 2085.96, 776 | 1964.31, 777 | 1964.31, 778 | 3039.7793 779 | ], 780 | [ 781 | 1500177600, 782 | 1964.33, 783 | 2043.94, 784 | 1933.96, 785 | 2018.67, 786 | 3392.5498 787 | ], 788 | [ 789 | 1500192000, 790 | 2018.22, 791 | 2028, 792 | 1948.63, 793 | 1956.32, 794 | 2552.0632 795 | ], 796 | [ 797 | 1500206400, 798 | 1956.32, 799 | 1972.7, 800 | 1843.56, 801 | 1843.92, 802 | 2973.2424 803 | ], 804 | [ 805 | 1500220800, 806 | 1843.88, 807 | 1928.03, 808 | 1758.2, 809 | 1886.52, 810 | 5560.639 811 | ], 812 | [ 813 | 1500235200, 814 | 1889.98, 815 | 1956.07, 816 | 1853.56, 817 | 1854.27, 818 | 4246.0156 819 | ], 820 | [ 821 | 1500249600, 822 | 1854.2, 823 | 1938, 824 | 1852, 825 | 1911.78, 826 | 3016.3076 827 | ], 828 | [ 829 | 1500264000, 830 | 1911.79, 831 | 1979.19, 832 | 1909.58, 833 | 1954.22, 834 | 3060.1716 835 | ], 836 | [ 837 | 1500278400, 838 | 1954.97, 839 | 2078.81, 840 | 1953.97, 841 | 2055.87, 842 | 2592.0312 843 | ], 844 | [ 845 | 1500292800, 846 | 2056.82, 847 | 2090.16, 848 | 1998.98, 849 | 2006.71, 850 | 3307.2188 851 | ], 852 | [ 853 | 1500307200, 854 | 2005.66, 855 | 2079, 856 | 1976, 857 | 2045.09, 858 | 3391.0562 859 | ], 860 | [ 861 | 1500321600, 862 | 2045.09, 863 | 2149.9, 864 | 2043.31, 865 | 2124, 866 | 3911.4395 867 | ], 868 | [ 869 | 1500336000, 870 | 2124, 871 | 2238.07, 872 | 2123.99, 873 | 2235.19, 874 | 5174.9087 875 | ], 876 | [ 877 | 1500350400, 878 | 2235.14, 879 | 2236.65, 880 | 2146.79, 881 | 2164.49, 882 | 3263.917 883 | ], 884 | [ 885 | 1500364800, 886 | 2164.49, 887 | 2276.76, 888 | 2134.37, 889 | 2253.1, 890 | 3481.168 891 | ], 892 | [ 893 | 1500379200, 894 | 2252.78, 895 | 2305.65, 896 | 2215.76, 897 | 2285.94, 898 | 2136.061 899 | ], 900 | [ 901 | 1500393600, 902 | 2285.91, 903 | 2365.84, 904 | 2276.32, 905 | 2354.19, 906 | 5436.647 907 | ], 908 | [ 909 | 1500408000, 910 | 2354.18, 911 | 2374, 912 | 2278, 913 | 2352.65, 914 | 4785.459 915 | ], 916 | [ 917 | 1500422400, 918 | 2352.99, 919 | 2393.43, 920 | 2256.23, 921 | 2308.15, 922 | 4691.2354 923 | ], 924 | [ 925 | 1500436800, 926 | 2307.48, 927 | 2349.1, 928 | 2244.69, 929 | 2346.87, 930 | 2957.1091 931 | ], 932 | [ 933 | 1500451200, 934 | 2344.98, 935 | 2388.99, 936 | 2297.06, 937 | 2376.58, 938 | 2805.719 939 | ], 940 | [ 941 | 1500465600, 942 | 2374.33, 943 | 2396, 944 | 2340.05, 945 | 2345.47, 946 | 1671.6997 947 | ], 948 | [ 949 | 1500480000, 950 | 2344.66, 951 | 2347.98, 952 | 2288, 953 | 2315, 954 | 3296.9504 955 | ], 956 | [ 957 | 1500494400, 958 | 2315, 959 | 2324.9, 960 | 2217.2, 961 | 2217.25, 962 | 3944.5215 963 | ], 964 | [ 965 | 1500508800, 966 | 2217.97, 967 | 2282, 968 | 2216, 969 | 2258.99, 970 | 3891.0518 971 | ], 972 | [ 973 | 1500523200, 974 | 2258.99, 975 | 2335, 976 | 2258.99, 977 | 2320.01, 978 | 2911.9893 979 | ], 980 | [ 981 | 1500537600, 982 | 2320.73, 983 | 2349.22, 984 | 2302.05, 985 | 2315.7, 986 | 1798.229 987 | ], 988 | [ 989 | 1500552000, 990 | 2315.02, 991 | 2469, 992 | 2309.12, 993 | 2462.41, 994 | 2531.8782 995 | ], 996 | [ 997 | 1500566400, 998 | 2462.35, 999 | 2661.24, 1000 | 2427.54, 1001 | 2622, 1002 | 9570.938 1003 | ], 1004 | [ 1005 | 1500580800, 1006 | 2622, 1007 | 2682.5, 1008 | 2565, 1009 | 2651.94, 1010 | 6557.804 1011 | ], 1012 | [ 1013 | 1500595200, 1014 | 2651.92, 1015 | 2957, 1016 | 2650.4, 1017 | 2870.84, 1018 | 13133.662 1019 | ], 1020 | [ 1021 | 1500609600, 1022 | 2870.84, 1023 | 2880, 1024 | 2653.2, 1025 | 2724.67, 1026 | 9167.548 1027 | ], 1028 | [ 1029 | 1500624000, 1030 | 2724.68, 1031 | 2797, 1032 | 2678.42, 1033 | 2773.01, 1034 | 3368.1133 1035 | ], 1036 | [ 1037 | 1500638400, 1038 | 2773.01, 1039 | 2773.01, 1040 | 2690.05, 1041 | 2764.81, 1042 | 1697.5238 1043 | ], 1044 | [ 1045 | 1500652800, 1046 | 2764.81, 1047 | 2798, 1048 | 2714, 1049 | 2719.52, 1050 | 2653.8901 1051 | ], 1052 | [ 1053 | 1500667200, 1054 | 2719.51, 1055 | 2743.23, 1056 | 2612.1, 1057 | 2626.47, 1058 | 3624.892 1059 | ], 1060 | [ 1061 | 1500681600, 1062 | 2626.48, 1063 | 2699.69, 1064 | 2608.27, 1065 | 2657.45, 1066 | 2545.8662 1067 | ], 1068 | [ 1069 | 1500696000, 1070 | 2661.05, 1071 | 2741.08, 1072 | 2646.95, 1073 | 2714.9, 1074 | 1744.7178 1075 | ], 1076 | [ 1077 | 1500710400, 1078 | 2717.68, 1079 | 2765.94, 1080 | 2698.01, 1081 | 2760.69, 1082 | 1228.1533 1083 | ], 1084 | [ 1085 | 1500724800, 1086 | 2760.69, 1087 | 2869.88, 1088 | 2760.69, 1089 | 2811.98, 1090 | 2367.067 1091 | ], 1092 | [ 1093 | 1500739200, 1094 | 2812, 1095 | 2824.95, 1096 | 2740, 1097 | 2789.8, 1098 | 1948.3217 1099 | ], 1100 | [ 1101 | 1500753600, 1102 | 2789.8, 1103 | 2841.73, 1104 | 2785, 1105 | 2815.6, 1106 | 2610.7612 1107 | ], 1108 | [ 1109 | 1500768000, 1110 | 2815.89, 1111 | 2832, 1112 | 2788.47, 1113 | 2825.27, 1114 | 2326.754 1115 | ], 1116 | [ 1117 | 1500782400, 1118 | 2825.27, 1119 | 2848, 1120 | 2805, 1121 | 2819.5, 1122 | 1737.7511 1123 | ], 1124 | [ 1125 | 1500796800, 1126 | 2820.83, 1127 | 2832.91, 1128 | 2745.88, 1129 | 2745.88, 1130 | 2291.4958 1131 | ], 1132 | [ 1133 | 1500811200, 1134 | 2746.48, 1135 | 2781, 1136 | 2692.29, 1137 | 2708.09, 1138 | 1409.6327 1139 | ], 1140 | [ 1141 | 1500825600, 1142 | 2708.09, 1143 | 2816.33, 1144 | 2691, 1145 | 2789.37, 1146 | 1511.678 1147 | ], 1148 | [ 1149 | 1500840000, 1150 | 2789.38, 1151 | 2805, 1152 | 2765.05, 1153 | 2783.6, 1154 | 1183.4954 1155 | ], 1156 | [ 1157 | 1500854400, 1158 | 2783.52, 1159 | 2805.99, 1160 | 2720, 1161 | 2754.28, 1162 | 2061.0437 1163 | ], 1164 | [ 1165 | 1500868800, 1166 | 2755.19, 1167 | 2776, 1168 | 2730, 1169 | 2763.86, 1170 | 1101.129 1171 | ], 1172 | [ 1173 | 1500883200, 1174 | 2763.85, 1175 | 2765.01, 1176 | 2726.8, 1177 | 2748.01, 1178 | 983.32684 1179 | ], 1180 | [ 1181 | 1500897600, 1182 | 2748.48, 1183 | 2779, 1184 | 2732.75, 1185 | 2765, 1186 | 656.6733 1187 | ], 1188 | [ 1189 | 1500912000, 1190 | 2764.99, 1191 | 2799.2, 1192 | 2745.5, 1193 | 2762, 1194 | 1884.2832 1195 | ], 1196 | [ 1197 | 1500926400, 1198 | 2762, 1199 | 2774.69, 1200 | 2728.01, 1201 | 2774.62, 1202 | 2130.893 1203 | ], 1204 | [ 1205 | 1500940800, 1206 | 2774.63, 1207 | 2774.68, 1208 | 2747.13, 1209 | 2762.26, 1210 | 1351.4287 1211 | ], 1212 | [ 1213 | 1500955200, 1214 | 2761.68, 1215 | 2782.44, 1216 | 2748, 1217 | 2748.83, 1218 | 1585.3666 1219 | ], 1220 | [ 1221 | 1500969600, 1222 | 2749.99, 1223 | 2773.96, 1224 | 2630, 1225 | 2668.13, 1226 | 3207.5251 1227 | ], 1228 | [ 1229 | 1500984000, 1230 | 2668.12, 1231 | 2705, 1232 | 2550.25, 1233 | 2567.11, 1234 | 2941.202 1235 | ], 1236 | [ 1237 | 1500998400, 1238 | 2567.42, 1239 | 2598, 1240 | 2516, 1241 | 2576.01, 1242 | 4016.748 1243 | ], 1244 | [ 1245 | 1501012800, 1246 | 2576.01, 1247 | 2582.68, 1248 | 2449.69, 1249 | 2479.5, 1250 | 3423.6074 1251 | ], 1252 | [ 1253 | 1501027200, 1254 | 2479.5, 1255 | 2577, 1256 | 2450, 1257 | 2564.25, 1258 | 4028.8196 1259 | ], 1260 | [ 1261 | 1501041600, 1262 | 2564.24, 1263 | 2614, 1264 | 2474.2, 1265 | 2514.66, 1266 | 3088.5295 1267 | ], 1268 | [ 1269 | 1501056000, 1270 | 2514.66, 1271 | 2537.29, 1272 | 2441.21, 1273 | 2484, 1274 | 2113.9463 1275 | ], 1276 | [ 1277 | 1501070400, 1278 | 2484, 1279 | 2551.47, 1280 | 2475.12, 1281 | 2536.26, 1282 | 1079.3352 1283 | ], 1284 | [ 1285 | 1501084800, 1286 | 2536.27, 1287 | 2551.99, 1288 | 2404.58, 1289 | 2429.99, 1290 | 2533.2532 1291 | ], 1292 | [ 1293 | 1501099200, 1294 | 2429.99, 1295 | 2494.19, 1296 | 2403, 1297 | 2478, 1298 | 2186.9392 1299 | ], 1300 | [ 1301 | 1501113600, 1302 | 2477.98, 1303 | 2535.75, 1304 | 2446.85, 1305 | 2525.99, 1306 | 2020.2115 1307 | ], 1308 | [ 1309 | 1501128000, 1310 | 2525.98, 1311 | 2554.46, 1312 | 2514.1, 1313 | 2548, 1314 | 1338.5388 1315 | ], 1316 | [ 1317 | 1501142400, 1318 | 2547.99, 1319 | 2583, 1320 | 2535.59, 1321 | 2541.2, 1322 | 1016.67896 1323 | ], 1324 | [ 1325 | 1501156800, 1326 | 2541.2, 1327 | 2600, 1328 | 2536.21, 1329 | 2574.02, 1330 | 1061.6412 1331 | ], 1332 | [ 1333 | 1501171200, 1334 | 2574.03, 1335 | 2578, 1336 | 2528.77, 1337 | 2536, 1338 | 1671.5259 1339 | ], 1340 | [ 1341 | 1501185600, 1342 | 2536, 1343 | 2578.99, 1344 | 2526.82, 1345 | 2569.2, 1346 | 1821.086 1347 | ], 1348 | [ 1349 | 1501200000, 1350 | 2569.21, 1351 | 2686.2, 1352 | 2552.22, 1353 | 2664.99, 1354 | 3125.09 1355 | ], 1356 | [ 1357 | 1501214400, 1358 | 2664.99, 1359 | 2737.28, 1360 | 2658.52, 1361 | 2677.46, 1362 | 3092.2717 1363 | ], 1364 | [ 1365 | 1501228800, 1366 | 2676.22, 1367 | 2734.32, 1368 | 2655.55, 1369 | 2734.32, 1370 | 1676.7688 1371 | ], 1372 | [ 1373 | 1501243200, 1374 | 2734.31, 1375 | 2825.11, 1376 | 2722.33, 1377 | 2817.79, 1378 | 3600.5117 1379 | ], 1380 | [ 1381 | 1501257600, 1382 | 2817.78, 1383 | 2817.8, 1384 | 2711.79, 1385 | 2744, 1386 | 3616.729 1387 | ], 1388 | [ 1389 | 1501272000, 1390 | 2741.77, 1391 | 2780.98, 1392 | 2729.4, 1393 | 2744.17, 1394 | 2781.9475 1395 | ], 1396 | [ 1397 | 1501286400, 1398 | 2745.2, 1399 | 2803, 1400 | 2725.75, 1401 | 2786.07, 1402 | 2411.0874 1403 | ], 1404 | [ 1405 | 1501300800, 1406 | 2786.07, 1407 | 2790.99, 1408 | 2680, 1409 | 2682.99, 1410 | 2022.0238 1411 | ], 1412 | [ 1413 | 1501315200, 1414 | 2683, 1415 | 2750, 1416 | 2656, 1417 | 2734.25, 1418 | 1592.8102 1419 | ], 1420 | [ 1421 | 1501329600, 1422 | 2734.56, 1423 | 2760.67, 1424 | 2679, 1425 | 2679.01, 1426 | 847.30566 1427 | ], 1428 | [ 1429 | 1501344000, 1430 | 2679.86, 1431 | 2723.95, 1432 | 2675.01, 1433 | 2707.69, 1434 | 1396.2697 1435 | ], 1436 | [ 1437 | 1501358400, 1438 | 2707.69, 1439 | 2753.93, 1440 | 2697.99, 1441 | 2740.51, 1442 | 2203.578 1443 | ], 1444 | [ 1445 | 1501372800, 1446 | 2740.51, 1447 | 2741.62, 1448 | 2689.05, 1449 | 2700.01, 1450 | 1801.9321 1451 | ], 1452 | [ 1453 | 1501387200, 1454 | 2700.21, 1455 | 2729.75, 1456 | 2689.39, 1457 | 2704.94, 1458 | 1162.1388 1459 | ], 1460 | [ 1461 | 1501401600, 1462 | 2704.91, 1463 | 2713.19, 1464 | 2500, 1465 | 2639.88, 1466 | 3966.4485 1467 | ], 1468 | [ 1469 | 1501416000, 1470 | 2639.77, 1471 | 2668.24, 1472 | 2623.62, 1473 | 2667.25, 1474 | 532.6859 1475 | ], 1476 | [ 1477 | 1501430400, 1478 | 2667.26, 1479 | 2730, 1480 | 2660, 1481 | 2729.01, 1482 | 999.5804 1483 | ], 1484 | [ 1485 | 1501444800, 1486 | 2729.01, 1487 | 2739.98, 1488 | 2700, 1489 | 2713.89, 1490 | 944.7028 1491 | ], 1492 | [ 1493 | 1501459200, 1494 | 2713.9, 1495 | 2730, 1496 | 2713.6, 1497 | 2723.99, 1498 | 850.9192 1499 | ], 1500 | [ 1501 | 1501473600, 1502 | 2723.99, 1503 | 2733.24, 1504 | 2700, 1505 | 2720.69, 1506 | 1927.9524 1507 | ], 1508 | [ 1509 | 1501488000, 1510 | 2720.68, 1511 | 2749, 1512 | 2710, 1513 | 2732, 1514 | 1112.266 1515 | ], 1516 | [ 1517 | 1501502400, 1518 | 2731.63, 1519 | 2781, 1520 | 2712.78, 1521 | 2781, 1522 | 1310.4841 1523 | ], 1524 | [ 1525 | 1501516800, 1526 | 2780.99, 1527 | 2800, 1528 | 2747.51, 1529 | 2775.72, 1530 | 1839.461 1531 | ], 1532 | [ 1533 | 1501531200, 1534 | 2775.8, 1535 | 2850, 1536 | 2765.96, 1537 | 2845, 1538 | 2160.396 1539 | ], 1540 | [ 1541 | 1501545600, 1542 | 2844.82, 1543 | 2900, 1544 | 2837.73, 1545 | 2856.88, 1546 | 3111.015 1547 | ], 1548 | [ 1549 | 1501560000, 1550 | 2856.89, 1551 | 2863.89, 1552 | 2816.01, 1553 | 2862.91, 1554 | 1451.7058 1555 | ], 1556 | [ 1557 | 1501574400, 1558 | 2862.1, 1559 | 2925, 1560 | 2775, 1561 | 2776, 1562 | 2388.256 1563 | ], 1564 | [ 1565 | 1501588800, 1566 | 2776.03, 1567 | 2825, 1568 | 2688.85, 1569 | 2824.16, 1570 | 1689.4502 1571 | ], 1572 | [ 1573 | 1501603200, 1574 | 2824.99, 1575 | 2832, 1576 | 2676.01, 1577 | 2759.62, 1578 | 1378.883 1579 | ], 1580 | [ 1581 | 1501617600, 1582 | 2758.2, 1583 | 2797.53, 1584 | 2740.1, 1585 | 2780.66, 1586 | 1526.4196 1587 | ], 1588 | [ 1589 | 1501632000, 1590 | 2780.66, 1591 | 2780.66, 1592 | 2704.37, 1593 | 2732.59, 1594 | 1340.6184 1595 | ], 1596 | [ 1597 | 1501646400, 1598 | 2731.6, 1599 | 2754, 1600 | 2700, 1601 | 2734.2, 1602 | 1563.7465 1603 | ], 1604 | [ 1605 | 1501660800, 1606 | 2734.2, 1607 | 2757.52, 1608 | 2718.21, 1609 | 2718.21, 1610 | 795.25287 1611 | ], 1612 | [ 1613 | 1501675200, 1614 | 2718.2, 1615 | 2758.06, 1616 | 2710.1, 1617 | 2753.19, 1618 | 830.75415 1619 | ], 1620 | [ 1621 | 1501689600, 1622 | 2753.19, 1623 | 2756.19, 1624 | 2665.89, 1625 | 2699.08, 1626 | 2247.8015 1627 | ], 1628 | [ 1629 | 1501704000, 1630 | 2698.47, 1631 | 2715, 1632 | 2695.2, 1633 | 2700, 1634 | 1527.3993 1635 | ], 1636 | [ 1637 | 1501718400, 1638 | 2699.99, 1639 | 2699.99, 1640 | 2650, 1641 | 2699.9, 1642 | 1457.3761 1643 | ], 1644 | [ 1645 | 1501732800, 1646 | 2699.9, 1647 | 2720, 1648 | 2699.89, 1649 | 2720, 1650 | 993.75183 1651 | ], 1652 | [ 1653 | 1501747200, 1654 | 2719.99, 1655 | 2720.1, 1656 | 2708.4, 1657 | 2718.99, 1658 | 586.7036 1659 | ], 1660 | [ 1661 | 1501761600, 1662 | 2718.98, 1663 | 2744, 1664 | 2714.2, 1665 | 2735.76, 1666 | 921.41565 1667 | ], 1668 | [ 1669 | 1501776000, 1670 | 2735.76, 1671 | 2758.88, 1672 | 2720.2, 1673 | 2758.88, 1674 | 1316.9137 1675 | ], 1676 | [ 1677 | 1501790400, 1678 | 2758.88, 1679 | 2795.15, 1680 | 2751, 1681 | 2789.99, 1682 | 1760.3151 1683 | ], 1684 | [ 1685 | 1501804800, 1686 | 2790, 1687 | 2799, 1688 | 2777.06, 1689 | 2787.02, 1690 | 1849.85 1691 | ], 1692 | [ 1693 | 1501819200, 1694 | 2787.05, 1695 | 2790.99, 1696 | 2775, 1697 | 2781.2, 1698 | 1199.6798 1699 | ], 1700 | [ 1701 | 1501833600, 1702 | 2781.21, 1703 | 2805, 1704 | 2760, 1705 | 2805, 1706 | 916.30023 1707 | ], 1708 | [ 1709 | 1501848000, 1710 | 2805, 1711 | 2869.87, 1712 | 2798.54, 1713 | 2839.5, 1714 | 1366.1908 1715 | ], 1716 | [ 1717 | 1501862400, 1718 | 2839.5, 1719 | 2877.79, 1720 | 2838.7, 1721 | 2863.6, 1722 | 1375.7828 1723 | ], 1724 | [ 1725 | 1501876800, 1726 | 2863.6, 1727 | 2873.22, 1728 | 2826.11, 1729 | 2826.65, 1730 | 1721.2928 1731 | ], 1732 | [ 1733 | 1501891200, 1734 | 2826.65, 1735 | 2868.11, 1736 | 2826.65, 1737 | 2857.34, 1738 | 1135.7756 1739 | ], 1740 | [ 1741 | 1501905600, 1742 | 2857.34, 1743 | 3195, 1744 | 2857.34, 1745 | 3095.3, 1746 | 6030.1406 1747 | ], 1748 | [ 1749 | 1501920000, 1750 | 3095.3, 1751 | 3179.79, 1752 | 3050.01, 1753 | 3099.16, 1754 | 4331.7036 1755 | ], 1756 | [ 1757 | 1501934400, 1758 | 3099.17, 1759 | 3200, 1760 | 3095.55, 1761 | 3125.01, 1762 | 2152.026 1763 | ], 1764 | [ 1765 | 1501948800, 1766 | 3125, 1767 | 3221.86, 1768 | 3119, 1769 | 3191, 1770 | 2137.509 1771 | ], 1772 | [ 1773 | 1501963200, 1774 | 3191, 1775 | 3335, 1776 | 3191, 1777 | 3254.18, 1778 | 4262.3696 1779 | ], 1780 | [ 1781 | 1501977600, 1782 | 3254.18, 1783 | 3276.91, 1784 | 3155, 1785 | 3243.49, 1786 | 2703.698 1787 | ], 1788 | [ 1789 | 1501992000, 1790 | 3243.5, 1791 | 3275, 1792 | 3170, 1793 | 3199.62, 1794 | 1948.1385 1795 | ], 1796 | [ 1797 | 1502006400, 1798 | 3199.63, 1799 | 3209.55, 1800 | 3150, 1801 | 3169.48, 1802 | 1067.2249 1803 | ], 1804 | [ 1805 | 1502020800, 1806 | 3169.48, 1807 | 3196.69, 1808 | 3150.01, 1809 | 3155, 1810 | 703.45526 1811 | ], 1812 | [ 1813 | 1502035200, 1814 | 3155, 1815 | 3228.2, 1816 | 3155, 1817 | 3222, 1818 | 1334.9237 1819 | ], 1820 | [ 1821 | 1502049600, 1822 | 3221.54, 1823 | 3270.1, 1824 | 3220, 1825 | 3256.36, 1826 | 1715.6008 1827 | ], 1828 | [ 1829 | 1502064000, 1830 | 3256.37, 1831 | 3278.42, 1832 | 3203.52, 1833 | 3222.22, 1834 | 1896.8909 1835 | ], 1836 | [ 1837 | 1502078400, 1838 | 3222.22, 1839 | 3235.57, 1840 | 3190, 1841 | 3234.03, 1842 | 1076.3518 1843 | ], 1844 | [ 1845 | 1502092800, 1846 | 3234.03, 1847 | 3242.22, 1848 | 3214.37, 1849 | 3232.32, 1850 | 538.2194 1851 | ], 1852 | [ 1853 | 1502107200, 1854 | 3230.12, 1855 | 3350, 1856 | 3229.6, 1857 | 3341.41, 1858 | 1340.895 1859 | ], 1860 | [ 1861 | 1502121600, 1862 | 3341.41, 1863 | 3416, 1864 | 3341.41, 1865 | 3383.96, 1866 | 3089.2708 1867 | ], 1868 | [ 1869 | 1502136000, 1870 | 3383.92, 1871 | 3388, 1872 | 3328, 1873 | 3353.12, 1874 | 2608.1785 1875 | ], 1876 | [ 1877 | 1502150400, 1878 | 3353.12, 1879 | 3409.15, 1880 | 3339.53, 1881 | 3398.23, 1882 | 2672.5596 1883 | ], 1884 | [ 1885 | 1502164800, 1886 | 3398.23, 1887 | 3455.18, 1888 | 3366, 1889 | 3450.01, 1890 | 2650.167 1891 | ], 1892 | [ 1893 | 1502179200, 1894 | 3450, 1895 | 3478.8, 1896 | 3413, 1897 | 3450, 1898 | 2197.9639 1899 | ], 1900 | [ 1901 | 1502193600, 1902 | 3450, 1903 | 3489, 1904 | 3408.33, 1905 | 3443.68, 1906 | 1713.4779 1907 | ], 1908 | [ 1909 | 1502208000, 1910 | 3443.68, 1911 | 3461.45, 1912 | 3368, 1913 | 3384.66, 1914 | 2592.13 1915 | ], 1916 | [ 1917 | 1502222400, 1918 | 3384.66, 1919 | 3447, 1920 | 3349.91, 1921 | 3442.14, 1922 | 3660.1958 1923 | ], 1924 | [ 1925 | 1502236800, 1926 | 3442.13, 1927 | 3461.97, 1928 | 3406.5, 1929 | 3422.43, 1930 | 3200.1704 1931 | ], 1932 | [ 1933 | 1502251200, 1934 | 3423.28, 1935 | 3428.29, 1936 | 3350, 1937 | 3384.7, 1938 | 2684.6738 1939 | ], 1940 | [ 1941 | 1502265600, 1942 | 3385.48, 1943 | 3409.02, 1944 | 3354, 1945 | 3405.9, 1946 | 1306.302 1947 | ], 1948 | [ 1949 | 1502280000, 1950 | 3406, 1951 | 3410, 1952 | 3257.13, 1953 | 3311.99, 1954 | 2489.091 1955 | ], 1956 | [ 1957 | 1502294400, 1958 | 3311.99, 1959 | 3326.93, 1960 | 3232.62, 1961 | 3285.06, 1962 | 2484.2908 1963 | ], 1964 | [ 1965 | 1502308800, 1966 | 3285.01, 1967 | 3336.6, 1968 | 3276.07, 1969 | 3333.35, 1970 | 1848.709 1971 | ], 1972 | [ 1973 | 1502323200, 1974 | 3333.35, 1975 | 3375, 1976 | 3300.01, 1977 | 3342.8, 1978 | 2263.1277 1979 | ], 1980 | [ 1981 | 1502337600, 1982 | 3342.8, 1983 | 3359.86, 1984 | 3317, 1985 | 3330.93, 1986 | 1150.2026 1987 | ], 1988 | [ 1989 | 1502352000, 1990 | 3330.93, 1991 | 3394.78, 1992 | 3324.25, 1993 | 3394.75, 1994 | 867.9458 1995 | ], 1996 | [ 1997 | 1502366400, 1998 | 3394.75, 1999 | 3423, 2000 | 3383.28, 2001 | 3400.44, 2002 | 1049.7483 2003 | ], 2004 | [ 2005 | 1502380800, 2006 | 3400.43, 2007 | 3446.99, 2008 | 3387, 2009 | 3444, 2010 | 1820.0996 2011 | ], 2012 | [ 2013 | 1502395200, 2014 | 3443.99, 2015 | 3445.91, 2016 | 3402.18, 2017 | 3418.62, 2018 | 2260.151 2019 | ], 2020 | [ 2021 | 1502409600, 2022 | 3418.62, 2023 | 3448, 2024 | 3401.5, 2025 | 3444.98, 2026 | 2200.2563 2027 | ], 2028 | [ 2029 | 1502424000, 2030 | 3444.98, 2031 | 3453.1, 2032 | 3416.86, 2033 | 3450, 2034 | 1569.5863 2035 | ], 2036 | [ 2037 | 1502438400, 2038 | 3450.97, 2039 | 3498, 2040 | 3450, 2041 | 3495.35, 2042 | 1462.3647 2043 | ], 2044 | [ 2045 | 1502452800, 2046 | 3494.95, 2047 | 3515.9, 2048 | 3481.53, 2049 | 3515.9, 2050 | 1177.7041 2051 | ], 2052 | [ 2053 | 1502467200, 2054 | 3508.45, 2055 | 3555, 2056 | 3501.02, 2057 | 3546.21, 2058 | 2726.189 2059 | ], 2060 | [ 2061 | 1502481600, 2062 | 3546.22, 2063 | 3548.8, 2064 | 3519.26, 2065 | 3543.65, 2066 | 2842.8875 2067 | ], 2068 | [ 2069 | 1502496000, 2070 | 3543.64, 2071 | 3725, 2072 | 3542.99, 2073 | 3656.15, 2074 | 5537.0493 2075 | ], 2076 | [ 2077 | 1502510400, 2078 | 3656.14, 2079 | 3687.86, 2080 | 3622.87, 2081 | 3674.84, 2082 | 2781.901 2083 | ], 2084 | [ 2085 | 1502524800, 2086 | 3674.85, 2087 | 3829, 2088 | 3674.8, 2089 | 3804.04, 2090 | 3246.6829 2091 | ], 2092 | [ 2093 | 1502539200, 2094 | 3804.04, 2095 | 3840.61, 2096 | 3746.1, 2097 | 3835.07, 2098 | 1380.949 2099 | ], 2100 | [ 2101 | 1502553600, 2102 | 3837, 2103 | 3899, 2104 | 3774.26, 2105 | 3886.66, 2106 | 3254.133 2107 | ], 2108 | [ 2109 | 1502568000, 2110 | 3886.7, 2111 | 3974, 2112 | 3831, 2113 | 3896.01, 2114 | 4809.5474 2115 | ], 2116 | [ 2117 | 1502582400, 2118 | 3896.01, 2119 | 3896.01, 2120 | 3736.03, 2121 | 3874, 2122 | 3498.918 2123 | ], 2124 | [ 2125 | 1502596800, 2126 | 3874, 2127 | 4126.7, 2128 | 3873.99, 2129 | 4056.2, 2130 | 7859.199 2131 | ], 2132 | [ 2133 | 1502611200, 2134 | 4056.2, 2135 | 4172.01, 2136 | 3942.31, 2137 | 4159, 2138 | 3237.1663 2139 | ], 2140 | [ 2141 | 1502625600, 2142 | 4159, 2143 | 4200, 2144 | 3946.21, 2145 | 3998.92, 2146 | 3309.8884 2147 | ], 2148 | [ 2149 | 1502640000, 2150 | 3998.93, 2151 | 4060, 2152 | 3850, 2153 | 4032, 2154 | 3189.2068 2155 | ], 2156 | [ 2157 | 1502654400, 2158 | 4031.99, 2159 | 4094.99, 2160 | 3962.07, 2161 | 3979.3, 2162 | 2824.8115 2163 | ], 2164 | [ 2165 | 1502668800, 2166 | 3979.3, 2167 | 4125.78, 2168 | 3979.29, 2169 | 4060.47, 2170 | 3101.791 2171 | ], 2172 | [ 2173 | 1502683200, 2174 | 4060.47, 2175 | 4113.88, 2176 | 3985.01, 2177 | 3996.29, 2178 | 2550.9553 2179 | ], 2180 | [ 2181 | 1502697600, 2182 | 3996.29, 2183 | 4094.34, 2184 | 3986.68, 2185 | 4070.8, 2186 | 1258.24 2187 | ], 2188 | [ 2189 | 1502712000, 2190 | 4070.8, 2191 | 4216, 2192 | 4070.8, 2193 | 4165.01, 2194 | 2535.4216 2195 | ], 2196 | [ 2197 | 1502726400, 2198 | 4165.01, 2199 | 4309.97, 2200 | 4139.02, 2201 | 4247.01, 2202 | 5021.592 2203 | ], 2204 | [ 2205 | 1502740800, 2206 | 4247.01, 2207 | 4328, 2208 | 4216.03, 2209 | 4224.99, 2210 | 5327.1875 2211 | ], 2212 | [ 2213 | 1502755200, 2214 | 4224.99, 2215 | 4324.98, 2216 | 4205.01, 2217 | 4320, 2218 | 3367.359 2219 | ], 2220 | [ 2221 | 1502769600, 2222 | 4320.58, 2223 | 4434.42, 2224 | 4320.01, 2225 | 4412, 2226 | 4713.866 2227 | ], 2228 | [ 2229 | 1502784000, 2230 | 4412.01, 2231 | 4428.44, 2232 | 4203.04, 2233 | 4305.65, 2234 | 3865.9348 2235 | ], 2236 | [ 2237 | 1502798400, 2238 | 4305.65, 2239 | 4333.97, 2240 | 3944.65, 2241 | 4137.58, 2242 | 5404.9297 2243 | ], 2244 | [ 2245 | 1502812800, 2246 | 4137.58, 2247 | 4154.26, 2248 | 3807.14, 2249 | 4004.55, 2250 | 8341.582 2251 | ], 2252 | [ 2253 | 1502827200, 2254 | 3980.31, 2255 | 4182.69, 2256 | 3960.01, 2257 | 4057, 2258 | 5641.0283 2259 | ], 2260 | [ 2261 | 1502841600, 2262 | 4057.01, 2263 | 4212, 2264 | 3985, 2265 | 4159.93, 2266 | 4005.3003 2267 | ], 2268 | [ 2269 | 1502856000, 2270 | 4159.93, 2271 | 4200.36, 2272 | 4029.35, 2273 | 4072.86, 2274 | 3030.4482 2275 | ], 2276 | [ 2277 | 1502870400, 2278 | 4072.8, 2279 | 4114.9, 2280 | 3928.82, 2281 | 4072.6, 2282 | 2718.0586 2283 | ], 2284 | [ 2285 | 1502884800, 2286 | 4078.41, 2287 | 4169.95, 2288 | 4053.3, 2289 | 4079.77, 2290 | 1520.9865 2291 | ], 2292 | [ 2293 | 1502899200, 2294 | 4079.77, 2295 | 4330.89, 2296 | 4040.01, 2297 | 4304.99, 2298 | 3817.3928 2299 | ], 2300 | [ 2301 | 1502913600, 2302 | 4305, 2303 | 4373.99, 2304 | 4254, 2305 | 4301, 2306 | 3869.779 2307 | ], 2308 | [ 2309 | 1502928000, 2310 | 4302.2, 2311 | 4385.5, 2312 | 4282.98, 2313 | 4370.01, 2314 | 3013.0474 2315 | ], 2316 | [ 2317 | 1502942400, 2318 | 4370.01, 2319 | 4397, 2320 | 4232.44, 2321 | 4280.01, 2322 | 3059.4666 2323 | ], 2324 | [ 2325 | 1502956800, 2326 | 4280.01, 2327 | 4340, 2328 | 4238.01, 2329 | 4340, 2330 | 1491.4955 2331 | ], 2332 | [ 2333 | 1502971200, 2334 | 4340, 2335 | 4469, 2336 | 4338.7, 2337 | 4411.3, 2338 | 2461.056 2339 | ], 2340 | [ 2341 | 1502985600, 2342 | 4414.89, 2343 | 4469, 2344 | 4350, 2345 | 4350.63, 2346 | 3069.3743 2347 | ], 2348 | [ 2349 | 1503000000, 2350 | 4350.64, 2351 | 4360.82, 2352 | 4180, 2353 | 4315.62, 2354 | 7028.768 2355 | ], 2356 | [ 2357 | 1503014400, 2358 | 4315.62, 2359 | 4360.32, 2360 | 4246.93, 2361 | 4280.01, 2362 | 2870.3892 2363 | ], 2364 | [ 2365 | 1503028800, 2366 | 4280.01, 2367 | 4322.14, 2368 | 4200.35, 2369 | 4269.99, 2370 | 2499.106 2371 | ], 2372 | [ 2373 | 1503043200, 2374 | 4269.99, 2375 | 4319, 2376 | 4240.79, 2377 | 4300.25, 2378 | 1894.2478 2379 | ], 2380 | [ 2381 | 1503057600, 2382 | 4300.25, 2383 | 4350, 2384 | 4259.99, 2385 | 4318.83, 2386 | 1243.2234 2387 | ], 2388 | [ 2389 | 1503072000, 2390 | 4318.71, 2391 | 4341, 2392 | 4211.92, 2393 | 4233.01, 2394 | 2605.5317 2395 | ], 2396 | [ 2397 | 1503086400, 2398 | 4233.01, 2399 | 4271.91, 2400 | 4025, 2401 | 4121.67, 2402 | 5972.0215 2403 | ], 2404 | [ 2405 | 1503100800, 2406 | 4121.67, 2407 | 4142.19, 2408 | 3960.47, 2409 | 4101.72, 2410 | 6608.857 2411 | ], 2412 | [ 2413 | 1503115200, 2414 | 4101.72, 2415 | 4183.39, 2416 | 4101.71, 2417 | 4127.04, 2418 | 2296.9502 2419 | ], 2420 | [ 2421 | 1503129600, 2422 | 4126.93, 2423 | 4149.99, 2424 | 4000, 2425 | 4086.52, 2426 | 1379.5171 2427 | ], 2428 | [ 2429 | 1503144000, 2430 | 4086.52, 2431 | 4122, 2432 | 4001.07, 2433 | 4026.5, 2434 | 1220.8029 2435 | ], 2436 | [ 2437 | 1503158400, 2438 | 4026.5, 2439 | 4150, 2440 | 4008.26, 2441 | 4041.02, 2442 | 2028.2172 2443 | ], 2444 | [ 2445 | 1503172800, 2446 | 4041.02, 2447 | 4100, 2448 | 4015, 2449 | 4098.4, 2450 | 1831.7448 2451 | ], 2452 | [ 2453 | 1503187200, 2454 | 4098.4, 2455 | 4186.1, 2456 | 4086.22, 2457 | 4157.41, 2458 | 1745.5205 2459 | ], 2460 | [ 2461 | 1503201600, 2462 | 4157.41, 2463 | 4157.43, 2464 | 4048.94, 2465 | 4090.32, 2466 | 1671.1036 2467 | ], 2468 | [ 2469 | 1503216000, 2470 | 4090.32, 2471 | 4137.99, 2472 | 4090.31, 2473 | 4135, 2474 | 966.58154 2475 | ], 2476 | [ 2477 | 1503230400, 2478 | 4135, 2479 | 4137.95, 2480 | 4052.3, 2481 | 4090.63, 2482 | 803.52673 2483 | ], 2484 | [ 2485 | 1503244800, 2486 | 4090.63, 2487 | 4115, 2488 | 4065.45, 2489 | 4097.51, 2490 | 983.185 2491 | ], 2492 | [ 2493 | 1503259200, 2494 | 4097.51, 2495 | 4190.21, 2496 | 4080, 2497 | 4142.35, 2498 | 1840.9468 2499 | ], 2500 | [ 2501 | 1503273600, 2502 | 4143.58, 2503 | 4148, 2504 | 4044.52, 2505 | 4050.99, 2506 | 2066.494 2507 | ], 2508 | [ 2509 | 1503288000, 2510 | 4050.99, 2511 | 4089.99, 2512 | 4045, 2513 | 4066.02, 2514 | 1515.0592 2515 | ], 2516 | [ 2517 | 1503302400, 2518 | 4066.02, 2519 | 4082.57, 2520 | 3950.88, 2521 | 4017.92, 2522 | 2641.7441 2523 | ], 2524 | [ 2525 | 1503316800, 2526 | 4017.92, 2527 | 4074.99, 2528 | 4010.51, 2529 | 4030.96, 2530 | 1623.1572 2531 | ], 2532 | [ 2533 | 1503331200, 2534 | 4030.97, 2535 | 4043.89, 2536 | 3972.24, 2537 | 4010, 2538 | 2447.5098 2539 | ], 2540 | [ 2541 | 1503345600, 2542 | 4010.01, 2543 | 4020, 2544 | 3980, 2545 | 4016, 2546 | 1964.1211 2547 | ], 2548 | [ 2549 | 1503360000, 2550 | 4016, 2551 | 4048.9, 2552 | 3985.1, 2553 | 4002, 2554 | 2226.0942 2555 | ], 2556 | [ 2557 | 1503374400, 2558 | 4002, 2559 | 4002, 2560 | 3820, 2561 | 3840.51, 2562 | 5857.762 2563 | ], 2564 | [ 2565 | 1503388800, 2566 | 3840.52, 2567 | 3856, 2568 | 3583.46, 2569 | 3820, 2570 | 6208.227 2571 | ], 2572 | [ 2573 | 1503403200, 2574 | 3820, 2575 | 3960.62, 2576 | 3812, 2577 | 3924.96, 2578 | 1427.1361 2579 | ], 2580 | [ 2581 | 1503417600, 2582 | 3924.96, 2583 | 4000, 2584 | 3867.78, 2585 | 3914.01, 2586 | 2196.683 2587 | ], 2588 | [ 2589 | 1503432000, 2590 | 3914.01, 2591 | 4145, 2592 | 3898.37, 2593 | 4127.01, 2594 | 4136.485 2595 | ], 2596 | [ 2597 | 1503446400, 2598 | 4127.01, 2599 | 4127.01, 2600 | 4021.59, 2601 | 4092, 2602 | 2096.146 2603 | ], 2604 | [ 2605 | 1503460800, 2606 | 4092, 2607 | 4139.99, 2608 | 4058.26, 2609 | 4106, 2610 | 1943.953 2611 | ], 2612 | [ 2613 | 1503475200, 2614 | 4106.01, 2615 | 4115.99, 2616 | 4075.99, 2617 | 4115.99, 2618 | 1105.8549 2619 | ], 2620 | [ 2621 | 1503489600, 2622 | 4115.99, 2623 | 4244.99, 2624 | 4108, 2625 | 4222.99, 2626 | 1812.9108 2627 | ], 2628 | [ 2629 | 1503504000, 2630 | 4222.99, 2631 | 4247.88, 2632 | 4179.38, 2633 | 4209.98, 2634 | 1642.3153 2635 | ], 2636 | [ 2637 | 1503518400, 2638 | 4209.98, 2639 | 4243.95, 2640 | 4123.01, 2641 | 4123.01, 2642 | 2468.715 2643 | ], 2644 | [ 2645 | 1503532800, 2646 | 4123.01, 2647 | 4158.99, 2648 | 4080, 2649 | 4142.5, 2650 | 2772.3079 2651 | ], 2652 | [ 2653 | 1503547200, 2654 | 4142.5, 2655 | 4218, 2656 | 4112.76, 2657 | 4133.05, 2658 | 2047.4685 2659 | ], 2660 | [ 2661 | 1503561600, 2662 | 4133.05, 2663 | 4190, 2664 | 4121.01, 2665 | 4181.67, 2666 | 907.5982 2667 | ], 2668 | [ 2669 | 1503576000, 2670 | 4181.67, 2671 | 4213, 2672 | 4164.37, 2673 | 4192.32, 2674 | 738.50696 2675 | ], 2676 | [ 2677 | 1503590400, 2678 | 4184.17, 2679 | 4244, 2680 | 4150, 2681 | 4234.43, 2682 | 2032.716 2683 | ], 2684 | [ 2685 | 1503604800, 2686 | 4234.42, 2687 | 4242.73, 2688 | 4186.05, 2689 | 4230.53, 2690 | 1549.4369 2691 | ], 2692 | [ 2693 | 1503619200, 2694 | 4230.53, 2695 | 4349.99, 2696 | 4220.08, 2697 | 4312.03, 2698 | 2972.2917 2699 | ], 2700 | [ 2701 | 1503633600, 2702 | 4312.03, 2703 | 4368.99, 2704 | 4312.02, 2705 | 4344.01, 2706 | 1886.1364 2707 | ], 2708 | [ 2709 | 1503648000, 2710 | 4344.01, 2711 | 4354.97, 2712 | 4300.1, 2713 | 4340, 2714 | 1109.5935 2715 | ], 2716 | [ 2717 | 1503662400, 2718 | 4340, 2719 | 4361.28, 2720 | 4314.54, 2721 | 4346.4, 2722 | 537.5198 2723 | ], 2724 | [ 2725 | 1503676800, 2726 | 4346.4, 2727 | 4449.99, 2728 | 4337.19, 2729 | 4418.04, 2730 | 2158.3113 2731 | ], 2732 | [ 2733 | 1503691200, 2734 | 4418.04, 2735 | 4453.9, 2736 | 4300, 2737 | 4335, 2738 | 3009.8943 2739 | ], 2740 | [ 2741 | 1503705600, 2742 | 4335, 2743 | 4376.09, 2744 | 4284.01, 2745 | 4360, 2746 | 2217.3606 2747 | ], 2748 | [ 2749 | 1503720000, 2750 | 4360, 2751 | 4374.39, 2752 | 4260.01, 2753 | 4310, 2754 | 1615.6028 2755 | ], 2756 | [ 2757 | 1503734400, 2758 | 4310, 2759 | 4350, 2760 | 4290.2, 2761 | 4341.94, 2762 | 805.9646 2763 | ], 2764 | [ 2765 | 1503748800, 2766 | 4341.95, 2767 | 4344, 2768 | 4283.16, 2769 | 4311.01, 2770 | 455.94797 2771 | ], 2772 | [ 2773 | 1503763200, 2774 | 4311.01, 2775 | 4311.01, 2776 | 4265, 2777 | 4297.43, 2778 | 1280.9192 2779 | ], 2780 | [ 2781 | 1503777600, 2782 | 4297.43, 2783 | 4353, 2784 | 4288, 2785 | 4337.69, 2786 | 1108.715 2787 | ], 2788 | [ 2789 | 1503792000, 2790 | 4337.69, 2791 | 4349.99, 2792 | 4331.85, 2793 | 4344.32, 2794 | 879.1842 2795 | ], 2796 | [ 2797 | 1503806400, 2798 | 4344.32, 2799 | 4392, 2800 | 4320.84, 2801 | 4323.82, 2802 | 1387.97 2803 | ], 2804 | [ 2805 | 1503820800, 2806 | 4323.82, 2807 | 4356.51, 2808 | 4309.87, 2809 | 4338.67, 2810 | 817.9321 2811 | ], 2812 | [ 2813 | 1503835200, 2814 | 4338.66, 2815 | 4344, 2816 | 4315, 2817 | 4341.95, 2818 | 575.8661 2819 | ], 2820 | [ 2821 | 1503849600, 2822 | 4341.9, 2823 | 4349.12, 2824 | 4315, 2825 | 4345.01, 2826 | 833.3429 2827 | ], 2828 | [ 2829 | 1503864000, 2830 | 4345.01, 2831 | 4362.99, 2832 | 4340.22, 2833 | 4362.98, 2834 | 1544.73 2835 | ], 2836 | [ 2837 | 1503878400, 2838 | 4362.98, 2839 | 4376, 2840 | 4339.4, 2841 | 4343.5, 2842 | 1881.5101 2843 | ], 2844 | [ 2845 | 1503892800, 2846 | 4340.61, 2847 | 4342.75, 2848 | 4285, 2849 | 4291.64, 2850 | 2018.7043 2851 | ], 2852 | [ 2853 | 1503907200, 2854 | 4291.64, 2855 | 4300, 2856 | 4200, 2857 | 4299.98, 2858 | 2121.6748 2859 | ], 2860 | [ 2861 | 1503921600, 2862 | 4299.98, 2863 | 4319.99, 2864 | 4282, 2865 | 4314.99, 2866 | 797.51587 2867 | ], 2868 | [ 2869 | 1503936000, 2870 | 4314.99, 2871 | 4324, 2872 | 4285, 2873 | 4298, 2874 | 1426.6953 2875 | ], 2876 | [ 2877 | 1503950400, 2878 | 4298, 2879 | 4348.99, 2880 | 4298, 2881 | 4336, 2882 | 1750.6619 2883 | ], 2884 | [ 2885 | 1503964800, 2886 | 4336, 2887 | 4396, 2888 | 4332.58, 2889 | 4384.99, 2890 | 2337.2476 2891 | ], 2892 | [ 2893 | 1503979200, 2894 | 4384.99, 2895 | 4399, 2896 | 4352.61, 2897 | 4385.62, 2898 | 1774.4252 2899 | ], 2900 | [ 2901 | 1503993600, 2902 | 4385.62, 2903 | 4392, 2904 | 4350, 2905 | 4350.02, 2906 | 980.28436 2907 | ], 2908 | [ 2909 | 1504008000, 2910 | 4350.02, 2911 | 4396.93, 2912 | 4350, 2913 | 4383.97, 2914 | 931.6112 2915 | ], 2916 | [ 2917 | 1504022400, 2918 | 4383.97, 2919 | 4656.83, 2920 | 4368.82, 2921 | 4581.5, 2922 | 5831.601 2923 | ], 2924 | [ 2925 | 1504036800, 2926 | 4581.5, 2927 | 4588.79, 2928 | 4534, 2929 | 4588.69, 2930 | 2079.1863 2931 | ], 2932 | [ 2933 | 1504051200, 2934 | 4588.69, 2935 | 4643.92, 2936 | 4586.96, 2937 | 4599.01, 2938 | 2912.2327 2939 | ], 2940 | [ 2941 | 1504065600, 2942 | 4599.01, 2943 | 4634.95, 2944 | 4572.84, 2945 | 4608.03, 2946 | 1940.5615 2947 | ], 2948 | [ 2949 | 1504080000, 2950 | 4608.03, 2951 | 4635.21, 2952 | 4576.64, 2953 | 4580.62, 2954 | 1546.4846 2955 | ], 2956 | [ 2957 | 1504094400, 2958 | 4580.62, 2959 | 4598.67, 2960 | 4500.55, 2961 | 4550.75, 2962 | 1741.6595 2963 | ], 2964 | [ 2965 | 1504108800, 2966 | 4550.72, 2967 | 4575.47, 2968 | 4547.3, 2969 | 4573.73, 2970 | 1630.8589 2971 | ], 2972 | [ 2973 | 1504123200, 2974 | 4573.73, 2975 | 4591, 2976 | 4549, 2977 | 4550, 2978 | 1856.822 2979 | ], 2980 | [ 2981 | 1504137600, 2982 | 4550, 2983 | 4591, 2984 | 4545, 2985 | 4581.98, 2986 | 1666.9298 2987 | ], 2988 | [ 2989 | 1504152000, 2990 | 4581.98, 2991 | 4635.21, 2992 | 4580.84, 2993 | 4630.01, 2994 | 2069.0295 2995 | ], 2996 | [ 2997 | 1504166400, 2998 | 4630.01, 2999 | 4638.99, 3000 | 4610.26, 3001 | 4627.26, 3002 | 1355.9001 3003 | ], 3004 | [ 3005 | 1504180800, 3006 | 4627.26, 3007 | 4699.99, 3008 | 4610, 3009 | 4699.99, 3010 | 1554.8549 3011 | ], 3012 | [ 3013 | 1504195200, 3014 | 4699.99, 3015 | 4729.98, 3016 | 4665.01, 3017 | 4705.33, 3018 | 2968.581 3019 | ], 3020 | [ 3021 | 1504209600, 3022 | 4705.65, 3023 | 4769.03, 3024 | 4705.64, 3025 | 4727.1, 3026 | 3723.1426 3027 | ], 3028 | [ 3029 | 1504224000, 3030 | 4727.09, 3031 | 4743.99, 3032 | 4724.29, 3033 | 4743.94, 3034 | 1950.3746 3035 | ], 3036 | [ 3037 | 1504238400, 3038 | 4743.94, 3039 | 4781.96, 3040 | 4743.93, 3041 | 4756.66, 3042 | 1729.2289 3043 | ], 3044 | [ 3045 | 1504252800, 3046 | 4756.66, 3047 | 4756.66, 3048 | 4706, 3049 | 4742.91, 3050 | 1756.819 3051 | ], 3052 | [ 3053 | 1504267200, 3054 | 4742.91, 3055 | 4822, 3056 | 4742.9, 3057 | 4822, 3058 | 2014.1283 3059 | ], 3060 | [ 3061 | 1504281600, 3062 | 4822, 3063 | 4874.99, 3064 | 4790, 3065 | 4839.88, 3066 | 3348.6208 3067 | ], 3068 | [ 3069 | 1504296000, 3070 | 4839.88, 3071 | 4875.98, 3072 | 4830, 3073 | 4871.83, 3074 | 3957.8574 3075 | ], 3076 | [ 3077 | 1504310400, 3078 | 4871.83, 3079 | 4948, 3080 | 4842, 3081 | 4948, 3082 | 3956.1272 3083 | ], 3084 | [ 3085 | 1504324800, 3086 | 4948, 3087 | 4980, 3088 | 4823.93, 3089 | 4830.58, 3090 | 3954.2256 3091 | ], 3092 | [ 3093 | 1504339200, 3094 | 4830.58, 3095 | 4880.51, 3096 | 4551.08, 3097 | 4769.9, 3098 | 4516.522 3099 | ], 3100 | [ 3101 | 1504353600, 3102 | 4769.9, 3103 | 4770, 3104 | 4635, 3105 | 4754.04, 3106 | 1466.5651 3107 | ], 3108 | [ 3109 | 1504368000, 3110 | 4754.04, 3111 | 4767.4, 3112 | 4500, 3113 | 4636.9, 3114 | 4132.84 3115 | ], 3116 | [ 3117 | 1504382400, 3118 | 4620.94, 3119 | 4690, 3120 | 4593.03, 3121 | 4650, 3122 | 2915.6921 3123 | ], 3124 | [ 3125 | 1504396800, 3126 | 4650, 3127 | 4660, 3128 | 4520, 3129 | 4649.97, 3130 | 2591.954 3131 | ], 3132 | [ 3133 | 1504411200, 3134 | 4642.44, 3135 | 4749.99, 3136 | 4642.44, 3137 | 4667.68, 3138 | 2279.4543 3139 | ], 3140 | [ 3141 | 1504425600, 3142 | 4667.68, 3143 | 4742.87, 3144 | 4650.07, 3145 | 4669.68, 3146 | 1607.0702 3147 | ], 3148 | [ 3149 | 1504440000, 3150 | 4669.68, 3151 | 4713.94, 3152 | 4604.02, 3153 | 4646.43, 3154 | 843.1325 3155 | ], 3156 | [ 3157 | 1504454400, 3158 | 4646.43, 3159 | 4676.29, 3160 | 4524, 3161 | 4608.8, 3162 | 2564.369 3163 | ], 3164 | [ 3165 | 1504468800, 3166 | 4608.93, 3167 | 4650.09, 3168 | 4555.01, 3169 | 4595.99, 3170 | 2411.284 3171 | ], 3172 | [ 3173 | 1504483200, 3174 | 4596, 3175 | 4650, 3176 | 4560, 3177 | 4626.05, 3178 | 1862.6737 3179 | ], 3180 | [ 3181 | 1504497600, 3182 | 4626.05, 3183 | 4628.05, 3184 | 4565, 3185 | 4586.45, 3186 | 1216.2102 3187 | ], 3188 | [ 3189 | 1504512000, 3190 | 4586.45, 3191 | 4589, 3192 | 4471.51, 3193 | 4474.63, 3194 | 1962.6016 3195 | ], 3196 | [ 3197 | 1504526400, 3198 | 4471.54, 3199 | 4535.79, 3200 | 4370.05, 3201 | 4419.5, 3202 | 3562.868 3203 | ], 3204 | [ 3205 | 1504540800, 3206 | 4419.5, 3207 | 4541.1, 3208 | 4250, 3209 | 4351.57, 3210 | 5180.0684 3211 | ], 3212 | [ 3213 | 1504555200, 3214 | 4351.57, 3215 | 4555, 3216 | 4234.16, 3217 | 4510, 3218 | 5576.875 3219 | ], 3220 | [ 3221 | 1504569600, 3222 | 4510, 3223 | 4581.84, 3224 | 4425, 3225 | 4498.46, 3226 | 3019.6233 3227 | ], 3228 | [ 3229 | 1504584000, 3230 | 4498.29, 3231 | 4498.29, 3232 | 4242.38, 3233 | 4293.99, 3234 | 4553.936 3235 | ], 3236 | [ 3237 | 1504598400, 3238 | 4293.98, 3239 | 4430, 3240 | 4243.44, 3241 | 4429.5, 3242 | 2321.1597 3243 | ], 3244 | [ 3245 | 1504612800, 3246 | 4429.98, 3247 | 4450, 3248 | 4328.19, 3249 | 4449.95, 3250 | 1491.5717 3251 | ], 3252 | [ 3253 | 1504627200, 3254 | 4445.46, 3255 | 4474, 3256 | 4340.01, 3257 | 4362.97, 3258 | 3312.5535 3259 | ], 3260 | [ 3261 | 1504641600, 3262 | 4362.99, 3263 | 4503.2, 3264 | 4302.06, 3265 | 4469.99, 3266 | 3191.5066 3267 | ], 3268 | [ 3269 | 1504656000, 3270 | 4469.99, 3271 | 4514.95, 3272 | 4420, 3273 | 4432.51, 3274 | 2416.34 3275 | ], 3276 | [ 3277 | 1504670400, 3278 | 4432.51, 3279 | 4530, 3280 | 4432.51, 3281 | 4513.23, 3282 | 3329.5498 3283 | ], 3284 | [ 3285 | 1504684800, 3286 | 4513.23, 3287 | 4593.31, 3288 | 4431, 3289 | 4593, 3290 | 2999.3538 3291 | ], 3292 | [ 3293 | 1504699200, 3294 | 4593, 3295 | 4692, 3296 | 4575.68, 3297 | 4679.98, 3298 | 2176.7605 3299 | ], 3300 | [ 3301 | 1504713600, 3302 | 4679.98, 3303 | 4686.27, 3304 | 4595.01, 3305 | 4673.51, 3306 | 3045.233 3307 | ], 3308 | [ 3309 | 1504728000, 3310 | 4673.51, 3311 | 4673.98, 3312 | 4590.08, 3313 | 4621.29, 3314 | 2223.2183 3315 | ], 3316 | [ 3317 | 1504742400, 3318 | 4621.29, 3319 | 4629.99, 3320 | 4540.46, 3321 | 4616.18, 3322 | 2399.2861 3323 | ], 3324 | [ 3325 | 1504756800, 3326 | 4616.18, 3327 | 4616.18, 3328 | 4502.13, 3329 | 4527.47, 3330 | 2019.8142 3331 | ], 3332 | [ 3333 | 1504771200, 3334 | 4527.47, 3335 | 4574.99, 3336 | 4475.01, 3337 | 4489.99, 3338 | 1249.707 3339 | ], 3340 | [ 3341 | 1504785600, 3342 | 4489.99, 3343 | 4628, 3344 | 4487.09, 3345 | 4624.1, 3346 | 762.40436 3347 | ], 3348 | [ 3349 | 1504800000, 3350 | 4624.1, 3351 | 4660, 3352 | 4599, 3353 | 4652.69, 3354 | 1557.5903 3355 | ], 3356 | [ 3357 | 1504814400, 3358 | 4652.69, 3359 | 4665.44, 3360 | 4601, 3361 | 4617.01, 3362 | 1517.433 3363 | ], 3364 | [ 3365 | 1504828800, 3366 | 4617.01, 3367 | 4636.96, 3368 | 4573.93, 3369 | 4624.18, 3370 | 1346.9045 3371 | ], 3372 | [ 3373 | 1504843200, 3374 | 4624.18, 3375 | 4624.18, 3376 | 4590.03, 3377 | 4620, 3378 | 1024.8633 3379 | ], 3380 | [ 3381 | 1504857600, 3382 | 4620, 3383 | 4645, 3384 | 4584.97, 3385 | 4645, 3386 | 912.3414 3387 | ], 3388 | [ 3389 | 1504872000, 3390 | 4645, 3391 | 4679.99, 3392 | 4630, 3393 | 4637.89, 3394 | 670.9915 3395 | ], 3396 | [ 3397 | 1504886400, 3398 | 4637.89, 3399 | 4646.52, 3400 | 4260, 3401 | 4435.01, 3402 | 8297.33 3403 | ], 3404 | [ 3405 | 1504900800, 3406 | 4435.01, 3407 | 4479.14, 3408 | 4201.69, 3409 | 4201.97, 3410 | 5679.5767 3411 | ], 3412 | [ 3413 | 1504915200, 3414 | 4201.96, 3415 | 4398.86, 3416 | 4140, 3417 | 4350, 3418 | 5517.3086 3419 | ], 3420 | [ 3421 | 1504929600, 3422 | 4350, 3423 | 4400, 3424 | 4250, 3425 | 4353.04, 3426 | 1876.3589 3427 | ], 3428 | [ 3429 | 1504944000, 3430 | 4353.03, 3431 | 4449.95, 3432 | 4299.45, 3433 | 4399, 3434 | 1321.9596 3435 | ], 3436 | [ 3437 | 1504958400, 3438 | 4399, 3439 | 4419, 3440 | 4362.9, 3441 | 4377.01, 3442 | 899.6543 3443 | ], 3444 | [ 3445 | 1504972800, 3446 | 4377.01, 3447 | 4389.75, 3448 | 4270.62, 3449 | 4294.49, 3450 | 1914.8993 3451 | ], 3452 | [ 3453 | 1504987200, 3454 | 4292.35, 3455 | 4309.99, 3456 | 4180, 3457 | 4295.89, 3458 | 2647.9478 3459 | ], 3460 | [ 3461 | 1505001600, 3462 | 4295.88, 3463 | 4350, 3464 | 4273.88, 3465 | 4334.36, 3466 | 1413.0897 3467 | ], 3468 | [ 3469 | 1505016000, 3470 | 4334.36, 3471 | 4334.36, 3472 | 4235.19, 3473 | 4247.01, 3474 | 1362.4984 3475 | ], 3476 | [ 3477 | 1505030400, 3478 | 4247.01, 3479 | 4281.15, 3480 | 4210, 3481 | 4210.01, 3482 | 933.1551 3483 | ], 3484 | [ 3485 | 1505059200, 3486 | 4228.35, 3487 | 4249, 3488 | 4139, 3489 | 4188.54, 3490 | 2173.7917 3491 | ], 3492 | [ 3493 | 1505073600, 3494 | 4188.54, 3495 | 4349.99, 3496 | 4177.64, 3497 | 4329.45, 3498 | 1811.0183 3499 | ], 3500 | [ 3501 | 1505088000, 3502 | 4328.99, 3503 | 4328.99, 3504 | 4240, 3505 | 4251.36, 3506 | 1627.9934 3507 | ], 3508 | [ 3509 | 1505102400, 3510 | 4251.36, 3511 | 4365, 3512 | 4220, 3513 | 4347.57, 3514 | 1444.8542 3515 | ], 3516 | [ 3517 | 1505116800, 3518 | 4347.58, 3519 | 4347.58, 3520 | 4111.14, 3521 | 4182.36, 3522 | 2449.0974 3523 | ], 3524 | [ 3525 | 1505131200, 3526 | 4182.14, 3527 | 4212, 3528 | 4132.13, 3529 | 4190.67, 3530 | 899.5921 3531 | ], 3532 | [ 3533 | 1505145600, 3534 | 4190.67, 3535 | 4298, 3536 | 4179.52, 3537 | 4235.59, 3538 | 1335.3616 3539 | ], 3540 | [ 3541 | 1505160000, 3542 | 4235.59, 3543 | 4272.39, 3544 | 4175.01, 3545 | 4199.13, 3546 | 1539.5472 3547 | ], 3548 | [ 3549 | 1505174400, 3550 | 4199.13, 3551 | 4227.99, 3552 | 4175, 3553 | 4210.72, 3554 | 1398.7665 3555 | ], 3556 | [ 3557 | 1505188800, 3558 | 4210.72, 3559 | 4285.04, 3560 | 4210.71, 3561 | 4284.95, 3562 | 1395.8193 3563 | ], 3564 | [ 3565 | 1505203200, 3566 | 4284.95, 3567 | 4375, 3568 | 4256, 3569 | 4358.56, 3570 | 1761.8405 3571 | ], 3572 | [ 3573 | 1505217600, 3574 | 4358.56, 3575 | 4375.37, 3576 | 4258.36, 3577 | 4342.83, 3578 | 968.9948 3579 | ], 3580 | [ 3581 | 1505232000, 3582 | 4342.83, 3583 | 4350, 3584 | 4250, 3585 | 4250.01, 3586 | 1434.0211 3587 | ], 3588 | [ 3589 | 1505246400, 3590 | 4250.01, 3591 | 4264.99, 3592 | 4080, 3593 | 4167.01, 3594 | 4472.6606 3595 | ], 3596 | [ 3597 | 1505260800, 3598 | 4167.01, 3599 | 4207.89, 3600 | 4125, 3601 | 4164.52, 3602 | 2339.5078 3603 | ], 3604 | [ 3605 | 1505275200, 3606 | 4164.52, 3607 | 4174.53, 3608 | 3950.01, 3609 | 3953.52, 3610 | 4422.607 3611 | ], 3612 | [ 3613 | 1505289600, 3614 | 3953.52, 3615 | 4043.97, 3616 | 3904, 3617 | 3955.01, 3618 | 3427.9673 3619 | ], 3620 | [ 3621 | 1505304000, 3622 | 3955.01, 3623 | 3995.64, 3624 | 3801.28, 3625 | 3821.35, 3626 | 2291.4878 3627 | ], 3628 | [ 3629 | 1505318400, 3630 | 3820.89, 3631 | 3920, 3632 | 3726, 3633 | 3820, 3634 | 5699.9995 3635 | ], 3636 | [ 3637 | 1505332800, 3638 | 3819.99, 3639 | 3959.99, 3640 | 3807.62, 3641 | 3849.82, 3642 | 4301.692 3643 | ], 3644 | [ 3645 | 1505347200, 3646 | 3849.65, 3647 | 3949.99, 3648 | 3838.58, 3649 | 3855.32, 3650 | 2672.7556 3651 | ], 3652 | [ 3653 | 1505361600, 3654 | 3855.61, 3655 | 3923, 3656 | 3800, 3657 | 3800.01, 3658 | 1978.2733 3659 | ], 3660 | [ 3661 | 1505376000, 3662 | 3800.01, 3663 | 3896.84, 3664 | 3761.32, 3665 | 3870.24, 3666 | 1736.858 3667 | ], 3668 | [ 3669 | 1505390400, 3670 | 3870.24, 3671 | 3895, 3672 | 3600.73, 3673 | 3614.32, 3674 | 4178.625 3675 | ], 3676 | [ 3677 | 1505404800, 3678 | 3614.27, 3679 | 3669.97, 3680 | 3425.52, 3681 | 3520, 3682 | 10460.184 3683 | ], 3684 | [ 3685 | 1505419200, 3686 | 3520, 3687 | 3525, 3688 | 3240, 3689 | 3361.91, 3690 | 10648.402 3691 | ], 3692 | [ 3693 | 1505433600, 3694 | 3361.91, 3695 | 3450, 3696 | 3230.05, 3697 | 3249.99, 3698 | 7357.7437 3699 | ], 3700 | [ 3701 | 1505448000, 3702 | 3249.84, 3703 | 3464.99, 3704 | 3234.98, 3705 | 3367.78, 3706 | 6266.4136 3707 | ], 3708 | [ 3709 | 1505462400, 3710 | 3367.78, 3711 | 3374.01, 3712 | 3060, 3713 | 3123.14, 3714 | 5508.208 3715 | ], 3716 | [ 3717 | 1505476800, 3718 | 3123.13, 3719 | 3213.75, 3720 | 2975.01, 3721 | 3027, 3722 | 7283.2954 3723 | ], 3724 | [ 3725 | 1505491200, 3726 | 3028.5, 3727 | 3889.16, 3728 | 3007.29, 3729 | 3859.05, 3730 | 18676.955 3731 | ], 3732 | [ 3733 | 1505505600, 3734 | 3859.03, 3735 | 3894.48, 3736 | 3472, 3737 | 3679.76, 3738 | 11145.196 3739 | ], 3740 | [ 3741 | 1505520000, 3742 | 3679.82, 3743 | 3839.46, 3744 | 3660, 3745 | 3740.02, 3746 | 5606.4717 3747 | ], 3748 | [ 3749 | 1505534400, 3750 | 3740.02, 3751 | 3840, 3752 | 3707.83, 3753 | 3823.01, 3754 | 2651.5916 3755 | ], 3756 | [ 3757 | 1505548800, 3758 | 3823.01, 3759 | 3964.64, 3760 | 3813.04, 3761 | 3933.18, 3762 | 3518.7405 3763 | ], 3764 | [ 3765 | 1505563200, 3766 | 3933.17, 3767 | 4042.98, 3768 | 3675, 3769 | 3814.26, 3770 | 4359.3467 3771 | ], 3772 | [ 3773 | 1505577600, 3774 | 3814.24, 3775 | 3814.24, 3776 | 3601, 3777 | 3620.53, 3778 | 3570.6533 3779 | ], 3780 | [ 3781 | 1505592000, 3782 | 3612.1, 3783 | 3753.99, 3784 | 3600, 3785 | 3722.51, 3786 | 3319.048 3787 | ], 3788 | [ 3789 | 1505606400, 3790 | 3722.51, 3791 | 3757, 3792 | 3659.89, 3793 | 3726.51, 3794 | 1612.4502 3795 | ], 3796 | [ 3797 | 1505620800, 3798 | 3726.51, 3799 | 3726.51, 3800 | 3621.21, 3801 | 3639.93, 3802 | 2014.3308 3803 | ], 3804 | [ 3805 | 1505635200, 3806 | 3639.92, 3807 | 3639.93, 3808 | 3530, 3809 | 3530.01, 3810 | 1457.7965 3811 | ], 3812 | [ 3813 | 1505649600, 3814 | 3530.01, 3815 | 3660.93, 3816 | 3475.64, 3817 | 3581.12, 3818 | 2178.1633 3819 | ], 3820 | [ 3821 | 1505664000, 3822 | 3581.12, 3823 | 3720, 3824 | 3574.39, 3825 | 3716.48, 3826 | 1966.3794 3827 | ], 3828 | [ 3829 | 1505678400, 3830 | 3716.48, 3831 | 3841, 3832 | 3716.05, 3833 | 3787.02, 3834 | 2721.4968 3835 | ], 3836 | [ 3837 | 1505692800, 3838 | 3787.02, 3839 | 3807.82, 3840 | 3713.02, 3841 | 3719.98, 3842 | 1378.3589 3843 | ], 3844 | [ 3845 | 1505707200, 3846 | 3719.98, 3847 | 3828, 3848 | 3717.56, 3849 | 3791.64, 3850 | 2550.4321 3851 | ], 3852 | [ 3853 | 1505721600, 3854 | 3791.5, 3855 | 3984.71, 3856 | 3774.41, 3857 | 3955, 3858 | 2578.1553 3859 | ], 3860 | [ 3861 | 1505736000, 3862 | 3954.99, 3863 | 3990, 3864 | 3882, 3865 | 3960, 3866 | 1956.0298 3867 | ], 3868 | [ 3869 | 1505750400, 3870 | 3960, 3871 | 4130, 3872 | 3956.4, 3873 | 4033.08, 3874 | 4855.6924 3875 | ], 3876 | [ 3877 | 1505764800, 3878 | 4033.08, 3879 | 4039.99, 3880 | 3948.17, 3881 | 4019.99, 3882 | 2618.274 3883 | ], 3884 | [ 3885 | 1505779200, 3886 | 4017.79, 3887 | 4124, 3888 | 3995, 3889 | 4100, 3890 | 2345.4446 3891 | ], 3892 | [ 3893 | 1505793600, 3894 | 4100, 3895 | 4125.22, 3896 | 3918.59, 3897 | 3990.41, 3898 | 4083.4695 3899 | ], 3900 | [ 3901 | 1505808000, 3902 | 3990.41, 3903 | 3997.99, 3904 | 3850.44, 3905 | 3913.57, 3906 | 2202.8137 3907 | ], 3908 | [ 3909 | 1505822400, 3910 | 3913.57, 3911 | 4024.99, 3912 | 3913.56, 3913 | 3999.94, 3914 | 1192.4406 3915 | ], 3916 | [ 3917 | 1505836800, 3918 | 3999.94, 3919 | 4037.59, 3920 | 3951.8, 3921 | 4020.01, 3922 | 1782.9211 3923 | ], 3924 | [ 3925 | 1505851200, 3926 | 4020.01, 3927 | 4049, 3928 | 3900, 3929 | 3910, 3930 | 2507.0503 3931 | ], 3932 | [ 3933 | 1505865600, 3934 | 3910.01, 3935 | 3943.63, 3936 | 3874.29, 3937 | 3910.11, 3938 | 2012.9578 3939 | ], 3940 | [ 3941 | 1505880000, 3942 | 3910.11, 3943 | 3935.4, 3944 | 3885, 3945 | 3889.51, 3946 | 1897.1097 3947 | ], 3948 | [ 3949 | 1505894400, 3950 | 3889.51, 3951 | 3965.35, 3952 | 3850.01, 3953 | 3949.96, 3954 | 1943.1326 3955 | ], 3956 | [ 3957 | 1505908800, 3958 | 3949.85, 3959 | 3950.87, 3960 | 3900.85, 3961 | 3918.3, 3962 | 667.4974 3963 | ], 3964 | [ 3965 | 1505923200, 3966 | 3918.31, 3967 | 4044, 3968 | 3910.8, 3969 | 3990.7, 3970 | 1805.9583 3971 | ], 3972 | [ 3973 | 1505937600, 3974 | 3990.7, 3975 | 4022.81, 3976 | 3941, 3977 | 3952.95, 3978 | 1718.6238 3979 | ], 3980 | [ 3981 | 1505952000, 3982 | 3952.55, 3983 | 3971.88, 3984 | 3865, 3985 | 3867.04, 3986 | 1940.5153 3987 | ], 3988 | [ 3989 | 1505966400, 3990 | 3872.06, 3991 | 3900, 3992 | 3811, 3993 | 3833.36, 3994 | 2588.5913 3995 | ], 3996 | [ 3997 | 1505980800, 3998 | 3833.36, 3999 | 3877.7, 4000 | 3820, 4001 | 3868.02, 4002 | 514.8841 4003 | ] 4004 | ] 4005 | }, 4006 | "allowance": { 4007 | "cost": 3391966, 4008 | "remaining": 3996608034 4009 | } 4010 | } 4011 | -------------------------------------------------------------------------------- /tests/indicators/mod.rs: -------------------------------------------------------------------------------- 1 | pub mod sma; 2 | -------------------------------------------------------------------------------- /tests/indicators/sma.rs: -------------------------------------------------------------------------------- 1 | // local imports 2 | 3 | use technical_indicators::indicators::SimpleMovingAverage; 4 | use technical_indicators::charts::{Chart, Source}; 5 | use technical_indicators::charts::candlestick::CandleStick; 6 | 7 | use TRADING_DATA; 8 | 9 | // tests 10 | 11 | #[test] 12 | fn push_get_data_points() { 13 | let mut candlestick = CandleStick::new(); 14 | 15 | match candlestick.get(0) { 16 | Some(_) => unreachable!(), 17 | None => {} 18 | }; 19 | 20 | for data in TRADING_DATA.iter() { 21 | candlestick.push(data); 22 | } 23 | 24 | let period = 50; 25 | let sma_open = SimpleMovingAverage::new(candlestick.open(), period); 26 | let sma_high = SimpleMovingAverage::new(candlestick.high(), period); 27 | let sma_low = SimpleMovingAverage::new(candlestick.low(), period); 28 | let sma_close = SimpleMovingAverage::new(candlestick.close(), period); 29 | let sma_volume = SimpleMovingAverage::new(candlestick.volume(), period); 30 | 31 | for index in 0..(TRADING_DATA.len() - period) { 32 | match sma_open.get(index) { 33 | Some(result) => { 34 | assert_approx_eq!(result, simple_moving_average(&Source::Open, period, index)); 35 | } 36 | None => unreachable!(), 37 | } 38 | 39 | match sma_high.get(index) { 40 | Some(result) => { 41 | assert_approx_eq!(result, simple_moving_average(&Source::High, period, index)); 42 | } 43 | None => unreachable!(), 44 | } 45 | 46 | match sma_low.get(index) { 47 | Some(result) => { 48 | assert_approx_eq!(result, simple_moving_average(&Source::Low, period, index)); 49 | } 50 | None => unreachable!(), 51 | } 52 | 53 | match sma_close.get(index) { 54 | Some(result) => { 55 | assert_approx_eq!(result, simple_moving_average(&Source::Close, period, index)); 56 | } 57 | None => unreachable!(), 58 | } 59 | 60 | match sma_volume.get(index) { 61 | Some(result) => { 62 | assert_approx_eq!( 63 | result, 64 | simple_moving_average(&Source::Volume, period, index) 65 | ); 66 | } 67 | None => unreachable!(), 68 | } 69 | } 70 | 71 | // expect non since there aren't enough data points to build a SMA of given period size 72 | 73 | match sma_open.get(TRADING_DATA.len() - period + 1) { 74 | Some(_) => unreachable!(), 75 | None => {} 76 | } 77 | 78 | match sma_high.get(TRADING_DATA.len() - period + 1) { 79 | Some(_) => unreachable!(), 80 | None => {} 81 | } 82 | 83 | match sma_low.get(TRADING_DATA.len() - period + 1) { 84 | Some(_) => unreachable!(), 85 | None => {} 86 | } 87 | 88 | match sma_close.get(TRADING_DATA.len() - period + 1) { 89 | Some(_) => unreachable!(), 90 | None => {} 91 | } 92 | 93 | match sma_volume.get(TRADING_DATA.len() - period + 1) { 94 | Some(_) => unreachable!(), 95 | None => {} 96 | } 97 | } 98 | 99 | // helpers 100 | 101 | fn simple_moving_average(source_type: &Source, period: usize, index: usize) -> f64 { 102 | let end = TRADING_DATA.len(); 103 | 104 | let mut sum = 0.0; 105 | for data in (&TRADING_DATA)[(end - period - index)..(end - index)].iter() { 106 | sum += data.get(source_type); 107 | } 108 | 109 | sum / (period as f64) 110 | } 111 | -------------------------------------------------------------------------------- /tests/tests.rs: -------------------------------------------------------------------------------- 1 | // 3rd-party crates 2 | 3 | #[macro_use] 4 | extern crate assert_approx_eq; 5 | extern crate json; 6 | #[macro_use] 7 | extern crate lazy_static; 8 | 9 | // local crates 10 | 11 | extern crate technical_indicators; 12 | 13 | // local imports 14 | 15 | use technical_indicators::charts::DataPoint; 16 | 17 | // static 18 | 19 | lazy_static! { 20 | static ref TRADING_DATA: Vec = { 21 | 22 | use json::JsonValue; 23 | 24 | let raw_data = include_str!("data.json"); 25 | 26 | let parsed = json::parse(raw_data).unwrap(); 27 | 28 | // 14400 seconds := 4 hours 29 | match parsed["result"]["14400"] { 30 | JsonValue::Array(ref arr) => { 31 | arr.clone().iter_mut().map(|item| { 32 | 33 | // NOTE: [ CloseTime, OpenPrice, HighPrice, LowPrice, ClosePrice, Volume ] 34 | 35 | let open = item[1].as_f64().unwrap(); 36 | let high = item[2].as_f64().unwrap(); 37 | let low = item[3].as_f64().unwrap(); 38 | let close = item[4].as_f64().unwrap(); 39 | 40 | assert!(low <= high); 41 | assert!(open <= high); 42 | assert!(low <= open); 43 | assert!(close <= high); 44 | assert!(low <= close); 45 | 46 | DataPoint { 47 | open: open, 48 | high: high, 49 | low: low, 50 | close: close, 51 | volume: item[5].as_f64().unwrap(), 52 | } 53 | }).collect() 54 | }, 55 | _ => unreachable!() 56 | } 57 | }; 58 | } 59 | 60 | // tests 61 | 62 | pub mod charts; 63 | pub mod indicators; 64 | --------------------------------------------------------------------------------