global: snapshot

This commit is contained in:
k
2024-10-04 19:09:09 +02:00
parent 1c9d118ba2
commit 068bb07d6e
57 changed files with 1799 additions and 295 deletions
+4 -3
View File
@@ -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
+3 -3
View File
@@ -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