-
Notifications
You must be signed in to change notification settings - Fork 0
/
notes.txt
38 lines (27 loc) · 1.14 KB
/
notes.txt
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
TODO:
optionsdx: store bid and ask for underlying
REPL:
evcxr --opt 2
:dep lyza = { path = "C:/data/rust/lyza/" }
use lyza::*;
use general::*;
use market::types::*;
use market::chaintypes::*;
use std::ops::Range;
use backtest::backtest::backtest;
//let chall:ChainsAll = store::histdata::load_chall("all");
let chall:ChainsAll = store::histdata::load_chall("m1");
let range_m1:Range<Timestamp> = (Timestamp::from_ymd(2022, 1, 1))..(Timestamp::from_ymd(2022, 2, 1));
let range_y4:Range<Timestamp> = (Timestamp::from_ymd(2019, 1, 1))..(Timestamp::from_ymd(2022, 10, 1));
backtest(&chall, &range_m1);
/////////////////////////
let filt:Box<fn((u16,u8)) -> bool> = Box::new(|(y, m)| y == 2022 && m == 1);
//store::loader::walk(Some(*filt));
let hdall = store::histdata::load_all(Some(*filt));
let chall:ChainsAll = store::histdata::make_chall(&hdall);
store::histdata::save_chall(&chall, "all");
store::histdata::save_chall(&chall, "m1");
////////////////////
let ts0:Timestamp = hdall.unders[0].0;
let xpir0:ExpirDate = hdall.calls[0].1.opt.expir;
let strikes:Vec<StrikeType> = chall.at(&ts0).unwrap().expir(&xpir0).unwrap().calls.keys().map(|x| *x).collect();