mirror of
https://github.com/bitcoinresearchkit/brk.git
synced 2026-07-28 19:28:11 -07:00
global: snapshot
This commit is contained in:
@@ -9,7 +9,7 @@ use serde_json::Value;
|
||||
use crate::{
|
||||
datasets::OHLC,
|
||||
io::{Json, INPUTS_FOLDER_PATH},
|
||||
structs::Date,
|
||||
structs::{Date, Timestamp},
|
||||
utils::{log, retry},
|
||||
};
|
||||
|
||||
@@ -169,9 +169,10 @@ impl Binance {
|
||||
// [timestamp, open, high, low, close, volume, ...]
|
||||
let array = value.as_array().unwrap();
|
||||
|
||||
let date = Date::from_timestamp(
|
||||
let date = Timestamp::wrap(
|
||||
(array.first().unwrap().as_u64().unwrap() / 1_000) as u32,
|
||||
);
|
||||
)
|
||||
.to_date();
|
||||
|
||||
let get_f32 = |index: usize| {
|
||||
array
|
||||
|
||||
@@ -5,7 +5,7 @@ use serde_json::Value;
|
||||
|
||||
use crate::{
|
||||
datasets::OHLC,
|
||||
structs::Date,
|
||||
structs::{Date, Timestamp},
|
||||
utils::{log, retry},
|
||||
};
|
||||
|
||||
@@ -91,8 +91,8 @@ impl Kraken {
|
||||
.map(|value| {
|
||||
let array = value.as_array().unwrap();
|
||||
|
||||
let date =
|
||||
Date::from_timestamp(array.first().unwrap().as_u64().unwrap() as u32);
|
||||
let date = Timestamp::wrap(array.first().unwrap().as_u64().unwrap() as u32)
|
||||
.to_date();
|
||||
|
||||
let get_f32 = |index: usize| {
|
||||
array
|
||||
|
||||
Reference in New Issue
Block a user