mirror of
https://github.com/bitcoinresearchkit/brk.git
synced 2026-06-22 12:23:04 -07:00
Compare commits
7 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 5014e0ce3e | |||
| b7a1ee9ebc | |||
| 292ceddd66 | |||
| 4b52b80000 | |||
| 9f20664c6e | |||
| 851a6aac0e | |||
| 1f1e73c47a |
Generated
+71
-65
@@ -381,7 +381,7 @@ dependencies = [
|
|||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "brk"
|
name = "brk"
|
||||||
version = "0.0.32"
|
version = "0.0.35"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"brk_cli",
|
"brk_cli",
|
||||||
"brk_computer",
|
"brk_computer",
|
||||||
@@ -398,7 +398,7 @@ dependencies = [
|
|||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "brk_cli"
|
name = "brk_cli"
|
||||||
version = "0.0.32"
|
version = "0.0.35"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"brk_computer",
|
"brk_computer",
|
||||||
"brk_core",
|
"brk_core",
|
||||||
@@ -421,7 +421,7 @@ dependencies = [
|
|||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "brk_computer"
|
name = "brk_computer"
|
||||||
version = "0.0.32"
|
version = "0.0.35"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"brk_core",
|
"brk_core",
|
||||||
"brk_exit",
|
"brk_exit",
|
||||||
@@ -435,17 +435,18 @@ dependencies = [
|
|||||||
"color-eyre",
|
"color-eyre",
|
||||||
"fjall",
|
"fjall",
|
||||||
"log",
|
"log",
|
||||||
|
"rayon",
|
||||||
"serde",
|
"serde",
|
||||||
"serde_json",
|
"serde_json",
|
||||||
]
|
]
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "brk_core"
|
name = "brk_core"
|
||||||
version = "0.0.32"
|
version = "0.0.35"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"bitcoin",
|
"bitcoin",
|
||||||
"bitcoincore-rpc",
|
"bitcoincore-rpc",
|
||||||
"byteview",
|
"byteview 0.7.0",
|
||||||
"derive_deref",
|
"derive_deref",
|
||||||
"jiff",
|
"jiff",
|
||||||
"log",
|
"log",
|
||||||
@@ -460,7 +461,7 @@ dependencies = [
|
|||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "brk_exit"
|
name = "brk_exit"
|
||||||
version = "0.0.32"
|
version = "0.0.35"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"brk_logger",
|
"brk_logger",
|
||||||
"ctrlc",
|
"ctrlc",
|
||||||
@@ -469,7 +470,7 @@ dependencies = [
|
|||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "brk_fetcher"
|
name = "brk_fetcher"
|
||||||
version = "0.0.32"
|
version = "0.0.35"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"brk_core",
|
"brk_core",
|
||||||
"brk_logger",
|
"brk_logger",
|
||||||
@@ -482,7 +483,7 @@ dependencies = [
|
|||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "brk_indexer"
|
name = "brk_indexer"
|
||||||
version = "0.0.32"
|
version = "0.0.35"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"bitcoin",
|
"bitcoin",
|
||||||
"bitcoincore-rpc",
|
"bitcoincore-rpc",
|
||||||
@@ -491,7 +492,7 @@ dependencies = [
|
|||||||
"brk_logger",
|
"brk_logger",
|
||||||
"brk_parser",
|
"brk_parser",
|
||||||
"brk_vec",
|
"brk_vec",
|
||||||
"byteview",
|
"byteview 0.7.0",
|
||||||
"color-eyre",
|
"color-eyre",
|
||||||
"fjall",
|
"fjall",
|
||||||
"log",
|
"log",
|
||||||
@@ -501,7 +502,7 @@ dependencies = [
|
|||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "brk_logger"
|
name = "brk_logger"
|
||||||
version = "0.0.32"
|
version = "0.0.35"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"color-eyre",
|
"color-eyre",
|
||||||
"env_logger",
|
"env_logger",
|
||||||
@@ -511,7 +512,7 @@ dependencies = [
|
|||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "brk_parser"
|
name = "brk_parser"
|
||||||
version = "0.0.32"
|
version = "0.0.35"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"bitcoin",
|
"bitcoin",
|
||||||
"bitcoincore-rpc",
|
"bitcoincore-rpc",
|
||||||
@@ -526,7 +527,7 @@ dependencies = [
|
|||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "brk_query"
|
name = "brk_query"
|
||||||
version = "0.0.32"
|
version = "0.0.35"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"brk_computer",
|
"brk_computer",
|
||||||
"brk_indexer",
|
"brk_indexer",
|
||||||
@@ -543,7 +544,7 @@ dependencies = [
|
|||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "brk_server"
|
name = "brk_server"
|
||||||
version = "0.0.32"
|
version = "0.0.35"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"axum",
|
"axum",
|
||||||
"brk_computer",
|
"brk_computer",
|
||||||
@@ -571,7 +572,7 @@ dependencies = [
|
|||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "brk_vec"
|
name = "brk_vec"
|
||||||
version = "0.0.32"
|
version = "0.0.35"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"arc-swap",
|
"arc-swap",
|
||||||
"brk_core",
|
"brk_core",
|
||||||
@@ -642,6 +643,12 @@ version = "0.6.1"
|
|||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "6236364b88b9b6d0bc181ba374cf1ab55ba3ef97a1cb6f8cddad48a273767fb5"
|
checksum = "6236364b88b9b6d0bc181ba374cf1ab55ba3ef97a1cb6f8cddad48a273767fb5"
|
||||||
|
|
||||||
|
[[package]]
|
||||||
|
name = "byteview"
|
||||||
|
version = "0.7.0"
|
||||||
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
|
checksum = "f996a0c883b1ae93c53ffd21857b6eaba768998dbb1f7e2f269d53dd6553256c"
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "bzip2"
|
name = "bzip2"
|
||||||
version = "0.5.2"
|
version = "0.5.2"
|
||||||
@@ -718,18 +725,18 @@ dependencies = [
|
|||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "clap"
|
name = "clap"
|
||||||
version = "4.5.37"
|
version = "4.5.38"
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "eccb054f56cbd38340b380d4a8e69ef1f02f1af43db2f0cc817a4774d80ae071"
|
checksum = "ed93b9805f8ba930df42c2590f05453d5ec36cbb85d018868a5b24d31f6ac000"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"clap_builder",
|
"clap_builder",
|
||||||
]
|
]
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "clap_builder"
|
name = "clap_builder"
|
||||||
version = "4.5.37"
|
version = "4.5.38"
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "efd9466fac8543255d3b1fcad4762c5e116ffe808c8a3043d4263cd4fd4862a2"
|
checksum = "379026ff283facf611b0ea629334361c4211d1b12ee01024eec1591133b04120"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"anstream",
|
"anstream",
|
||||||
"anstyle",
|
"anstyle",
|
||||||
@@ -937,9 +944,9 @@ dependencies = [
|
|||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "ctrlc"
|
name = "ctrlc"
|
||||||
version = "3.4.6"
|
version = "3.4.7"
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "697b5419f348fd5ae2478e8018cb016c00a5881c7f46c717de98ffd135a5651c"
|
checksum = "46f93780a459b7d656ef7f071fe699c4d3d2cb201c4b24d085b6ddc505276e73"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"nix",
|
"nix",
|
||||||
"windows-sys 0.59.0",
|
"windows-sys 0.59.0",
|
||||||
@@ -1135,7 +1142,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
|
|||||||
checksum = "b929b3db7be7d7b4d4df67fb016fc446b8f57507b48a82e69d2a30610e460f28"
|
checksum = "b929b3db7be7d7b4d4df67fb016fc446b8f57507b48a82e69d2a30610e460f28"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"byteorder",
|
"byteorder",
|
||||||
"byteview",
|
"byteview 0.6.1",
|
||||||
"dashmap",
|
"dashmap",
|
||||||
"log",
|
"log",
|
||||||
"lsm-tree",
|
"lsm-tree",
|
||||||
@@ -1720,9 +1727,9 @@ dependencies = [
|
|||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "nix"
|
name = "nix"
|
||||||
version = "0.29.0"
|
version = "0.30.1"
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "71e2746dc3a24dd78b3cfcb7be93368c6de9963d30f43a6a73998a9cf4b17b46"
|
checksum = "74523f3a35e05aba87a1d978330aef40f67b0304ac79c1c00b294c9830543db6"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"bitflags",
|
"bitflags",
|
||||||
"cfg-if",
|
"cfg-if",
|
||||||
@@ -1799,9 +1806,9 @@ checksum = "1036865bb9422d3300cf723f657c2851d0e9ab12567854b1f4eba3d77decf564"
|
|||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "oxc"
|
name = "oxc"
|
||||||
version = "0.68.1"
|
version = "0.69.0"
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "f907527226ea09664a17963b36d3057ddcab280c1dcc19b3a287f40de30c3965"
|
checksum = "6adee1268a2077efca9b1c1f36fdc9d9be2986b70c26bfc648d686002dfc50dd"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"oxc_allocator",
|
"oxc_allocator",
|
||||||
"oxc_ast",
|
"oxc_ast",
|
||||||
@@ -1842,9 +1849,9 @@ dependencies = [
|
|||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "oxc_allocator"
|
name = "oxc_allocator"
|
||||||
version = "0.68.1"
|
version = "0.69.0"
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "d3da7bc2d06c0fd029c7817889b1e4d418f4955c25c003d5a9ea4a525db8fce9"
|
checksum = "d64a116c5711ab4de5f6780627c9a88a61effc7e918db50a5943472ab5697164"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"allocator-api2",
|
"allocator-api2",
|
||||||
"bumpalo",
|
"bumpalo",
|
||||||
@@ -1856,9 +1863,9 @@ dependencies = [
|
|||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "oxc_ast"
|
name = "oxc_ast"
|
||||||
version = "0.68.1"
|
version = "0.69.0"
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "9a83d102ba84b604cf24be6b943c3347f13740afa97304461d798f2598d4a92e"
|
checksum = "76a801811f4a51678fcb766049a54cf452033240fc7fbe036d356854c7350c9e"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"bitflags",
|
"bitflags",
|
||||||
"cow-utils",
|
"cow-utils",
|
||||||
@@ -1873,9 +1880,9 @@ dependencies = [
|
|||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "oxc_ast_macros"
|
name = "oxc_ast_macros"
|
||||||
version = "0.68.1"
|
version = "0.69.0"
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "6e03da9a237d05fa378e3398a5a2c28124a387ff666218c1ca4ebfe5f0544d3d"
|
checksum = "41ce0ae699f31d2b03e251cc54a0226b1e6022bfa2012dc6074d858f23da154c"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"proc-macro2",
|
"proc-macro2",
|
||||||
"quote",
|
"quote",
|
||||||
@@ -1884,9 +1891,9 @@ dependencies = [
|
|||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "oxc_ast_visit"
|
name = "oxc_ast_visit"
|
||||||
version = "0.68.1"
|
version = "0.69.0"
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "f97a1716d68a3c9a0c9cf1d906eaeaa3a806052f91d8e4ef14e6afc50d515132"
|
checksum = "9e96d753425812fb3ff3dee311f8b78a333e60fe235f74b99281f3c8bfbb7cd2"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"oxc_allocator",
|
"oxc_allocator",
|
||||||
"oxc_ast",
|
"oxc_ast",
|
||||||
@@ -1896,9 +1903,9 @@ dependencies = [
|
|||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "oxc_cfg"
|
name = "oxc_cfg"
|
||||||
version = "0.68.1"
|
version = "0.69.0"
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "de348366d30393be8eab6591bfa03c63c18e0b239cccf666554769547d94cd39"
|
checksum = "74e353d71cadac4a92445380e76d511ce95622795e5bf64e0e644b0d71f56621"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"bitflags",
|
"bitflags",
|
||||||
"itertools",
|
"itertools",
|
||||||
@@ -1911,9 +1918,9 @@ dependencies = [
|
|||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "oxc_codegen"
|
name = "oxc_codegen"
|
||||||
version = "0.68.1"
|
version = "0.69.0"
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "740de9affaf00644d8122c3e74009c01888747d7233487c387415b298c5f9fd4"
|
checksum = "f9b63fa7d6b53b7eb5eabb5d6c62146b2e661199e12ddf9b9849c915d502fec1"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"bitflags",
|
"bitflags",
|
||||||
"cow-utils",
|
"cow-utils",
|
||||||
@@ -1932,15 +1939,15 @@ dependencies = [
|
|||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "oxc_data_structures"
|
name = "oxc_data_structures"
|
||||||
version = "0.68.1"
|
version = "0.69.0"
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "a9603941570dc1dbc111e6312d622d60722395b502aa68e703646beacc45d0d2"
|
checksum = "48a633d6f98c3e66c4f46a28f2d6d90b826f66464c7ae74c3ad1c084cb5db4af"
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "oxc_diagnostics"
|
name = "oxc_diagnostics"
|
||||||
version = "0.68.1"
|
version = "0.69.0"
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "a01184ff8ddf40a39c5ec4b0979b53e6e3f8e5701e4a0aed8edefd208ae310eb"
|
checksum = "458d78cc5805fb9496d94b4906afc63a8e4d03cfd293cca8d77c048a1821141f"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"cow-utils",
|
"cow-utils",
|
||||||
"oxc-miette",
|
"oxc-miette",
|
||||||
@@ -1948,9 +1955,9 @@ dependencies = [
|
|||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "oxc_ecmascript"
|
name = "oxc_ecmascript"
|
||||||
version = "0.68.1"
|
version = "0.69.0"
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "d549b884069d155eae98207c404b71113dc8fce2bea84dc53e8476a221405a83"
|
checksum = "4c1190881a073f992e1b420c7fc9bf7fcdc73b7377a5bc188844873d44ec87e7"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"cow-utils",
|
"cow-utils",
|
||||||
"num-bigint",
|
"num-bigint",
|
||||||
@@ -1962,9 +1969,9 @@ dependencies = [
|
|||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "oxc_estree"
|
name = "oxc_estree"
|
||||||
version = "0.68.1"
|
version = "0.69.0"
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "66904246cb3ceef3c7f9dd4b3a79bb104b242d8e442eb94f6097cec241a0eec4"
|
checksum = "78d6c5726456864b42e2ba570e1aceb4fccaef6c98edd2ed2b44ce9f27432373"
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "oxc_index"
|
name = "oxc_index"
|
||||||
@@ -1974,9 +1981,9 @@ checksum = "2fa07b0cfa997730afed43705766ef27792873fdf5215b1391949fec678d2392"
|
|||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "oxc_mangler"
|
name = "oxc_mangler"
|
||||||
version = "0.68.1"
|
version = "0.69.0"
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "d862ba81d295897e817489c0850b04c41facb927bf760d808778da40cc7ad580"
|
checksum = "8351243ef6acfe269da935764959443929541b4a681c5061a21ac807715ddd8e"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"fixedbitset",
|
"fixedbitset",
|
||||||
"itertools",
|
"itertools",
|
||||||
@@ -1991,9 +1998,9 @@ dependencies = [
|
|||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "oxc_minifier"
|
name = "oxc_minifier"
|
||||||
version = "0.68.1"
|
version = "0.69.0"
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "465c3ce7241550963b95a7127879e83a5f64094bdf217eb393e209b9eb9bed9c"
|
checksum = "a11de372cdb1eed5c47ea485511b11d3e492ee321d10eb9c31d14e7398443233"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"cow-utils",
|
"cow-utils",
|
||||||
"oxc_allocator",
|
"oxc_allocator",
|
||||||
@@ -2013,9 +2020,9 @@ dependencies = [
|
|||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "oxc_parser"
|
name = "oxc_parser"
|
||||||
version = "0.68.1"
|
version = "0.69.0"
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "a662d53b21550ca1a5600f70d033fcec40b2a25ba2b5281ecaf2ecd01cb16559"
|
checksum = "ec5d7bd6ced861f21f476ef3edca2b2c9b0775696dee4f370614aa06c4d4b767"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"bitflags",
|
"bitflags",
|
||||||
"cow-utils",
|
"cow-utils",
|
||||||
@@ -2036,14 +2043,13 @@ dependencies = [
|
|||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "oxc_regular_expression"
|
name = "oxc_regular_expression"
|
||||||
version = "0.68.1"
|
version = "0.69.0"
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "c53f760363c78764bb28b8e0f8316d9c28adf89a0ddfba625c8a9f465f4e2199"
|
checksum = "d9a1d0d251aa32bbc1228cf2e67b016ed9cdb97f2144c2b1027f3dd0fa9d662a"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"oxc_allocator",
|
"oxc_allocator",
|
||||||
"oxc_ast_macros",
|
"oxc_ast_macros",
|
||||||
"oxc_diagnostics",
|
"oxc_diagnostics",
|
||||||
"oxc_estree",
|
|
||||||
"oxc_span",
|
"oxc_span",
|
||||||
"phf",
|
"phf",
|
||||||
"rustc-hash",
|
"rustc-hash",
|
||||||
@@ -2052,9 +2058,9 @@ dependencies = [
|
|||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "oxc_semantic"
|
name = "oxc_semantic"
|
||||||
version = "0.68.1"
|
version = "0.69.0"
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "942de11616459d462489166eddf7870cfb8589ba3f12b91f61d28e80b77f7fd0"
|
checksum = "c3c1e25e8ce948cdfb8aef182e487074b931e449e7251d2df8442dde559644b8"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"itertools",
|
"itertools",
|
||||||
"oxc_allocator",
|
"oxc_allocator",
|
||||||
@@ -2088,9 +2094,9 @@ dependencies = [
|
|||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "oxc_span"
|
name = "oxc_span"
|
||||||
version = "0.68.1"
|
version = "0.69.0"
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "8f8e3cd484054ea0ce496e16437d802d4d9126e238deb267796db140a80d91dc"
|
checksum = "e04ea95e074243c7ee2f48bb8e7164c6b4f53afb6d1b61dd5d1c521c3c173f3e"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"compact_str",
|
"compact_str",
|
||||||
"oxc-miette",
|
"oxc-miette",
|
||||||
@@ -2101,9 +2107,9 @@ dependencies = [
|
|||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "oxc_syntax"
|
name = "oxc_syntax"
|
||||||
version = "0.68.1"
|
version = "0.69.0"
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "8933bda357ccc13260bb2fe3a08f02d98ceeb695c9af04d8ec5913edd9bec6d6"
|
checksum = "71f3943f294bacbd1395143ee7d47f19080e35028bd3eaca829f154bd99e3a51"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"bitflags",
|
"bitflags",
|
||||||
"cow-utils",
|
"cow-utils",
|
||||||
@@ -2122,9 +2128,9 @@ dependencies = [
|
|||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "oxc_traverse"
|
name = "oxc_traverse"
|
||||||
version = "0.68.1"
|
version = "0.69.0"
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "2e318be8193f3c72ab703afbb8941b31ed475168514067337325fa151416301a"
|
checksum = "afda4da5f89f3b40efe6a6501b3e52cc268508aafc01a0b4c8725c64f58dc492"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"itoa",
|
"itoa",
|
||||||
"oxc_allocator",
|
"oxc_allocator",
|
||||||
@@ -3043,9 +3049,9 @@ dependencies = [
|
|||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "tower-http"
|
name = "tower-http"
|
||||||
version = "0.6.3"
|
version = "0.6.4"
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "a1cfca9ae570b2a6efc764a88e914c29b3dfaa1fafe5f495812ae97ec9bc4d53"
|
checksum = "0fdb0c213ca27a9f57ab69ddb290fd80d970922355b83ae380b395d3986b8a2e"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"async-compression",
|
"async-compression",
|
||||||
"bitflags",
|
"bitflags",
|
||||||
@@ -3182,7 +3188,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
|
|||||||
checksum = "62fc7c4ce161f049607ecea654dca3f2d727da5371ae85e2e4f14ce2b98ed67c"
|
checksum = "62fc7c4ce161f049607ecea654dca3f2d727da5371ae85e2e4f14ce2b98ed67c"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"byteorder",
|
"byteorder",
|
||||||
"byteview",
|
"byteview 0.6.1",
|
||||||
"interval-heap",
|
"interval-heap",
|
||||||
"log",
|
"log",
|
||||||
"path-absolutize",
|
"path-absolutize",
|
||||||
|
|||||||
+3
-3
@@ -4,7 +4,7 @@ members = ["crates/*"]
|
|||||||
package.description = "The Bitcoin Research Kit is a suite of tools designed to extract, compute and display data stored on a Bitcoin Core node"
|
package.description = "The Bitcoin Research Kit is a suite of tools designed to extract, compute and display data stored on a Bitcoin Core node"
|
||||||
package.license = "MIT"
|
package.license = "MIT"
|
||||||
package.edition = "2024"
|
package.edition = "2024"
|
||||||
package.version = "0.0.32"
|
package.version = "0.0.35"
|
||||||
package.repository = "https://github.com/bitcoinresearchkit/brk"
|
package.repository = "https://github.com/bitcoinresearchkit/brk"
|
||||||
|
|
||||||
[profile.release]
|
[profile.release]
|
||||||
@@ -30,8 +30,8 @@ brk_parser = { version = "0", path = "crates/brk_parser" }
|
|||||||
brk_query = { version = "0", path = "crates/brk_query" }
|
brk_query = { version = "0", path = "crates/brk_query" }
|
||||||
brk_server = { version = "0", path = "crates/brk_server" }
|
brk_server = { version = "0", path = "crates/brk_server" }
|
||||||
brk_vec = { version = "0", path = "crates/brk_vec" }
|
brk_vec = { version = "0", path = "crates/brk_vec" }
|
||||||
byteview = "0.6.1"
|
byteview = "0.7.0"
|
||||||
clap = { version = "4.5.37", features = ["string"] }
|
clap = { version = "4.5.38", features = ["string"] }
|
||||||
clap_derive = "4.5.32"
|
clap_derive = "4.5.32"
|
||||||
color-eyre = "0.6.4"
|
color-eyre = "0.6.4"
|
||||||
derive_deref = "1.1.1"
|
derive_deref = "1.1.1"
|
||||||
|
|||||||
@@ -93,8 +93,10 @@ If you'd like to have your own instance hosted for you please contact [hosting@b
|
|||||||
|
|
||||||
- 2 separate dedicated servers (1 GB/s each) with different ISPs and Cloudflare integration for enhanced performance and optimal availability
|
- 2 separate dedicated servers (1 GB/s each) with different ISPs and Cloudflare integration for enhanced performance and optimal availability
|
||||||
- 99.9% SLA
|
- 99.9% SLA
|
||||||
- Direct communication for feature requests and support
|
- Configurated for speed (`raw + eager`)
|
||||||
- Updates delivered at your convenience
|
- Updates delivered at your convenience
|
||||||
|
- Direct communication for feature requests and support
|
||||||
|
- Bitcoin Core or Knots with desired version
|
||||||
- Optional subdomains: `*.bitcoinresearchkit.org`, `*.kibo.money` and `*.satonomics.xyz`
|
- Optional subdomains: `*.bitcoinresearchkit.org`, `*.kibo.money` and `*.satonomics.xyz`
|
||||||
- Logo featured in the Readme if desired
|
- Logo featured in the Readme if desired
|
||||||
|
|
||||||
|
|||||||
+67
-59
@@ -1,7 +1,7 @@
|
|||||||
use std::{
|
use std::{
|
||||||
fs,
|
fs,
|
||||||
path::{Path, PathBuf},
|
path::{Path, PathBuf},
|
||||||
thread::sleep,
|
thread::{self, sleep},
|
||||||
time::Duration,
|
time::Duration,
|
||||||
};
|
};
|
||||||
|
|
||||||
@@ -33,77 +33,85 @@ pub fn run(config: RunConfig) -> color_eyre::Result<()> {
|
|||||||
indexer.import_stores()?;
|
indexer.import_stores()?;
|
||||||
indexer.import_vecs()?;
|
indexer.import_vecs()?;
|
||||||
|
|
||||||
let mut computer = Computer::new(&config.outputsdir(), config.fetcher(), compressed);
|
let wait_for_synced_node = || -> color_eyre::Result<()> {
|
||||||
computer.import_stores(&indexer)?;
|
let is_synced = || -> color_eyre::Result<bool> {
|
||||||
computer.import_vecs(&indexer, config.computation())?;
|
let info = rpc.get_blockchain_info()?;
|
||||||
|
Ok(info.headers == info.blocks)
|
||||||
|
};
|
||||||
|
|
||||||
tokio::runtime::Builder::new_multi_thread()
|
if !is_synced()? {
|
||||||
.enable_all()
|
info!("Waiting for node to be synced...");
|
||||||
.build()?
|
while !is_synced()? {
|
||||||
.block_on(async {
|
sleep(Duration::from_secs(1))
|
||||||
let server = if config.serve() {
|
}
|
||||||
let served_indexer = indexer.clone();
|
}
|
||||||
let served_computer = computer.clone();
|
|
||||||
|
|
||||||
let server = Server::new(served_indexer, served_computer, config.website())?;
|
Ok(())
|
||||||
|
};
|
||||||
|
|
||||||
let opt = Some(tokio::spawn(async move {
|
let f = move || -> color_eyre::Result<()> {
|
||||||
server.serve().await.unwrap();
|
let mut computer = Computer::new(&config.outputsdir(), config.fetcher(), compressed);
|
||||||
}));
|
computer.import_stores(&indexer)?;
|
||||||
|
computer.import_vecs(&indexer, config.computation())?;
|
||||||
|
|
||||||
sleep(Duration::from_secs(1));
|
tokio::runtime::Builder::new_multi_thread()
|
||||||
|
.enable_all()
|
||||||
|
.build()?
|
||||||
|
.block_on(async {
|
||||||
|
let server = if config.serve() {
|
||||||
|
let served_indexer = indexer.clone();
|
||||||
|
let served_computer = computer.clone();
|
||||||
|
|
||||||
opt
|
let server = Server::new(served_indexer, served_computer, config.website())?;
|
||||||
} else {
|
|
||||||
None
|
|
||||||
};
|
|
||||||
|
|
||||||
if config.process() {
|
let opt = Some(tokio::spawn(async move {
|
||||||
let wait_for_synced_node = || -> color_eyre::Result<()> {
|
server.serve().await.unwrap();
|
||||||
let is_synced = || -> color_eyre::Result<bool> {
|
}));
|
||||||
let info = rpc.get_blockchain_info()?;
|
|
||||||
Ok(info.headers == info.blocks)
|
|
||||||
};
|
|
||||||
|
|
||||||
if !is_synced()? {
|
sleep(Duration::from_secs(1));
|
||||||
info!("Waiting for node to be synced...");
|
|
||||||
while !is_synced()? {
|
opt
|
||||||
|
} else {
|
||||||
|
None
|
||||||
|
};
|
||||||
|
|
||||||
|
if config.process() {
|
||||||
|
loop {
|
||||||
|
wait_for_synced_node()?;
|
||||||
|
|
||||||
|
let block_count = rpc.get_block_count()?;
|
||||||
|
|
||||||
|
info!("{} blocks found.", block_count + 1);
|
||||||
|
|
||||||
|
let starting_indexes = indexer.index(&parser, rpc, &exit)?;
|
||||||
|
|
||||||
|
computer.compute(&mut indexer, starting_indexes, &exit)?;
|
||||||
|
|
||||||
|
if let Some(delay) = config.delay() {
|
||||||
|
sleep(Duration::from_secs(delay))
|
||||||
|
}
|
||||||
|
|
||||||
|
info!("Waiting for new blocks...");
|
||||||
|
|
||||||
|
while block_count == rpc.get_block_count()? {
|
||||||
sleep(Duration::from_secs(1))
|
sleep(Duration::from_secs(1))
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
Ok(())
|
|
||||||
};
|
|
||||||
|
|
||||||
loop {
|
|
||||||
wait_for_synced_node()?;
|
|
||||||
|
|
||||||
let block_count = rpc.get_block_count()?;
|
|
||||||
|
|
||||||
info!("{} blocks found.", block_count + 1);
|
|
||||||
|
|
||||||
let starting_indexes = indexer.index(&parser, rpc, &exit)?;
|
|
||||||
|
|
||||||
computer.compute(&mut indexer, starting_indexes, &exit)?;
|
|
||||||
|
|
||||||
if let Some(delay) = config.delay() {
|
|
||||||
sleep(Duration::from_secs(delay))
|
|
||||||
}
|
|
||||||
|
|
||||||
info!("Waiting for new blocks...");
|
|
||||||
|
|
||||||
while block_count == rpc.get_block_count()? {
|
|
||||||
sleep(Duration::from_secs(1))
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
if let Some(handle) = server {
|
if let Some(handle) = server {
|
||||||
handle.await.unwrap();
|
handle.await.unwrap();
|
||||||
}
|
}
|
||||||
|
|
||||||
Ok(())
|
Ok(())
|
||||||
})
|
})
|
||||||
|
};
|
||||||
|
|
||||||
|
thread::Builder::new()
|
||||||
|
.stack_size(64 * 1024 * 1024)
|
||||||
|
.spawn(f)?
|
||||||
|
.join()
|
||||||
|
.unwrap()
|
||||||
}
|
}
|
||||||
|
|
||||||
#[derive(Parser, Debug, Default, PartialEq, Eq, PartialOrd, Ord, Deserialize, Serialize)]
|
#[derive(Parser, Debug, Default, PartialEq, Eq, PartialOrd, Ord, Deserialize, Serialize)]
|
||||||
|
|||||||
@@ -19,5 +19,6 @@ clap_derive = { workspace = true }
|
|||||||
color-eyre = { workspace = true }
|
color-eyre = { workspace = true }
|
||||||
fjall = { workspace = true }
|
fjall = { workspace = true }
|
||||||
log = { workspace = true }
|
log = { workspace = true }
|
||||||
|
rayon = { workspace = true }
|
||||||
serde = { workspace = true }
|
serde = { workspace = true }
|
||||||
serde_json = { workspace = true }
|
serde_json = { workspace = true }
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
use std::path::Path;
|
use std::{path::Path, thread};
|
||||||
|
|
||||||
use brk_computer::Computer;
|
use brk_computer::Computer;
|
||||||
use brk_core::default_bitcoin_path;
|
use brk_core::{default_bitcoin_path, default_brk_path};
|
||||||
use brk_exit::Exit;
|
use brk_exit::Exit;
|
||||||
use brk_fetcher::Fetcher;
|
use brk_fetcher::Fetcher;
|
||||||
use brk_indexer::Indexer;
|
use brk_indexer::Indexer;
|
||||||
@@ -21,25 +21,34 @@ pub fn main() -> color_eyre::Result<()> {
|
|||||||
)?));
|
)?));
|
||||||
let exit = Exit::new();
|
let exit = Exit::new();
|
||||||
|
|
||||||
let parser = Parser::new(bitcoin_dir.join("blocks"), rpc);
|
// Can't increase main thread's stack programatically, thus we need to use another thread
|
||||||
|
thread::Builder::new()
|
||||||
|
.stack_size(32 * 1024 * 1024)
|
||||||
|
.spawn(move || -> color_eyre::Result<()> {
|
||||||
|
let parser = Parser::new(bitcoin_dir.join("blocks"), rpc);
|
||||||
|
|
||||||
let outputs_dir = Path::new("../../_outputs");
|
let _outputs_dir = default_brk_path().join("outputs");
|
||||||
|
let outputs_dir = _outputs_dir.as_path();
|
||||||
|
// let outputs_dir = Path::new("../../_outputs");
|
||||||
|
|
||||||
let compressed = false;
|
let compressed = false;
|
||||||
|
|
||||||
let mut indexer = Indexer::new(outputs_dir, compressed, true)?;
|
let mut indexer = Indexer::new(outputs_dir, compressed, true)?;
|
||||||
indexer.import_stores()?;
|
indexer.import_stores()?;
|
||||||
indexer.import_vecs()?;
|
indexer.import_vecs()?;
|
||||||
|
|
||||||
let fetcher = Fetcher::import(None)?;
|
let fetcher = Fetcher::import(None)?;
|
||||||
|
|
||||||
let mut computer = Computer::new(outputs_dir, Some(fetcher), compressed);
|
let mut computer = Computer::new(outputs_dir, Some(fetcher), compressed);
|
||||||
computer.import_stores(&indexer)?;
|
computer.import_stores(&indexer)?;
|
||||||
computer.import_vecs(&indexer, Computation::Lazy)?;
|
computer.import_vecs(&indexer, Computation::Lazy)?;
|
||||||
|
|
||||||
let starting_indexes = indexer.index(&parser, rpc, &exit)?;
|
let starting_indexes = indexer.index(&parser, rpc, &exit)?;
|
||||||
|
|
||||||
computer.compute(&mut indexer, starting_indexes, &exit)?;
|
computer.compute(&mut indexer, starting_indexes, &exit)?;
|
||||||
|
|
||||||
Ok(())
|
Ok(())
|
||||||
|
})?
|
||||||
|
.join()
|
||||||
|
.unwrap()
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -11,6 +11,7 @@ use brk_indexer::{Indexer, Indexes};
|
|||||||
pub use brk_parser::rpc;
|
pub use brk_parser::rpc;
|
||||||
|
|
||||||
mod storage;
|
mod storage;
|
||||||
|
mod utils;
|
||||||
|
|
||||||
use brk_vec::{AnyCollectableVec, Compressed, Computation};
|
use brk_vec::{AnyCollectableVec, Compressed, Computation};
|
||||||
use log::info;
|
use log::info;
|
||||||
|
|||||||
@@ -11,7 +11,7 @@ use brk_vec::{AnyCollectableVec, AnyIterableVec, Compressed, Computation, EagerV
|
|||||||
|
|
||||||
use super::{
|
use super::{
|
||||||
Indexes,
|
Indexes,
|
||||||
grouped::{ComputedVecsFromDateindex, ComputedVecsFromHeight, StorableVecGeneatorOptions},
|
grouped::{ComputedVecsFromDateIndex, ComputedVecsFromHeight, StorableVecGeneatorOptions},
|
||||||
indexes,
|
indexes,
|
||||||
};
|
};
|
||||||
|
|
||||||
@@ -21,7 +21,7 @@ pub struct Vecs {
|
|||||||
pub height_to_vbytes: EagerVec<Height, StoredU64>,
|
pub height_to_vbytes: EagerVec<Height, StoredU64>,
|
||||||
pub difficultyepoch_to_timestamp: EagerVec<DifficultyEpoch, Timestamp>,
|
pub difficultyepoch_to_timestamp: EagerVec<DifficultyEpoch, Timestamp>,
|
||||||
pub halvingepoch_to_timestamp: EagerVec<HalvingEpoch, Timestamp>,
|
pub halvingepoch_to_timestamp: EagerVec<HalvingEpoch, Timestamp>,
|
||||||
pub timeindexes_to_timestamp: ComputedVecsFromDateindex<Timestamp>,
|
pub timeindexes_to_timestamp: ComputedVecsFromDateIndex<Timestamp>,
|
||||||
pub indexes_to_block_count: ComputedVecsFromHeight<StoredU32>,
|
pub indexes_to_block_count: ComputedVecsFromHeight<StoredU32>,
|
||||||
pub indexes_to_block_interval: ComputedVecsFromHeight<Timestamp>,
|
pub indexes_to_block_interval: ComputedVecsFromHeight<Timestamp>,
|
||||||
pub indexes_to_block_size: ComputedVecsFromHeight<StoredUsize>,
|
pub indexes_to_block_size: ComputedVecsFromHeight<StoredUsize>,
|
||||||
@@ -43,7 +43,7 @@ impl Vecs {
|
|||||||
Version::ZERO,
|
Version::ZERO,
|
||||||
compressed,
|
compressed,
|
||||||
)?,
|
)?,
|
||||||
timeindexes_to_timestamp: ComputedVecsFromDateindex::forced_import(
|
timeindexes_to_timestamp: ComputedVecsFromDateIndex::forced_import(
|
||||||
path,
|
path,
|
||||||
"timestamp",
|
"timestamp",
|
||||||
Version::ZERO,
|
Version::ZERO,
|
||||||
|
|||||||
+17
-17
@@ -12,7 +12,7 @@ use brk_vec::{AnyCollectableVec, AnyIterableVec, Compressed, Computation, EagerV
|
|||||||
use super::{
|
use super::{
|
||||||
Indexes,
|
Indexes,
|
||||||
grouped::{
|
grouped::{
|
||||||
ComputedVecsFromDateindex, ComputedVecsFromHeightStrict, StorableVecGeneatorOptions,
|
ComputedVecsFromDateIndex, ComputedVecsFromHeightStrict, StorableVecGeneatorOptions,
|
||||||
},
|
},
|
||||||
indexes,
|
indexes,
|
||||||
};
|
};
|
||||||
@@ -33,14 +33,14 @@ pub struct Vecs {
|
|||||||
pub height_to_ohlc_in_sats: EagerVec<Height, OHLCSats>,
|
pub height_to_ohlc_in_sats: EagerVec<Height, OHLCSats>,
|
||||||
pub height_to_ohlc_in_cents: EagerVec<Height, OHLCCents>,
|
pub height_to_ohlc_in_cents: EagerVec<Height, OHLCCents>,
|
||||||
pub height_to_open_in_cents: EagerVec<Height, Open<Cents>>,
|
pub height_to_open_in_cents: EagerVec<Height, Open<Cents>>,
|
||||||
pub timeindexes_to_close: ComputedVecsFromDateindex<Close<Dollars>>,
|
pub timeindexes_to_close: ComputedVecsFromDateIndex<Close<Dollars>>,
|
||||||
pub timeindexes_to_high: ComputedVecsFromDateindex<High<Dollars>>,
|
pub timeindexes_to_high: ComputedVecsFromDateIndex<High<Dollars>>,
|
||||||
pub timeindexes_to_low: ComputedVecsFromDateindex<Low<Dollars>>,
|
pub timeindexes_to_low: ComputedVecsFromDateIndex<Low<Dollars>>,
|
||||||
pub timeindexes_to_open: ComputedVecsFromDateindex<Open<Dollars>>,
|
pub timeindexes_to_open: ComputedVecsFromDateIndex<Open<Dollars>>,
|
||||||
pub timeindexes_to_open_in_sats: ComputedVecsFromDateindex<Open<Sats>>,
|
pub timeindexes_to_open_in_sats: ComputedVecsFromDateIndex<Open<Sats>>,
|
||||||
pub timeindexes_to_high_in_sats: ComputedVecsFromDateindex<High<Sats>>,
|
pub timeindexes_to_high_in_sats: ComputedVecsFromDateIndex<High<Sats>>,
|
||||||
pub timeindexes_to_low_in_sats: ComputedVecsFromDateindex<Low<Sats>>,
|
pub timeindexes_to_low_in_sats: ComputedVecsFromDateIndex<Low<Sats>>,
|
||||||
pub timeindexes_to_close_in_sats: ComputedVecsFromDateindex<Close<Sats>>,
|
pub timeindexes_to_close_in_sats: ComputedVecsFromDateIndex<Close<Sats>>,
|
||||||
pub chainindexes_to_close: ComputedVecsFromHeightStrict<Close<Dollars>>,
|
pub chainindexes_to_close: ComputedVecsFromHeightStrict<Close<Dollars>>,
|
||||||
pub chainindexes_to_high: ComputedVecsFromHeightStrict<High<Dollars>>,
|
pub chainindexes_to_high: ComputedVecsFromHeightStrict<High<Dollars>>,
|
||||||
pub chainindexes_to_low: ComputedVecsFromHeightStrict<Low<Dollars>>,
|
pub chainindexes_to_low: ComputedVecsFromHeightStrict<Low<Dollars>>,
|
||||||
@@ -151,56 +151,56 @@ impl Vecs {
|
|||||||
Version::ZERO,
|
Version::ZERO,
|
||||||
compressed,
|
compressed,
|
||||||
)?,
|
)?,
|
||||||
timeindexes_to_open: ComputedVecsFromDateindex::forced_import(
|
timeindexes_to_open: ComputedVecsFromDateIndex::forced_import(
|
||||||
path,
|
path,
|
||||||
"open",
|
"open",
|
||||||
Version::ZERO,
|
Version::ZERO,
|
||||||
compressed,
|
compressed,
|
||||||
StorableVecGeneatorOptions::default().add_first(),
|
StorableVecGeneatorOptions::default().add_first(),
|
||||||
)?,
|
)?,
|
||||||
timeindexes_to_high: ComputedVecsFromDateindex::forced_import(
|
timeindexes_to_high: ComputedVecsFromDateIndex::forced_import(
|
||||||
path,
|
path,
|
||||||
"high",
|
"high",
|
||||||
Version::ZERO,
|
Version::ZERO,
|
||||||
compressed,
|
compressed,
|
||||||
StorableVecGeneatorOptions::default().add_max(),
|
StorableVecGeneatorOptions::default().add_max(),
|
||||||
)?,
|
)?,
|
||||||
timeindexes_to_low: ComputedVecsFromDateindex::forced_import(
|
timeindexes_to_low: ComputedVecsFromDateIndex::forced_import(
|
||||||
path,
|
path,
|
||||||
"low",
|
"low",
|
||||||
Version::ZERO,
|
Version::ZERO,
|
||||||
compressed,
|
compressed,
|
||||||
StorableVecGeneatorOptions::default().add_min(),
|
StorableVecGeneatorOptions::default().add_min(),
|
||||||
)?,
|
)?,
|
||||||
timeindexes_to_close: ComputedVecsFromDateindex::forced_import(
|
timeindexes_to_close: ComputedVecsFromDateIndex::forced_import(
|
||||||
path,
|
path,
|
||||||
"close",
|
"close",
|
||||||
Version::ZERO,
|
Version::ZERO,
|
||||||
compressed,
|
compressed,
|
||||||
StorableVecGeneatorOptions::default().add_last(),
|
StorableVecGeneatorOptions::default().add_last(),
|
||||||
)?,
|
)?,
|
||||||
timeindexes_to_open_in_sats: ComputedVecsFromDateindex::forced_import(
|
timeindexes_to_open_in_sats: ComputedVecsFromDateIndex::forced_import(
|
||||||
path,
|
path,
|
||||||
"open_in_sats",
|
"open_in_sats",
|
||||||
VERSION + VERSION_IN_SATS + Version::ZERO,
|
VERSION + VERSION_IN_SATS + Version::ZERO,
|
||||||
compressed,
|
compressed,
|
||||||
StorableVecGeneatorOptions::default().add_first(),
|
StorableVecGeneatorOptions::default().add_first(),
|
||||||
)?,
|
)?,
|
||||||
timeindexes_to_high_in_sats: ComputedVecsFromDateindex::forced_import(
|
timeindexes_to_high_in_sats: ComputedVecsFromDateIndex::forced_import(
|
||||||
path,
|
path,
|
||||||
"high_in_sats",
|
"high_in_sats",
|
||||||
VERSION + VERSION_IN_SATS + Version::ZERO,
|
VERSION + VERSION_IN_SATS + Version::ZERO,
|
||||||
compressed,
|
compressed,
|
||||||
StorableVecGeneatorOptions::default().add_max(),
|
StorableVecGeneatorOptions::default().add_max(),
|
||||||
)?,
|
)?,
|
||||||
timeindexes_to_low_in_sats: ComputedVecsFromDateindex::forced_import(
|
timeindexes_to_low_in_sats: ComputedVecsFromDateIndex::forced_import(
|
||||||
path,
|
path,
|
||||||
"low_in_sats",
|
"low_in_sats",
|
||||||
VERSION + VERSION_IN_SATS + Version::ZERO,
|
VERSION + VERSION_IN_SATS + Version::ZERO,
|
||||||
compressed,
|
compressed,
|
||||||
StorableVecGeneatorOptions::default().add_min(),
|
StorableVecGeneatorOptions::default().add_min(),
|
||||||
)?,
|
)?,
|
||||||
timeindexes_to_close_in_sats: ComputedVecsFromDateindex::forced_import(
|
timeindexes_to_close_in_sats: ComputedVecsFromDateIndex::forced_import(
|
||||||
path,
|
path,
|
||||||
"close_in_sats",
|
"close_in_sats",
|
||||||
VERSION + VERSION_IN_SATS + Version::ZERO,
|
VERSION + VERSION_IN_SATS + Version::ZERO,
|
||||||
@@ -8,6 +8,8 @@ use brk_vec::{
|
|||||||
};
|
};
|
||||||
use color_eyre::eyre::ContextCompat;
|
use color_eyre::eyre::ContextCompat;
|
||||||
|
|
||||||
|
use crate::utils::get_percentile;
|
||||||
|
|
||||||
use super::ComputedType;
|
use super::ComputedType;
|
||||||
|
|
||||||
#[derive(Clone, Debug)]
|
#[derive(Clone, Debug)]
|
||||||
@@ -176,12 +178,12 @@ where
|
|||||||
where
|
where
|
||||||
I2: StoredIndex + StoredType + CheckedSub<I2>,
|
I2: StoredIndex + StoredType + CheckedSub<I2>,
|
||||||
{
|
{
|
||||||
let index = self.starting_index(max_from);
|
|
||||||
|
|
||||||
self.validate_computed_version_or_reset_file(
|
self.validate_computed_version_or_reset_file(
|
||||||
source.version() + first_indexes.version() + count_indexes.version(),
|
source.version() + first_indexes.version() + count_indexes.version(),
|
||||||
)?;
|
)?;
|
||||||
|
|
||||||
|
let index = self.starting_index(max_from);
|
||||||
|
|
||||||
let mut count_indexes_iter = count_indexes.iter();
|
let mut count_indexes_iter = count_indexes.iter();
|
||||||
let mut source_iter = source.iter();
|
let mut source_iter = source.iter();
|
||||||
|
|
||||||
@@ -269,23 +271,23 @@ where
|
|||||||
}
|
}
|
||||||
|
|
||||||
if let Some(_90p) = self._90p.as_mut() {
|
if let Some(_90p) = self._90p.as_mut() {
|
||||||
_90p.forced_push_at(i, Self::get_percentile(&values, 0.90), exit)?;
|
_90p.forced_push_at(i, get_percentile(&values, 0.90), exit)?;
|
||||||
}
|
}
|
||||||
|
|
||||||
if let Some(_75p) = self._75p.as_mut() {
|
if let Some(_75p) = self._75p.as_mut() {
|
||||||
_75p.forced_push_at(i, Self::get_percentile(&values, 0.75), exit)?;
|
_75p.forced_push_at(i, get_percentile(&values, 0.75), exit)?;
|
||||||
}
|
}
|
||||||
|
|
||||||
if let Some(median) = self.median.as_mut() {
|
if let Some(median) = self.median.as_mut() {
|
||||||
median.forced_push_at(i, Self::get_percentile(&values, 0.50), exit)?;
|
median.forced_push_at(i, get_percentile(&values, 0.50), exit)?;
|
||||||
}
|
}
|
||||||
|
|
||||||
if let Some(_25p) = self._25p.as_mut() {
|
if let Some(_25p) = self._25p.as_mut() {
|
||||||
_25p.forced_push_at(i, Self::get_percentile(&values, 0.25), exit)?;
|
_25p.forced_push_at(i, get_percentile(&values, 0.25), exit)?;
|
||||||
}
|
}
|
||||||
|
|
||||||
if let Some(_10p) = self._10p.as_mut() {
|
if let Some(_10p) = self._10p.as_mut() {
|
||||||
_10p.forced_push_at(i, Self::get_percentile(&values, 0.10), exit)?;
|
_10p.forced_push_at(i, get_percentile(&values, 0.10), exit)?;
|
||||||
}
|
}
|
||||||
|
|
||||||
if let Some(min) = self.min.as_mut() {
|
if let Some(min) = self.min.as_mut() {
|
||||||
@@ -472,28 +474,6 @@ where
|
|||||||
Ok(())
|
Ok(())
|
||||||
}
|
}
|
||||||
|
|
||||||
fn get_percentile(sorted: &[T], percentile: f64) -> T {
|
|
||||||
let len = sorted.len();
|
|
||||||
|
|
||||||
if len == 0 {
|
|
||||||
panic!();
|
|
||||||
} else if len == 1 {
|
|
||||||
sorted[0].clone()
|
|
||||||
} else {
|
|
||||||
let index = (len - 1) as f64 * percentile;
|
|
||||||
|
|
||||||
let fract = index.fract();
|
|
||||||
|
|
||||||
if fract != 0.0 {
|
|
||||||
let left = sorted.get(index as usize).unwrap().clone();
|
|
||||||
let right = sorted.get(index.ceil() as usize).unwrap().clone();
|
|
||||||
left / 2 + right / 2
|
|
||||||
} else {
|
|
||||||
sorted.get(index as usize).unwrap().clone()
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
fn starting_index(&self, max_from: I) -> I {
|
fn starting_index(&self, max_from: I) -> I {
|
||||||
max_from.min(I::from(
|
max_from.min(I::from(
|
||||||
self.vecs().into_iter().map(|v| v.len()).min().unwrap(),
|
self.vecs().into_iter().map(|v| v.len()).min().unwrap(),
|
||||||
|
|||||||
@@ -10,7 +10,7 @@ use crate::storage::{Indexes, indexes};
|
|||||||
use super::{ComputedType, ComputedVecBuilder, StorableVecGeneatorOptions};
|
use super::{ComputedType, ComputedVecBuilder, StorableVecGeneatorOptions};
|
||||||
|
|
||||||
#[derive(Clone)]
|
#[derive(Clone)]
|
||||||
pub struct ComputedVecsFromDateindex<T>
|
pub struct ComputedVecsFromDateIndex<T>
|
||||||
where
|
where
|
||||||
T: ComputedType + PartialOrd,
|
T: ComputedType + PartialOrd,
|
||||||
{
|
{
|
||||||
@@ -25,7 +25,7 @@ where
|
|||||||
|
|
||||||
const VERSION: Version = Version::ZERO;
|
const VERSION: Version = Version::ZERO;
|
||||||
|
|
||||||
impl<T> ComputedVecsFromDateindex<T>
|
impl<T> ComputedVecsFromDateIndex<T>
|
||||||
where
|
where
|
||||||
T: ComputedType,
|
T: ComputedType,
|
||||||
{
|
{
|
||||||
@@ -94,6 +94,15 @@ where
|
|||||||
exit,
|
exit,
|
||||||
)?;
|
)?;
|
||||||
|
|
||||||
|
self.compute_rest(indexes, starting_indexes, exit)
|
||||||
|
}
|
||||||
|
|
||||||
|
pub fn compute_rest(
|
||||||
|
&mut self,
|
||||||
|
indexes: &indexes::Vecs,
|
||||||
|
starting_indexes: &Indexes,
|
||||||
|
exit: &Exit,
|
||||||
|
) -> color_eyre::Result<()> {
|
||||||
self.dateindex_extra
|
self.dateindex_extra
|
||||||
.extend(starting_indexes.dateindex, &self.dateindex, exit)?;
|
.extend(starting_indexes.dateindex, &self.dateindex, exit)?;
|
||||||
|
|
||||||
|
|||||||
@@ -3,6 +3,7 @@ mod from_dateindex;
|
|||||||
mod from_height;
|
mod from_height;
|
||||||
mod from_height_strict;
|
mod from_height_strict;
|
||||||
mod from_txindex;
|
mod from_txindex;
|
||||||
|
mod ratio_from_dateindex;
|
||||||
mod r#type;
|
mod r#type;
|
||||||
mod value_from_height;
|
mod value_from_height;
|
||||||
mod value_from_txindex;
|
mod value_from_txindex;
|
||||||
@@ -12,6 +13,7 @@ pub use from_dateindex::*;
|
|||||||
pub use from_height::*;
|
pub use from_height::*;
|
||||||
pub use from_height_strict::*;
|
pub use from_height_strict::*;
|
||||||
pub use from_txindex::*;
|
pub use from_txindex::*;
|
||||||
|
pub use ratio_from_dateindex::*;
|
||||||
use r#type::*;
|
use r#type::*;
|
||||||
pub use value_from_height::*;
|
pub use value_from_height::*;
|
||||||
pub use value_from_txindex::*;
|
pub use value_from_txindex::*;
|
||||||
|
|||||||
@@ -0,0 +1,875 @@
|
|||||||
|
use std::{f32, path::Path};
|
||||||
|
|
||||||
|
use brk_core::{Date, DateIndex, Dollars, StoredF32};
|
||||||
|
use brk_exit::Exit;
|
||||||
|
use brk_indexer::Indexer;
|
||||||
|
use brk_vec::{
|
||||||
|
AnyCollectableVec, AnyIterableVec, AnyVec, CollectableVec, Compressed, EagerVec, Result,
|
||||||
|
StoredIndex, VecIterator, Version,
|
||||||
|
};
|
||||||
|
// use rayon::prelude::*;
|
||||||
|
|
||||||
|
use crate::{
|
||||||
|
storage::{
|
||||||
|
fetched,
|
||||||
|
vecs::{Indexes, indexes},
|
||||||
|
},
|
||||||
|
utils::get_percentile,
|
||||||
|
};
|
||||||
|
|
||||||
|
use super::{ComputedVecsFromDateIndex, StorableVecGeneatorOptions};
|
||||||
|
|
||||||
|
#[derive(Clone)]
|
||||||
|
pub struct ComputedRatioVecsFromDateIndex {
|
||||||
|
pub price: ComputedVecsFromDateIndex<Dollars>,
|
||||||
|
|
||||||
|
pub ratio: ComputedVecsFromDateIndex<StoredF32>,
|
||||||
|
pub ratio_sma: ComputedVecsFromDateIndex<StoredF32>,
|
||||||
|
pub ratio_1w_sma: ComputedVecsFromDateIndex<StoredF32>,
|
||||||
|
pub ratio_1m_sma: ComputedVecsFromDateIndex<StoredF32>,
|
||||||
|
pub ratio_1y_sma: ComputedVecsFromDateIndex<StoredF32>,
|
||||||
|
pub ratio_1y_sma_momentum_oscillator: ComputedVecsFromDateIndex<StoredF32>,
|
||||||
|
pub ratio_standard_deviation: ComputedVecsFromDateIndex<StoredF32>,
|
||||||
|
pub ratio_p99_9: ComputedVecsFromDateIndex<StoredF32>,
|
||||||
|
pub ratio_p99_5: ComputedVecsFromDateIndex<StoredF32>,
|
||||||
|
pub ratio_p99: ComputedVecsFromDateIndex<StoredF32>,
|
||||||
|
pub ratio_p1: ComputedVecsFromDateIndex<StoredF32>,
|
||||||
|
pub ratio_p0_5: ComputedVecsFromDateIndex<StoredF32>,
|
||||||
|
pub ratio_p0_1: ComputedVecsFromDateIndex<StoredF32>,
|
||||||
|
pub ratio_p1sd: ComputedVecsFromDateIndex<StoredF32>,
|
||||||
|
pub ratio_p2sd: ComputedVecsFromDateIndex<StoredF32>,
|
||||||
|
pub ratio_p3sd: ComputedVecsFromDateIndex<StoredF32>,
|
||||||
|
pub ratio_m1sd: ComputedVecsFromDateIndex<StoredF32>,
|
||||||
|
pub ratio_m2sd: ComputedVecsFromDateIndex<StoredF32>,
|
||||||
|
pub ratio_m3sd: ComputedVecsFromDateIndex<StoredF32>,
|
||||||
|
pub ratio_p99_9_as_price: ComputedVecsFromDateIndex<Dollars>,
|
||||||
|
pub ratio_p99_5_as_price: ComputedVecsFromDateIndex<Dollars>,
|
||||||
|
pub ratio_p99_as_price: ComputedVecsFromDateIndex<Dollars>,
|
||||||
|
pub ratio_p1_as_price: ComputedVecsFromDateIndex<Dollars>,
|
||||||
|
pub ratio_p0_5_as_price: ComputedVecsFromDateIndex<Dollars>,
|
||||||
|
pub ratio_p0_1_as_price: ComputedVecsFromDateIndex<Dollars>,
|
||||||
|
pub ratio_p1sd_as_price: ComputedVecsFromDateIndex<Dollars>,
|
||||||
|
pub ratio_p2sd_as_price: ComputedVecsFromDateIndex<Dollars>,
|
||||||
|
pub ratio_p3sd_as_price: ComputedVecsFromDateIndex<Dollars>,
|
||||||
|
pub ratio_m1sd_as_price: ComputedVecsFromDateIndex<Dollars>,
|
||||||
|
pub ratio_m2sd_as_price: ComputedVecsFromDateIndex<Dollars>,
|
||||||
|
pub ratio_m3sd_as_price: ComputedVecsFromDateIndex<Dollars>,
|
||||||
|
}
|
||||||
|
|
||||||
|
const VERSION: Version = Version::ZERO;
|
||||||
|
|
||||||
|
impl ComputedRatioVecsFromDateIndex {
|
||||||
|
pub fn forced_import(
|
||||||
|
path: &Path,
|
||||||
|
name: &str,
|
||||||
|
// _compute_source: bool,
|
||||||
|
version: Version,
|
||||||
|
compressed: Compressed,
|
||||||
|
options: StorableVecGeneatorOptions,
|
||||||
|
) -> color_eyre::Result<Self> {
|
||||||
|
Ok(Self {
|
||||||
|
price: ComputedVecsFromDateIndex::forced_import(
|
||||||
|
path,
|
||||||
|
name,
|
||||||
|
VERSION + version,
|
||||||
|
compressed,
|
||||||
|
options,
|
||||||
|
)?,
|
||||||
|
ratio: ComputedVecsFromDateIndex::forced_import(
|
||||||
|
path,
|
||||||
|
&format!("{name}_ratio"),
|
||||||
|
VERSION + version + Version::TWO,
|
||||||
|
compressed,
|
||||||
|
options,
|
||||||
|
)?,
|
||||||
|
ratio_sma: ComputedVecsFromDateIndex::forced_import(
|
||||||
|
path,
|
||||||
|
&format!("{name}_ratio_sma"),
|
||||||
|
VERSION + version + Version::TWO,
|
||||||
|
compressed,
|
||||||
|
options,
|
||||||
|
)?,
|
||||||
|
ratio_1w_sma: ComputedVecsFromDateIndex::forced_import(
|
||||||
|
path,
|
||||||
|
&format!("{name}_ratio_1w_sma"),
|
||||||
|
VERSION + version + Version::TWO,
|
||||||
|
compressed,
|
||||||
|
options,
|
||||||
|
)?,
|
||||||
|
ratio_1m_sma: ComputedVecsFromDateIndex::forced_import(
|
||||||
|
path,
|
||||||
|
&format!("{name}_ratio_1m_sma"),
|
||||||
|
VERSION + version + Version::TWO,
|
||||||
|
compressed,
|
||||||
|
options,
|
||||||
|
)?,
|
||||||
|
ratio_1y_sma: ComputedVecsFromDateIndex::forced_import(
|
||||||
|
path,
|
||||||
|
&format!("{name}_ratio_1y_sma"),
|
||||||
|
VERSION + version + Version::TWO,
|
||||||
|
compressed,
|
||||||
|
options,
|
||||||
|
)?,
|
||||||
|
ratio_1y_sma_momentum_oscillator: ComputedVecsFromDateIndex::forced_import(
|
||||||
|
path,
|
||||||
|
&format!("{name}_ratio_1y_sma_momentum_oscillator"),
|
||||||
|
VERSION + version + Version::TWO,
|
||||||
|
compressed,
|
||||||
|
options,
|
||||||
|
)?,
|
||||||
|
ratio_standard_deviation: ComputedVecsFromDateIndex::forced_import(
|
||||||
|
path,
|
||||||
|
&format!("{name}_ratio_standard_deviation"),
|
||||||
|
VERSION + version + Version::TWO,
|
||||||
|
compressed,
|
||||||
|
options,
|
||||||
|
)?,
|
||||||
|
ratio_p99_9: ComputedVecsFromDateIndex::forced_import(
|
||||||
|
path,
|
||||||
|
&format!("{name}_ratio_p99_9"),
|
||||||
|
VERSION + version + Version::TWO,
|
||||||
|
compressed,
|
||||||
|
options,
|
||||||
|
)?,
|
||||||
|
ratio_p99_5: ComputedVecsFromDateIndex::forced_import(
|
||||||
|
path,
|
||||||
|
&format!("{name}_ratio_p99_5"),
|
||||||
|
VERSION + version + Version::TWO,
|
||||||
|
compressed,
|
||||||
|
options,
|
||||||
|
)?,
|
||||||
|
ratio_p99: ComputedVecsFromDateIndex::forced_import(
|
||||||
|
path,
|
||||||
|
&format!("{name}_ratio_p99"),
|
||||||
|
VERSION + version + Version::TWO,
|
||||||
|
compressed,
|
||||||
|
options,
|
||||||
|
)?,
|
||||||
|
ratio_p1: ComputedVecsFromDateIndex::forced_import(
|
||||||
|
path,
|
||||||
|
&format!("{name}_ratio_p1"),
|
||||||
|
VERSION + version + Version::TWO,
|
||||||
|
compressed,
|
||||||
|
options,
|
||||||
|
)?,
|
||||||
|
ratio_p0_5: ComputedVecsFromDateIndex::forced_import(
|
||||||
|
path,
|
||||||
|
&format!("{name}_ratio_p0_5"),
|
||||||
|
VERSION + version + Version::TWO,
|
||||||
|
compressed,
|
||||||
|
options,
|
||||||
|
)?,
|
||||||
|
ratio_p0_1: ComputedVecsFromDateIndex::forced_import(
|
||||||
|
path,
|
||||||
|
&format!("{name}_ratio_p0_1"),
|
||||||
|
VERSION + version + Version::TWO,
|
||||||
|
compressed,
|
||||||
|
options,
|
||||||
|
)?,
|
||||||
|
ratio_p1sd: ComputedVecsFromDateIndex::forced_import(
|
||||||
|
path,
|
||||||
|
&format!("{name}_ratio_p1sd"),
|
||||||
|
VERSION + version + Version::TWO,
|
||||||
|
compressed,
|
||||||
|
options,
|
||||||
|
)?,
|
||||||
|
ratio_p2sd: ComputedVecsFromDateIndex::forced_import(
|
||||||
|
path,
|
||||||
|
&format!("{name}_ratio_p2sd"),
|
||||||
|
VERSION + version + Version::TWO,
|
||||||
|
compressed,
|
||||||
|
options,
|
||||||
|
)?,
|
||||||
|
ratio_p3sd: ComputedVecsFromDateIndex::forced_import(
|
||||||
|
path,
|
||||||
|
&format!("{name}_ratio_p3sd"),
|
||||||
|
VERSION + version + Version::TWO,
|
||||||
|
compressed,
|
||||||
|
options,
|
||||||
|
)?,
|
||||||
|
ratio_m1sd: ComputedVecsFromDateIndex::forced_import(
|
||||||
|
path,
|
||||||
|
&format!("{name}_ratio_m1sd"),
|
||||||
|
VERSION + version + Version::TWO,
|
||||||
|
compressed,
|
||||||
|
options,
|
||||||
|
)?,
|
||||||
|
ratio_m2sd: ComputedVecsFromDateIndex::forced_import(
|
||||||
|
path,
|
||||||
|
&format!("{name}_ratio_m2sd"),
|
||||||
|
VERSION + version + Version::TWO,
|
||||||
|
compressed,
|
||||||
|
options,
|
||||||
|
)?,
|
||||||
|
ratio_m3sd: ComputedVecsFromDateIndex::forced_import(
|
||||||
|
path,
|
||||||
|
&format!("{name}_ratio_m3sd"),
|
||||||
|
VERSION + version + Version::TWO,
|
||||||
|
compressed,
|
||||||
|
options,
|
||||||
|
)?,
|
||||||
|
ratio_p99_9_as_price: ComputedVecsFromDateIndex::forced_import(
|
||||||
|
path,
|
||||||
|
&format!("{name}_ratio_p99_9_as_price"),
|
||||||
|
VERSION + version + Version::TWO,
|
||||||
|
compressed,
|
||||||
|
options,
|
||||||
|
)?,
|
||||||
|
ratio_p99_5_as_price: ComputedVecsFromDateIndex::forced_import(
|
||||||
|
path,
|
||||||
|
&format!("{name}_ratio_p99_5_as_price"),
|
||||||
|
VERSION + version + Version::TWO,
|
||||||
|
compressed,
|
||||||
|
options,
|
||||||
|
)?,
|
||||||
|
ratio_p99_as_price: ComputedVecsFromDateIndex::forced_import(
|
||||||
|
path,
|
||||||
|
&format!("{name}_ratio_p99_as_price"),
|
||||||
|
VERSION + version + Version::TWO,
|
||||||
|
compressed,
|
||||||
|
options,
|
||||||
|
)?,
|
||||||
|
ratio_p1_as_price: ComputedVecsFromDateIndex::forced_import(
|
||||||
|
path,
|
||||||
|
&format!("{name}_ratio_p1_as_price"),
|
||||||
|
VERSION + version + Version::TWO,
|
||||||
|
compressed,
|
||||||
|
options,
|
||||||
|
)?,
|
||||||
|
ratio_p0_5_as_price: ComputedVecsFromDateIndex::forced_import(
|
||||||
|
path,
|
||||||
|
&format!("{name}_ratio_p0_5_as_price"),
|
||||||
|
VERSION + version + Version::TWO,
|
||||||
|
compressed,
|
||||||
|
options,
|
||||||
|
)?,
|
||||||
|
ratio_p0_1_as_price: ComputedVecsFromDateIndex::forced_import(
|
||||||
|
path,
|
||||||
|
&format!("{name}_ratio_p0_1_as_price"),
|
||||||
|
VERSION + version + Version::TWO,
|
||||||
|
compressed,
|
||||||
|
options,
|
||||||
|
)?,
|
||||||
|
ratio_p1sd_as_price: ComputedVecsFromDateIndex::forced_import(
|
||||||
|
path,
|
||||||
|
&format!("{name}_ratio_p1sd_as_price"),
|
||||||
|
VERSION + version + Version::TWO,
|
||||||
|
compressed,
|
||||||
|
options,
|
||||||
|
)?,
|
||||||
|
ratio_p2sd_as_price: ComputedVecsFromDateIndex::forced_import(
|
||||||
|
path,
|
||||||
|
&format!("{name}_ratio_p2sd_as_price"),
|
||||||
|
VERSION + version + Version::TWO,
|
||||||
|
compressed,
|
||||||
|
options,
|
||||||
|
)?,
|
||||||
|
ratio_p3sd_as_price: ComputedVecsFromDateIndex::forced_import(
|
||||||
|
path,
|
||||||
|
&format!("{name}_ratio_p3sd_as_price"),
|
||||||
|
VERSION + version + Version::TWO,
|
||||||
|
compressed,
|
||||||
|
options,
|
||||||
|
)?,
|
||||||
|
ratio_m1sd_as_price: ComputedVecsFromDateIndex::forced_import(
|
||||||
|
path,
|
||||||
|
&format!("{name}_ratio_m1sd_as_price"),
|
||||||
|
VERSION + version + Version::TWO,
|
||||||
|
compressed,
|
||||||
|
options,
|
||||||
|
)?,
|
||||||
|
ratio_m2sd_as_price: ComputedVecsFromDateIndex::forced_import(
|
||||||
|
path,
|
||||||
|
&format!("{name}_ratio_m2sd_as_price"),
|
||||||
|
VERSION + version + Version::TWO,
|
||||||
|
compressed,
|
||||||
|
options,
|
||||||
|
)?,
|
||||||
|
ratio_m3sd_as_price: ComputedVecsFromDateIndex::forced_import(
|
||||||
|
path,
|
||||||
|
&format!("{name}_ratio_m3sd_as_price"),
|
||||||
|
VERSION + version + Version::TWO,
|
||||||
|
compressed,
|
||||||
|
options,
|
||||||
|
)?,
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
pub fn compute<F>(
|
||||||
|
&mut self,
|
||||||
|
indexer: &Indexer,
|
||||||
|
indexes: &indexes::Vecs,
|
||||||
|
fetched: &fetched::Vecs,
|
||||||
|
starting_indexes: &Indexes,
|
||||||
|
exit: &Exit,
|
||||||
|
compute: F,
|
||||||
|
) -> color_eyre::Result<()>
|
||||||
|
where
|
||||||
|
F: FnMut(
|
||||||
|
&mut EagerVec<DateIndex, Dollars>,
|
||||||
|
&Indexer,
|
||||||
|
&indexes::Vecs,
|
||||||
|
&Indexes,
|
||||||
|
&Exit,
|
||||||
|
) -> Result<()>,
|
||||||
|
{
|
||||||
|
self.price
|
||||||
|
.compute(indexer, indexes, starting_indexes, exit, compute)?;
|
||||||
|
|
||||||
|
let closes = &fetched.timeindexes_to_close.dateindex;
|
||||||
|
|
||||||
|
self.ratio.compute(
|
||||||
|
indexer,
|
||||||
|
indexes,
|
||||||
|
starting_indexes,
|
||||||
|
exit,
|
||||||
|
|v, _, _, starting_indexes, exit| {
|
||||||
|
let mut price = self.price.dateindex.into_iter();
|
||||||
|
v.compute_transform(
|
||||||
|
starting_indexes.dateindex,
|
||||||
|
closes,
|
||||||
|
|(i, close, ..)| {
|
||||||
|
let price = price.unwrap_get_inner(i);
|
||||||
|
if price == Dollars::ZERO {
|
||||||
|
(i, StoredF32::from(1.0))
|
||||||
|
} else {
|
||||||
|
(i, *close / price)
|
||||||
|
}
|
||||||
|
},
|
||||||
|
exit,
|
||||||
|
)
|
||||||
|
},
|
||||||
|
)?;
|
||||||
|
|
||||||
|
let min_ratio_date = DateIndex::try_from(Date::MIN_RATIO).unwrap();
|
||||||
|
|
||||||
|
self.ratio_sma.compute(
|
||||||
|
indexer,
|
||||||
|
indexes,
|
||||||
|
starting_indexes,
|
||||||
|
exit,
|
||||||
|
|v, _, _, starting_indexes, exit| {
|
||||||
|
v.compute_sma_(
|
||||||
|
starting_indexes.dateindex,
|
||||||
|
&self.ratio.dateindex,
|
||||||
|
usize::MAX,
|
||||||
|
exit,
|
||||||
|
Some(min_ratio_date),
|
||||||
|
)
|
||||||
|
},
|
||||||
|
)?;
|
||||||
|
|
||||||
|
self.ratio_1w_sma.compute(
|
||||||
|
indexer,
|
||||||
|
indexes,
|
||||||
|
starting_indexes,
|
||||||
|
exit,
|
||||||
|
|v, _, _, starting_indexes, exit| {
|
||||||
|
v.compute_sma_(
|
||||||
|
starting_indexes.dateindex,
|
||||||
|
&self.ratio.dateindex,
|
||||||
|
7,
|
||||||
|
exit,
|
||||||
|
Some(min_ratio_date),
|
||||||
|
)
|
||||||
|
},
|
||||||
|
)?;
|
||||||
|
|
||||||
|
self.ratio_1m_sma.compute(
|
||||||
|
indexer,
|
||||||
|
indexes,
|
||||||
|
starting_indexes,
|
||||||
|
exit,
|
||||||
|
|v, _, _, starting_indexes, exit| {
|
||||||
|
v.compute_sma_(
|
||||||
|
starting_indexes.dateindex,
|
||||||
|
&self.ratio.dateindex,
|
||||||
|
30,
|
||||||
|
exit,
|
||||||
|
Some(min_ratio_date),
|
||||||
|
)
|
||||||
|
},
|
||||||
|
)?;
|
||||||
|
|
||||||
|
self.ratio_1y_sma.compute(
|
||||||
|
indexer,
|
||||||
|
indexes,
|
||||||
|
starting_indexes,
|
||||||
|
exit,
|
||||||
|
|v, _, _, starting_indexes, exit| {
|
||||||
|
v.compute_sma_(
|
||||||
|
starting_indexes.dateindex,
|
||||||
|
&self.ratio.dateindex,
|
||||||
|
365,
|
||||||
|
exit,
|
||||||
|
Some(min_ratio_date),
|
||||||
|
)
|
||||||
|
},
|
||||||
|
)?;
|
||||||
|
|
||||||
|
self.ratio_1y_sma_momentum_oscillator.compute(
|
||||||
|
indexer,
|
||||||
|
indexes,
|
||||||
|
starting_indexes,
|
||||||
|
exit,
|
||||||
|
|v, _, _, starting_indexes, exit| {
|
||||||
|
let mut ratio_1y_sma_iter = self.ratio_1y_sma.dateindex.into_iter();
|
||||||
|
v.compute_transform(
|
||||||
|
starting_indexes.dateindex,
|
||||||
|
&self.ratio.dateindex,
|
||||||
|
|(i, ratio, ..)| {
|
||||||
|
(
|
||||||
|
i,
|
||||||
|
StoredF32::from(*ratio / *ratio_1y_sma_iter.unwrap_get_inner(i) - 1.0),
|
||||||
|
)
|
||||||
|
},
|
||||||
|
exit,
|
||||||
|
)
|
||||||
|
},
|
||||||
|
)?;
|
||||||
|
|
||||||
|
let ratio_version = self.ratio.dateindex.version();
|
||||||
|
|
||||||
|
self.mut_ratio_vecs()
|
||||||
|
.iter_mut()
|
||||||
|
.try_for_each(|v| -> Result<()> {
|
||||||
|
v.validate_computed_version_or_reset_file(
|
||||||
|
Version::ZERO + v.inner_version() + ratio_version,
|
||||||
|
)
|
||||||
|
})?;
|
||||||
|
|
||||||
|
let starting_dateindex = self
|
||||||
|
.mut_ratio_vecs()
|
||||||
|
.iter()
|
||||||
|
.map(|v| DateIndex::from(v.len()))
|
||||||
|
.min()
|
||||||
|
.unwrap()
|
||||||
|
.min(starting_indexes.dateindex);
|
||||||
|
|
||||||
|
let mut sorted = self.ratio.dateindex.collect_range(
|
||||||
|
Some(min_ratio_date.unwrap_to_usize()),
|
||||||
|
Some(starting_dateindex.unwrap_to_usize()),
|
||||||
|
)?;
|
||||||
|
|
||||||
|
sorted.sort_unstable();
|
||||||
|
|
||||||
|
// if sorted.len() != starting_dateindex.unwrap_to_usize() - min_ratio_date.unwrap_to_usize() {
|
||||||
|
// unreachable!();
|
||||||
|
// }
|
||||||
|
|
||||||
|
let mut sma_iter = self.ratio_sma.dateindex.into_iter();
|
||||||
|
|
||||||
|
let nan = StoredF32::from(f32::NAN);
|
||||||
|
self.ratio
|
||||||
|
.dateindex
|
||||||
|
.iter_at(starting_dateindex)
|
||||||
|
.try_for_each(|(index, ratio)| -> Result<()> {
|
||||||
|
if index < min_ratio_date {
|
||||||
|
self.ratio_p0_1.dateindex.forced_push_at(index, nan, exit)?;
|
||||||
|
self.ratio_p0_5.dateindex.forced_push_at(index, nan, exit)?;
|
||||||
|
self.ratio_p1.dateindex.forced_push_at(index, nan, exit)?;
|
||||||
|
self.ratio_p99.dateindex.forced_push_at(index, nan, exit)?;
|
||||||
|
self.ratio_p99_5
|
||||||
|
.dateindex
|
||||||
|
.forced_push_at(index, nan, exit)?;
|
||||||
|
self.ratio_p99_9
|
||||||
|
.dateindex
|
||||||
|
.forced_push_at(index, nan, exit)?;
|
||||||
|
self.ratio_standard_deviation
|
||||||
|
.dateindex
|
||||||
|
.forced_push_at(index, nan, exit)?;
|
||||||
|
|
||||||
|
self.ratio_p1sd.dateindex.forced_push_at(index, nan, exit)?;
|
||||||
|
self.ratio_p2sd.dateindex.forced_push_at(index, nan, exit)?;
|
||||||
|
self.ratio_p3sd.dateindex.forced_push_at(index, nan, exit)?;
|
||||||
|
self.ratio_m1sd.dateindex.forced_push_at(index, nan, exit)?;
|
||||||
|
self.ratio_m2sd.dateindex.forced_push_at(index, nan, exit)?;
|
||||||
|
self.ratio_m3sd.dateindex.forced_push_at(index, nan, exit)?;
|
||||||
|
} else {
|
||||||
|
let ratio = ratio.into_inner();
|
||||||
|
let pos = sorted.binary_search(&ratio).unwrap_or_else(|pos| pos);
|
||||||
|
sorted.insert(pos, ratio);
|
||||||
|
self.ratio_p0_1.dateindex.forced_push_at(
|
||||||
|
index,
|
||||||
|
get_percentile(&sorted, 0.001),
|
||||||
|
exit,
|
||||||
|
)?;
|
||||||
|
self.ratio_p0_5.dateindex.forced_push_at(
|
||||||
|
index,
|
||||||
|
get_percentile(&sorted, 0.005),
|
||||||
|
exit,
|
||||||
|
)?;
|
||||||
|
self.ratio_p1.dateindex.forced_push_at(
|
||||||
|
index,
|
||||||
|
get_percentile(&sorted, 0.01),
|
||||||
|
exit,
|
||||||
|
)?;
|
||||||
|
self.ratio_p99.dateindex.forced_push_at(
|
||||||
|
index,
|
||||||
|
get_percentile(&sorted, 0.99),
|
||||||
|
exit,
|
||||||
|
)?;
|
||||||
|
self.ratio_p99_5.dateindex.forced_push_at(
|
||||||
|
index,
|
||||||
|
get_percentile(&sorted, 0.995),
|
||||||
|
exit,
|
||||||
|
)?;
|
||||||
|
self.ratio_p99_9.dateindex.forced_push_at(
|
||||||
|
index,
|
||||||
|
get_percentile(&sorted, 0.999),
|
||||||
|
exit,
|
||||||
|
)?;
|
||||||
|
|
||||||
|
let avg = sma_iter.unwrap_get_inner(index);
|
||||||
|
|
||||||
|
let sd = StoredF32::from(
|
||||||
|
(sorted.iter().map(|v| (**v - *avg).powi(2)).sum::<f32>()
|
||||||
|
/ (index.unwrap_to_usize() + 1) as f32)
|
||||||
|
.sqrt(),
|
||||||
|
);
|
||||||
|
|
||||||
|
self.ratio_standard_deviation
|
||||||
|
.dateindex
|
||||||
|
.forced_push_at(index, sd, exit)?;
|
||||||
|
|
||||||
|
self.ratio_p1sd
|
||||||
|
.dateindex
|
||||||
|
.forced_push_at(index, avg + sd, exit)?;
|
||||||
|
self.ratio_p2sd
|
||||||
|
.dateindex
|
||||||
|
.forced_push_at(index, avg + 2 * sd, exit)?;
|
||||||
|
self.ratio_p3sd
|
||||||
|
.dateindex
|
||||||
|
.forced_push_at(index, avg + 3 * sd, exit)?;
|
||||||
|
self.ratio_m1sd
|
||||||
|
.dateindex
|
||||||
|
.forced_push_at(index, avg - sd, exit)?;
|
||||||
|
self.ratio_m2sd
|
||||||
|
.dateindex
|
||||||
|
.forced_push_at(index, avg - 2 * sd, exit)?;
|
||||||
|
self.ratio_m3sd
|
||||||
|
.dateindex
|
||||||
|
.forced_push_at(index, avg - 3 * sd, exit)?;
|
||||||
|
}
|
||||||
|
|
||||||
|
Ok(())
|
||||||
|
})?;
|
||||||
|
|
||||||
|
self.mut_ratio_vecs()
|
||||||
|
.into_iter()
|
||||||
|
.try_for_each(|v| v.safe_flush(exit))?;
|
||||||
|
|
||||||
|
self.ratio_p99_9
|
||||||
|
.compute_rest(indexes, starting_indexes, exit)?;
|
||||||
|
self.ratio_p99_5
|
||||||
|
.compute_rest(indexes, starting_indexes, exit)?;
|
||||||
|
self.ratio_p99
|
||||||
|
.compute_rest(indexes, starting_indexes, exit)?;
|
||||||
|
self.ratio_p1
|
||||||
|
.compute_rest(indexes, starting_indexes, exit)?;
|
||||||
|
self.ratio_p0_5
|
||||||
|
.compute_rest(indexes, starting_indexes, exit)?;
|
||||||
|
self.ratio_p0_1
|
||||||
|
.compute_rest(indexes, starting_indexes, exit)?;
|
||||||
|
self.ratio_standard_deviation
|
||||||
|
.compute_rest(indexes, starting_indexes, exit)?;
|
||||||
|
self.ratio_p1sd
|
||||||
|
.compute_rest(indexes, starting_indexes, exit)?;
|
||||||
|
self.ratio_p2sd
|
||||||
|
.compute_rest(indexes, starting_indexes, exit)?;
|
||||||
|
self.ratio_p3sd
|
||||||
|
.compute_rest(indexes, starting_indexes, exit)?;
|
||||||
|
self.ratio_m1sd
|
||||||
|
.compute_rest(indexes, starting_indexes, exit)?;
|
||||||
|
self.ratio_m2sd
|
||||||
|
.compute_rest(indexes, starting_indexes, exit)?;
|
||||||
|
self.ratio_m3sd
|
||||||
|
.compute_rest(indexes, starting_indexes, exit)?;
|
||||||
|
|
||||||
|
self.ratio_p99_as_price.compute(
|
||||||
|
indexer,
|
||||||
|
indexes,
|
||||||
|
starting_indexes,
|
||||||
|
exit,
|
||||||
|
|vec, _, _, starting_indexes, exit| {
|
||||||
|
let mut iter = self.ratio_p99.dateindex.into_iter();
|
||||||
|
vec.compute_transform(
|
||||||
|
starting_indexes.dateindex,
|
||||||
|
&self.price.dateindex,
|
||||||
|
|(i, price, ..)| {
|
||||||
|
let multiplier = iter.unwrap_get_inner(i);
|
||||||
|
(i, price * multiplier)
|
||||||
|
},
|
||||||
|
exit,
|
||||||
|
)
|
||||||
|
},
|
||||||
|
)?;
|
||||||
|
|
||||||
|
self.ratio_p99_5_as_price.compute(
|
||||||
|
indexer,
|
||||||
|
indexes,
|
||||||
|
starting_indexes,
|
||||||
|
exit,
|
||||||
|
|vec, _, _, starting_indexes, exit| {
|
||||||
|
let mut iter = self.ratio_p99_5.dateindex.into_iter();
|
||||||
|
vec.compute_transform(
|
||||||
|
starting_indexes.dateindex,
|
||||||
|
&self.price.dateindex,
|
||||||
|
|(i, price, ..)| {
|
||||||
|
let multiplier = iter.unwrap_get_inner(i);
|
||||||
|
(i, price * multiplier)
|
||||||
|
},
|
||||||
|
exit,
|
||||||
|
)
|
||||||
|
},
|
||||||
|
)?;
|
||||||
|
|
||||||
|
self.ratio_p99_9_as_price.compute(
|
||||||
|
indexer,
|
||||||
|
indexes,
|
||||||
|
starting_indexes,
|
||||||
|
exit,
|
||||||
|
|vec, _, _, starting_indexes, exit| {
|
||||||
|
let mut iter = self.ratio_p99_9.dateindex.into_iter();
|
||||||
|
vec.compute_transform(
|
||||||
|
starting_indexes.dateindex,
|
||||||
|
&self.price.dateindex,
|
||||||
|
|(i, price, ..)| {
|
||||||
|
let multiplier = iter.unwrap_get_inner(i);
|
||||||
|
(i, price * multiplier)
|
||||||
|
},
|
||||||
|
exit,
|
||||||
|
)
|
||||||
|
},
|
||||||
|
)?;
|
||||||
|
|
||||||
|
self.ratio_p1_as_price.compute(
|
||||||
|
indexer,
|
||||||
|
indexes,
|
||||||
|
starting_indexes,
|
||||||
|
exit,
|
||||||
|
|vec, _, _, starting_indexes, exit| {
|
||||||
|
let mut iter = self.ratio_p1.dateindex.into_iter();
|
||||||
|
vec.compute_transform(
|
||||||
|
starting_indexes.dateindex,
|
||||||
|
&self.price.dateindex,
|
||||||
|
|(i, price, ..)| {
|
||||||
|
let multiplier = iter.unwrap_get_inner(i);
|
||||||
|
(i, price * multiplier)
|
||||||
|
},
|
||||||
|
exit,
|
||||||
|
)
|
||||||
|
},
|
||||||
|
)?;
|
||||||
|
|
||||||
|
self.ratio_p0_5_as_price.compute(
|
||||||
|
indexer,
|
||||||
|
indexes,
|
||||||
|
starting_indexes,
|
||||||
|
exit,
|
||||||
|
|vec, _, _, starting_indexes, exit| {
|
||||||
|
let mut iter = self.ratio_p0_5.dateindex.into_iter();
|
||||||
|
vec.compute_transform(
|
||||||
|
starting_indexes.dateindex,
|
||||||
|
&self.price.dateindex,
|
||||||
|
|(i, price, ..)| {
|
||||||
|
let multiplier = iter.unwrap_get_inner(i);
|
||||||
|
(i, price * multiplier)
|
||||||
|
},
|
||||||
|
exit,
|
||||||
|
)
|
||||||
|
},
|
||||||
|
)?;
|
||||||
|
|
||||||
|
self.ratio_p0_1_as_price.compute(
|
||||||
|
indexer,
|
||||||
|
indexes,
|
||||||
|
starting_indexes,
|
||||||
|
exit,
|
||||||
|
|vec, _, _, starting_indexes, exit| {
|
||||||
|
let mut iter = self.ratio_p0_1.dateindex.into_iter();
|
||||||
|
vec.compute_transform(
|
||||||
|
starting_indexes.dateindex,
|
||||||
|
&self.price.dateindex,
|
||||||
|
|(i, price, ..)| {
|
||||||
|
let multiplier = iter.unwrap_get_inner(i);
|
||||||
|
(i, price * multiplier)
|
||||||
|
},
|
||||||
|
exit,
|
||||||
|
)
|
||||||
|
},
|
||||||
|
)?;
|
||||||
|
|
||||||
|
self.ratio_p1sd_as_price.compute(
|
||||||
|
indexer,
|
||||||
|
indexes,
|
||||||
|
starting_indexes,
|
||||||
|
exit,
|
||||||
|
|vec, _, _, starting_indexes, exit| {
|
||||||
|
let mut iter = self.ratio_p1sd.dateindex.into_iter();
|
||||||
|
vec.compute_transform(
|
||||||
|
starting_indexes.dateindex,
|
||||||
|
&self.price.dateindex,
|
||||||
|
|(i, price, ..)| {
|
||||||
|
let multiplier = iter.unwrap_get_inner(i);
|
||||||
|
(i, price * multiplier)
|
||||||
|
},
|
||||||
|
exit,
|
||||||
|
)
|
||||||
|
},
|
||||||
|
)?;
|
||||||
|
|
||||||
|
self.ratio_p2sd_as_price.compute(
|
||||||
|
indexer,
|
||||||
|
indexes,
|
||||||
|
starting_indexes,
|
||||||
|
exit,
|
||||||
|
|vec, _, _, starting_indexes, exit| {
|
||||||
|
let mut iter = self.ratio_p2sd.dateindex.into_iter();
|
||||||
|
vec.compute_transform(
|
||||||
|
starting_indexes.dateindex,
|
||||||
|
&self.price.dateindex,
|
||||||
|
|(i, price, ..)| {
|
||||||
|
let multiplier = iter.unwrap_get_inner(i);
|
||||||
|
(i, price * multiplier)
|
||||||
|
},
|
||||||
|
exit,
|
||||||
|
)
|
||||||
|
},
|
||||||
|
)?;
|
||||||
|
|
||||||
|
self.ratio_p3sd_as_price.compute(
|
||||||
|
indexer,
|
||||||
|
indexes,
|
||||||
|
starting_indexes,
|
||||||
|
exit,
|
||||||
|
|vec, _, _, starting_indexes, exit| {
|
||||||
|
let mut iter = self.ratio_p3sd.dateindex.into_iter();
|
||||||
|
vec.compute_transform(
|
||||||
|
starting_indexes.dateindex,
|
||||||
|
&self.price.dateindex,
|
||||||
|
|(i, price, ..)| {
|
||||||
|
let multiplier = iter.unwrap_get_inner(i);
|
||||||
|
(i, price * multiplier)
|
||||||
|
},
|
||||||
|
exit,
|
||||||
|
)
|
||||||
|
},
|
||||||
|
)?;
|
||||||
|
|
||||||
|
self.ratio_m1sd_as_price.compute(
|
||||||
|
indexer,
|
||||||
|
indexes,
|
||||||
|
starting_indexes,
|
||||||
|
exit,
|
||||||
|
|vec, _, _, starting_indexes, exit| {
|
||||||
|
let mut iter = self.ratio_m1sd.dateindex.into_iter();
|
||||||
|
vec.compute_transform(
|
||||||
|
starting_indexes.dateindex,
|
||||||
|
&self.price.dateindex,
|
||||||
|
|(i, price, ..)| {
|
||||||
|
let multiplier = iter.unwrap_get_inner(i);
|
||||||
|
(i, price * multiplier)
|
||||||
|
},
|
||||||
|
exit,
|
||||||
|
)
|
||||||
|
},
|
||||||
|
)?;
|
||||||
|
|
||||||
|
self.ratio_m2sd_as_price.compute(
|
||||||
|
indexer,
|
||||||
|
indexes,
|
||||||
|
starting_indexes,
|
||||||
|
exit,
|
||||||
|
|vec, _, _, starting_indexes, exit| {
|
||||||
|
let mut iter = self.ratio_m2sd.dateindex.into_iter();
|
||||||
|
vec.compute_transform(
|
||||||
|
starting_indexes.dateindex,
|
||||||
|
&self.price.dateindex,
|
||||||
|
|(i, price, ..)| {
|
||||||
|
let multiplier = iter.unwrap_get_inner(i);
|
||||||
|
(i, price * multiplier)
|
||||||
|
},
|
||||||
|
exit,
|
||||||
|
)
|
||||||
|
},
|
||||||
|
)?;
|
||||||
|
|
||||||
|
self.ratio_m3sd_as_price.compute(
|
||||||
|
indexer,
|
||||||
|
indexes,
|
||||||
|
starting_indexes,
|
||||||
|
exit,
|
||||||
|
|vec, _, _, starting_indexes, exit| {
|
||||||
|
let mut iter = self.ratio_m3sd.dateindex.into_iter();
|
||||||
|
vec.compute_transform(
|
||||||
|
starting_indexes.dateindex,
|
||||||
|
&self.price.dateindex,
|
||||||
|
|(i, price, ..)| {
|
||||||
|
let multiplier = iter.unwrap_get_inner(i);
|
||||||
|
(i, price * multiplier)
|
||||||
|
},
|
||||||
|
exit,
|
||||||
|
)
|
||||||
|
},
|
||||||
|
)?;
|
||||||
|
|
||||||
|
Ok(())
|
||||||
|
}
|
||||||
|
|
||||||
|
fn mut_ratio_vecs(&mut self) -> Vec<&mut EagerVec<DateIndex, StoredF32>> {
|
||||||
|
vec![
|
||||||
|
&mut self.ratio_standard_deviation.dateindex,
|
||||||
|
&mut self.ratio_p99_9.dateindex,
|
||||||
|
&mut self.ratio_p99_5.dateindex,
|
||||||
|
&mut self.ratio_p99.dateindex,
|
||||||
|
&mut self.ratio_p1.dateindex,
|
||||||
|
&mut self.ratio_p0_5.dateindex,
|
||||||
|
&mut self.ratio_p0_1.dateindex,
|
||||||
|
&mut self.ratio_p1sd.dateindex,
|
||||||
|
&mut self.ratio_p2sd.dateindex,
|
||||||
|
&mut self.ratio_p3sd.dateindex,
|
||||||
|
&mut self.ratio_m1sd.dateindex,
|
||||||
|
&mut self.ratio_m2sd.dateindex,
|
||||||
|
&mut self.ratio_m3sd.dateindex,
|
||||||
|
]
|
||||||
|
}
|
||||||
|
|
||||||
|
pub fn vecs(&self) -> Vec<&dyn AnyCollectableVec> {
|
||||||
|
[
|
||||||
|
self.price.vecs(),
|
||||||
|
self.ratio.vecs(),
|
||||||
|
self.ratio_sma.vecs(),
|
||||||
|
self.ratio_1w_sma.vecs(),
|
||||||
|
self.ratio_1m_sma.vecs(),
|
||||||
|
self.ratio_1y_sma.vecs(),
|
||||||
|
self.ratio_1y_sma_momentum_oscillator.vecs(),
|
||||||
|
self.ratio_standard_deviation.vecs(),
|
||||||
|
self.ratio_p99_9.vecs(),
|
||||||
|
self.ratio_p99_5.vecs(),
|
||||||
|
self.ratio_p99.vecs(),
|
||||||
|
self.ratio_p1.vecs(),
|
||||||
|
self.ratio_p0_5.vecs(),
|
||||||
|
self.ratio_p0_1.vecs(),
|
||||||
|
self.ratio_p1sd.vecs(),
|
||||||
|
self.ratio_p2sd.vecs(),
|
||||||
|
self.ratio_p3sd.vecs(),
|
||||||
|
self.ratio_m1sd.vecs(),
|
||||||
|
self.ratio_m2sd.vecs(),
|
||||||
|
self.ratio_m3sd.vecs(),
|
||||||
|
self.ratio_p99_9_as_price.vecs(),
|
||||||
|
self.ratio_p99_5_as_price.vecs(),
|
||||||
|
self.ratio_p99_as_price.vecs(),
|
||||||
|
self.ratio_p1_as_price.vecs(),
|
||||||
|
self.ratio_p0_5_as_price.vecs(),
|
||||||
|
self.ratio_p0_1_as_price.vecs(),
|
||||||
|
self.ratio_p1sd_as_price.vecs(),
|
||||||
|
self.ratio_p2sd_as_price.vecs(),
|
||||||
|
self.ratio_p3sd_as_price.vecs(),
|
||||||
|
self.ratio_m1sd_as_price.vecs(),
|
||||||
|
self.ratio_m2sd_as_price.vecs(),
|
||||||
|
self.ratio_m3sd_as_price.vecs(),
|
||||||
|
]
|
||||||
|
.concat()
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -8,7 +8,7 @@ use brk_vec::{
|
|||||||
};
|
};
|
||||||
|
|
||||||
use crate::storage::{
|
use crate::storage::{
|
||||||
marketprice,
|
fetched,
|
||||||
vecs::{Indexes, indexes},
|
vecs::{Indexes, indexes},
|
||||||
};
|
};
|
||||||
|
|
||||||
@@ -68,7 +68,7 @@ impl ComputedValueVecsFromHeight {
|
|||||||
&mut self,
|
&mut self,
|
||||||
indexer: &Indexer,
|
indexer: &Indexer,
|
||||||
indexes: &indexes::Vecs,
|
indexes: &indexes::Vecs,
|
||||||
marketprices: Option<&marketprice::Vecs>,
|
fetched: Option<&fetched::Vecs>,
|
||||||
starting_indexes: &Indexes,
|
starting_indexes: &Indexes,
|
||||||
exit: &Exit,
|
exit: &Exit,
|
||||||
mut compute: F,
|
mut compute: F,
|
||||||
@@ -91,14 +91,7 @@ impl ComputedValueVecsFromHeight {
|
|||||||
)?;
|
)?;
|
||||||
|
|
||||||
let height: Option<&StoredVec<Height, Sats>> = None;
|
let height: Option<&StoredVec<Height, Sats>> = None;
|
||||||
self.compute_rest(
|
self.compute_rest(indexer, indexes, fetched, starting_indexes, exit, height)?;
|
||||||
indexer,
|
|
||||||
indexes,
|
|
||||||
marketprices,
|
|
||||||
starting_indexes,
|
|
||||||
exit,
|
|
||||||
height,
|
|
||||||
)?;
|
|
||||||
|
|
||||||
Ok(())
|
Ok(())
|
||||||
}
|
}
|
||||||
@@ -107,7 +100,7 @@ impl ComputedValueVecsFromHeight {
|
|||||||
&mut self,
|
&mut self,
|
||||||
indexer: &Indexer,
|
indexer: &Indexer,
|
||||||
indexes: &indexes::Vecs,
|
indexes: &indexes::Vecs,
|
||||||
marketprices: Option<&marketprice::Vecs>,
|
fetched: Option<&fetched::Vecs>,
|
||||||
starting_indexes: &Indexes,
|
starting_indexes: &Indexes,
|
||||||
exit: &Exit,
|
exit: &Exit,
|
||||||
height: Option<&impl CollectableVec<Height, Sats>>,
|
height: Option<&impl CollectableVec<Height, Sats>>,
|
||||||
@@ -147,7 +140,7 @@ impl ComputedValueVecsFromHeight {
|
|||||||
}
|
}
|
||||||
|
|
||||||
let txindex = self.bitcoin.height.as_ref().unwrap();
|
let txindex = self.bitcoin.height.as_ref().unwrap();
|
||||||
let price = &marketprices.as_ref().unwrap().chainindexes_to_close.height;
|
let price = &fetched.as_ref().unwrap().chainindexes_to_close.height;
|
||||||
|
|
||||||
if let Some(dollars) = self.dollars.as_mut() {
|
if let Some(dollars) = self.dollars.as_mut() {
|
||||||
dollars.compute_all(
|
dollars.compute_all(
|
||||||
|
|||||||
@@ -9,7 +9,7 @@ use brk_vec::{
|
|||||||
};
|
};
|
||||||
|
|
||||||
use crate::storage::{
|
use crate::storage::{
|
||||||
marketprice,
|
fetched,
|
||||||
vecs::{Indexes, indexes},
|
vecs::{Indexes, indexes},
|
||||||
};
|
};
|
||||||
|
|
||||||
@@ -48,11 +48,11 @@ impl ComputedValueVecsFromTxindex {
|
|||||||
version: Version,
|
version: Version,
|
||||||
computation: Computation,
|
computation: Computation,
|
||||||
compressed: Compressed,
|
compressed: Compressed,
|
||||||
marketprices: Option<&marketprice::Vecs>,
|
fetched: Option<&fetched::Vecs>,
|
||||||
options: StorableVecGeneatorOptions,
|
options: StorableVecGeneatorOptions,
|
||||||
) -> color_eyre::Result<Self> {
|
) -> color_eyre::Result<Self> {
|
||||||
let compute_source = source.is_none();
|
let compute_source = source.is_none();
|
||||||
let compute_dollars = marketprices.is_some();
|
let compute_dollars = fetched.is_some();
|
||||||
|
|
||||||
let sats = ComputedVecsFromTxindex::forced_import(
|
let sats = ComputedVecsFromTxindex::forced_import(
|
||||||
path,
|
path,
|
||||||
@@ -84,7 +84,7 @@ impl ComputedValueVecsFromTxindex {
|
|||||||
options,
|
options,
|
||||||
)?;
|
)?;
|
||||||
|
|
||||||
let dollars_txindex = marketprices.map(|marketprices| {
|
let dollars_txindex = fetched.map(|fetched| {
|
||||||
ComputedVecFrom3::forced_import_or_init_from_3(
|
ComputedVecFrom3::forced_import_or_init_from_3(
|
||||||
computation,
|
computation,
|
||||||
path,
|
path,
|
||||||
@@ -93,7 +93,7 @@ impl ComputedValueVecsFromTxindex {
|
|||||||
compressed,
|
compressed,
|
||||||
bitcoin_txindex.boxed_clone(),
|
bitcoin_txindex.boxed_clone(),
|
||||||
indexes.txindex_to_height.boxed_clone(),
|
indexes.txindex_to_height.boxed_clone(),
|
||||||
marketprices.chainindexes_to_close.height.boxed_clone(),
|
fetched.chainindexes_to_close.height.boxed_clone(),
|
||||||
|txindex: TxIndex,
|
|txindex: TxIndex,
|
||||||
txindex_to_btc_iter,
|
txindex_to_btc_iter,
|
||||||
txindex_to_height_iter,
|
txindex_to_height_iter,
|
||||||
@@ -138,7 +138,7 @@ impl ComputedValueVecsFromTxindex {
|
|||||||
// &mut self,
|
// &mut self,
|
||||||
// indexer: &Indexer,
|
// indexer: &Indexer,
|
||||||
// indexes: &indexes::Vecs,
|
// indexes: &indexes::Vecs,
|
||||||
// marketprices: Option<&marketprice::Vecs>,
|
// fetched: Option<&marketprice::Vecs>,
|
||||||
// starting_indexes: &Indexes,
|
// starting_indexes: &Indexes,
|
||||||
// exit: &Exit,
|
// exit: &Exit,
|
||||||
// mut compute: F,
|
// mut compute: F,
|
||||||
@@ -164,7 +164,7 @@ impl ComputedValueVecsFromTxindex {
|
|||||||
// self.compute_rest(
|
// self.compute_rest(
|
||||||
// indexer,
|
// indexer,
|
||||||
// indexes,
|
// indexes,
|
||||||
// marketprices,
|
// fetched,
|
||||||
// starting_indexes,
|
// starting_indexes,
|
||||||
// exit,
|
// exit,
|
||||||
// txindex,
|
// txindex,
|
||||||
|
|||||||
@@ -0,0 +1,610 @@
|
|||||||
|
use std::{fs, path::Path, thread};
|
||||||
|
|
||||||
|
use brk_core::{Dollars, StoredF64, StoredUsize};
|
||||||
|
use brk_exit::Exit;
|
||||||
|
use brk_indexer::Indexer;
|
||||||
|
use brk_vec::{AnyCollectableVec, Compressed, Computation, StoredIndex, VecIterator, Version};
|
||||||
|
|
||||||
|
use super::{
|
||||||
|
Indexes, fetched,
|
||||||
|
grouped::{
|
||||||
|
ComputedRatioVecsFromDateIndex, ComputedVecsFromDateIndex, StorableVecGeneatorOptions,
|
||||||
|
},
|
||||||
|
indexes, transactions,
|
||||||
|
};
|
||||||
|
|
||||||
|
#[derive(Clone)]
|
||||||
|
pub struct Vecs {
|
||||||
|
pub indexes_to_marketcap: ComputedVecsFromDateIndex<Dollars>,
|
||||||
|
pub indexes_to_ath: ComputedVecsFromDateIndex<Dollars>,
|
||||||
|
pub indexes_to_drawdown: ComputedVecsFromDateIndex<StoredF64>,
|
||||||
|
pub indexes_to_days_since_ath: ComputedVecsFromDateIndex<StoredUsize>,
|
||||||
|
pub indexes_to_max_days_between_ath: ComputedVecsFromDateIndex<StoredUsize>,
|
||||||
|
pub indexes_to_max_years_between_ath: ComputedVecsFromDateIndex<StoredF64>,
|
||||||
|
|
||||||
|
pub indexes_to_1w_sma: ComputedRatioVecsFromDateIndex,
|
||||||
|
pub indexes_to_8d_sma: ComputedRatioVecsFromDateIndex,
|
||||||
|
pub indexes_to_13d_sma: ComputedRatioVecsFromDateIndex,
|
||||||
|
pub indexes_to_21d_sma: ComputedRatioVecsFromDateIndex,
|
||||||
|
pub indexes_to_1m_sma: ComputedRatioVecsFromDateIndex,
|
||||||
|
pub indexes_to_34d_sma: ComputedRatioVecsFromDateIndex,
|
||||||
|
pub indexes_to_55d_sma: ComputedRatioVecsFromDateIndex,
|
||||||
|
pub indexes_to_89d_sma: ComputedRatioVecsFromDateIndex,
|
||||||
|
pub indexes_to_144d_sma: ComputedRatioVecsFromDateIndex,
|
||||||
|
pub indexes_to_1y_sma: ComputedRatioVecsFromDateIndex,
|
||||||
|
pub indexes_to_2y_sma: ComputedRatioVecsFromDateIndex,
|
||||||
|
pub indexes_to_200w_sma: ComputedRatioVecsFromDateIndex,
|
||||||
|
pub indexes_to_4y_sma: ComputedRatioVecsFromDateIndex,
|
||||||
|
}
|
||||||
|
|
||||||
|
impl Vecs {
|
||||||
|
pub fn forced_import(
|
||||||
|
path: &Path,
|
||||||
|
_computation: Computation,
|
||||||
|
compressed: Compressed,
|
||||||
|
) -> color_eyre::Result<Self> {
|
||||||
|
fs::create_dir_all(path)?;
|
||||||
|
|
||||||
|
Ok(Self {
|
||||||
|
indexes_to_marketcap: ComputedVecsFromDateIndex::forced_import(
|
||||||
|
path,
|
||||||
|
"marketcap",
|
||||||
|
Version::ZERO,
|
||||||
|
compressed,
|
||||||
|
StorableVecGeneatorOptions::default().add_last(),
|
||||||
|
)?,
|
||||||
|
indexes_to_ath: ComputedVecsFromDateIndex::forced_import(
|
||||||
|
path,
|
||||||
|
"ath",
|
||||||
|
Version::ZERO,
|
||||||
|
compressed,
|
||||||
|
StorableVecGeneatorOptions::default().add_last(),
|
||||||
|
)?,
|
||||||
|
indexes_to_drawdown: ComputedVecsFromDateIndex::forced_import(
|
||||||
|
path,
|
||||||
|
"drawdown",
|
||||||
|
Version::ONE,
|
||||||
|
compressed,
|
||||||
|
StorableVecGeneatorOptions::default().add_last(),
|
||||||
|
)?,
|
||||||
|
indexes_to_days_since_ath: ComputedVecsFromDateIndex::forced_import(
|
||||||
|
path,
|
||||||
|
"days_since_ath",
|
||||||
|
Version::ZERO,
|
||||||
|
compressed,
|
||||||
|
StorableVecGeneatorOptions::default().add_last(),
|
||||||
|
)?,
|
||||||
|
indexes_to_max_days_between_ath: ComputedVecsFromDateIndex::forced_import(
|
||||||
|
path,
|
||||||
|
"max_days_between_ath",
|
||||||
|
Version::ZERO,
|
||||||
|
compressed,
|
||||||
|
StorableVecGeneatorOptions::default().add_last(),
|
||||||
|
)?,
|
||||||
|
indexes_to_max_years_between_ath: ComputedVecsFromDateIndex::forced_import(
|
||||||
|
path,
|
||||||
|
"max_years_between_ath",
|
||||||
|
Version::ZERO,
|
||||||
|
compressed,
|
||||||
|
StorableVecGeneatorOptions::default().add_last(),
|
||||||
|
)?,
|
||||||
|
|
||||||
|
indexes_to_1w_sma: ComputedRatioVecsFromDateIndex::forced_import(
|
||||||
|
path,
|
||||||
|
"1w_sma",
|
||||||
|
Version::ZERO,
|
||||||
|
compressed,
|
||||||
|
StorableVecGeneatorOptions::default().add_last(),
|
||||||
|
)?,
|
||||||
|
indexes_to_8d_sma: ComputedRatioVecsFromDateIndex::forced_import(
|
||||||
|
path,
|
||||||
|
"8d_sma",
|
||||||
|
Version::ZERO,
|
||||||
|
compressed,
|
||||||
|
StorableVecGeneatorOptions::default().add_last(),
|
||||||
|
)?,
|
||||||
|
indexes_to_13d_sma: ComputedRatioVecsFromDateIndex::forced_import(
|
||||||
|
path,
|
||||||
|
"13d_sma",
|
||||||
|
Version::ZERO,
|
||||||
|
compressed,
|
||||||
|
StorableVecGeneatorOptions::default().add_last(),
|
||||||
|
)?,
|
||||||
|
indexes_to_21d_sma: ComputedRatioVecsFromDateIndex::forced_import(
|
||||||
|
path,
|
||||||
|
"21d_sma",
|
||||||
|
Version::ZERO,
|
||||||
|
compressed,
|
||||||
|
StorableVecGeneatorOptions::default().add_last(),
|
||||||
|
)?,
|
||||||
|
indexes_to_1m_sma: ComputedRatioVecsFromDateIndex::forced_import(
|
||||||
|
path,
|
||||||
|
"1m_sma",
|
||||||
|
Version::ZERO,
|
||||||
|
compressed,
|
||||||
|
StorableVecGeneatorOptions::default().add_last(),
|
||||||
|
)?,
|
||||||
|
indexes_to_34d_sma: ComputedRatioVecsFromDateIndex::forced_import(
|
||||||
|
path,
|
||||||
|
"34d_sma",
|
||||||
|
Version::ZERO,
|
||||||
|
compressed,
|
||||||
|
StorableVecGeneatorOptions::default().add_last(),
|
||||||
|
)?,
|
||||||
|
indexes_to_55d_sma: ComputedRatioVecsFromDateIndex::forced_import(
|
||||||
|
path,
|
||||||
|
"55d_sma",
|
||||||
|
Version::ZERO,
|
||||||
|
compressed,
|
||||||
|
StorableVecGeneatorOptions::default().add_last(),
|
||||||
|
)?,
|
||||||
|
indexes_to_89d_sma: ComputedRatioVecsFromDateIndex::forced_import(
|
||||||
|
path,
|
||||||
|
"89d_sma",
|
||||||
|
Version::ZERO,
|
||||||
|
compressed,
|
||||||
|
StorableVecGeneatorOptions::default().add_last(),
|
||||||
|
)?,
|
||||||
|
indexes_to_144d_sma: ComputedRatioVecsFromDateIndex::forced_import(
|
||||||
|
path,
|
||||||
|
"144d_sma",
|
||||||
|
Version::ZERO,
|
||||||
|
compressed,
|
||||||
|
StorableVecGeneatorOptions::default().add_last(),
|
||||||
|
)?,
|
||||||
|
indexes_to_1y_sma: ComputedRatioVecsFromDateIndex::forced_import(
|
||||||
|
path,
|
||||||
|
"1y_sma",
|
||||||
|
Version::ZERO,
|
||||||
|
compressed,
|
||||||
|
StorableVecGeneatorOptions::default().add_last(),
|
||||||
|
)?,
|
||||||
|
indexes_to_2y_sma: ComputedRatioVecsFromDateIndex::forced_import(
|
||||||
|
path,
|
||||||
|
"2y_sma",
|
||||||
|
Version::ZERO,
|
||||||
|
compressed,
|
||||||
|
StorableVecGeneatorOptions::default().add_last(),
|
||||||
|
)?,
|
||||||
|
indexes_to_200w_sma: ComputedRatioVecsFromDateIndex::forced_import(
|
||||||
|
path,
|
||||||
|
"200w_sma",
|
||||||
|
Version::ZERO,
|
||||||
|
compressed,
|
||||||
|
StorableVecGeneatorOptions::default().add_last(),
|
||||||
|
)?,
|
||||||
|
indexes_to_4y_sma: ComputedRatioVecsFromDateIndex::forced_import(
|
||||||
|
path,
|
||||||
|
"4y_sma",
|
||||||
|
Version::ZERO,
|
||||||
|
compressed,
|
||||||
|
StorableVecGeneatorOptions::default().add_last(),
|
||||||
|
)?,
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
pub fn compute(
|
||||||
|
&mut self,
|
||||||
|
indexer: &Indexer,
|
||||||
|
indexes: &indexes::Vecs,
|
||||||
|
fetched: &fetched::Vecs,
|
||||||
|
transactions: &mut transactions::Vecs,
|
||||||
|
starting_indexes: &Indexes,
|
||||||
|
exit: &Exit,
|
||||||
|
) -> color_eyre::Result<()> {
|
||||||
|
self.indexes_to_marketcap.compute(
|
||||||
|
indexer,
|
||||||
|
indexes,
|
||||||
|
starting_indexes,
|
||||||
|
exit,
|
||||||
|
|v, _, _, starting_indexes, exit| {
|
||||||
|
let mut total_subsidy_in_btc = transactions
|
||||||
|
.indexes_to_subsidy
|
||||||
|
.bitcoin
|
||||||
|
.dateindex
|
||||||
|
.unwrap_total()
|
||||||
|
.into_iter();
|
||||||
|
v.compute_transform(
|
||||||
|
starting_indexes.dateindex,
|
||||||
|
&fetched.timeindexes_to_close.dateindex,
|
||||||
|
|(i, close, ..)| {
|
||||||
|
let supply = total_subsidy_in_btc.unwrap_get_inner(i);
|
||||||
|
(i, *close * supply)
|
||||||
|
},
|
||||||
|
exit,
|
||||||
|
)
|
||||||
|
},
|
||||||
|
)?;
|
||||||
|
|
||||||
|
self.indexes_to_ath.compute(
|
||||||
|
indexer,
|
||||||
|
indexes,
|
||||||
|
starting_indexes,
|
||||||
|
exit,
|
||||||
|
|v, _, _, starting_indexes, exit| {
|
||||||
|
let mut prev = None;
|
||||||
|
v.compute_transform(
|
||||||
|
starting_indexes.dateindex,
|
||||||
|
&fetched.timeindexes_to_high.dateindex,
|
||||||
|
|(i, high, slf)| {
|
||||||
|
if prev.is_none() {
|
||||||
|
let i = i.unwrap_to_usize();
|
||||||
|
prev.replace(if i > 0 {
|
||||||
|
slf.into_iter().unwrap_get_inner_(i - 1)
|
||||||
|
} else {
|
||||||
|
Dollars::ZERO
|
||||||
|
});
|
||||||
|
}
|
||||||
|
let ath = prev.unwrap().max(*high);
|
||||||
|
prev.replace(ath);
|
||||||
|
(i, ath)
|
||||||
|
},
|
||||||
|
exit,
|
||||||
|
)
|
||||||
|
},
|
||||||
|
)?;
|
||||||
|
|
||||||
|
self.indexes_to_drawdown.compute(
|
||||||
|
indexer,
|
||||||
|
indexes,
|
||||||
|
starting_indexes,
|
||||||
|
exit,
|
||||||
|
|v, _, _, starting_indexes, exit| {
|
||||||
|
let mut close_iter = fetched.timeindexes_to_close.dateindex.into_iter();
|
||||||
|
|
||||||
|
v.compute_transform(
|
||||||
|
starting_indexes.dateindex,
|
||||||
|
&self.indexes_to_ath.dateindex,
|
||||||
|
|(i, ath, ..)| {
|
||||||
|
if ath == Dollars::ZERO {
|
||||||
|
return (i, StoredF64::default());
|
||||||
|
}
|
||||||
|
let close = *close_iter.unwrap_get_inner(i);
|
||||||
|
let drawdown = StoredF64::from((*ath - *close) / *ath * -100.0);
|
||||||
|
(i, drawdown)
|
||||||
|
},
|
||||||
|
exit,
|
||||||
|
)
|
||||||
|
},
|
||||||
|
)?;
|
||||||
|
|
||||||
|
self.indexes_to_days_since_ath.compute(
|
||||||
|
indexer,
|
||||||
|
indexes,
|
||||||
|
starting_indexes,
|
||||||
|
exit,
|
||||||
|
|v, _, _, starting_indexes, exit| {
|
||||||
|
let mut high_iter = fetched.timeindexes_to_high.dateindex.into_iter();
|
||||||
|
let mut prev = None;
|
||||||
|
v.compute_transform(
|
||||||
|
starting_indexes.dateindex,
|
||||||
|
&self.indexes_to_ath.dateindex,
|
||||||
|
|(i, ath, slf)| {
|
||||||
|
if prev.is_none() {
|
||||||
|
let i = i.unwrap_to_usize();
|
||||||
|
prev.replace(if i > 0 {
|
||||||
|
slf.into_iter().unwrap_get_inner_(i - 1)
|
||||||
|
} else {
|
||||||
|
StoredUsize::default()
|
||||||
|
});
|
||||||
|
}
|
||||||
|
let days = if *high_iter.unwrap_get_inner(i) == ath {
|
||||||
|
StoredUsize::default()
|
||||||
|
} else {
|
||||||
|
prev.unwrap() + StoredUsize::from(1)
|
||||||
|
};
|
||||||
|
prev.replace(days);
|
||||||
|
(i, days)
|
||||||
|
},
|
||||||
|
exit,
|
||||||
|
)
|
||||||
|
},
|
||||||
|
)?;
|
||||||
|
|
||||||
|
self.indexes_to_max_days_between_ath.compute(
|
||||||
|
indexer,
|
||||||
|
indexes,
|
||||||
|
starting_indexes,
|
||||||
|
exit,
|
||||||
|
|v, _, _, starting_indexes, exit| {
|
||||||
|
let mut prev = None;
|
||||||
|
v.compute_transform(
|
||||||
|
starting_indexes.dateindex,
|
||||||
|
&self.indexes_to_days_since_ath.dateindex,
|
||||||
|
|(i, days, slf)| {
|
||||||
|
if prev.is_none() {
|
||||||
|
let i = i.unwrap_to_usize();
|
||||||
|
prev.replace(if i > 0 {
|
||||||
|
slf.into_iter().unwrap_get_inner_(i - 1)
|
||||||
|
} else {
|
||||||
|
StoredUsize::ZERO
|
||||||
|
});
|
||||||
|
}
|
||||||
|
let max = prev.unwrap().max(days);
|
||||||
|
prev.replace(max);
|
||||||
|
(i, max)
|
||||||
|
},
|
||||||
|
exit,
|
||||||
|
)
|
||||||
|
},
|
||||||
|
)?;
|
||||||
|
|
||||||
|
self.indexes_to_max_years_between_ath.compute(
|
||||||
|
indexer,
|
||||||
|
indexes,
|
||||||
|
starting_indexes,
|
||||||
|
exit,
|
||||||
|
|v, _, _, starting_indexes, exit| {
|
||||||
|
v.compute_transform(
|
||||||
|
starting_indexes.dateindex,
|
||||||
|
&self.indexes_to_max_days_between_ath.dateindex,
|
||||||
|
|(i, max, ..)| (i, StoredF64::from(*max as f64 / 365.0)),
|
||||||
|
exit,
|
||||||
|
)
|
||||||
|
},
|
||||||
|
)?;
|
||||||
|
|
||||||
|
thread::scope(|s| -> color_eyre::Result<()> {
|
||||||
|
s.spawn(|| -> color_eyre::Result<()> {
|
||||||
|
self.indexes_to_1w_sma.compute(
|
||||||
|
indexer,
|
||||||
|
indexes,
|
||||||
|
fetched,
|
||||||
|
starting_indexes,
|
||||||
|
exit,
|
||||||
|
|v, _, _, starting_indexes, exit| {
|
||||||
|
v.compute_sma(
|
||||||
|
starting_indexes.dateindex,
|
||||||
|
&fetched.timeindexes_to_close.dateindex,
|
||||||
|
7,
|
||||||
|
exit,
|
||||||
|
)
|
||||||
|
},
|
||||||
|
)
|
||||||
|
});
|
||||||
|
|
||||||
|
s.spawn(|| -> color_eyre::Result<()> {
|
||||||
|
self.indexes_to_8d_sma.compute(
|
||||||
|
indexer,
|
||||||
|
indexes,
|
||||||
|
fetched,
|
||||||
|
starting_indexes,
|
||||||
|
exit,
|
||||||
|
|v, _, _, starting_indexes, exit| {
|
||||||
|
v.compute_sma(
|
||||||
|
starting_indexes.dateindex,
|
||||||
|
&fetched.timeindexes_to_close.dateindex,
|
||||||
|
8,
|
||||||
|
exit,
|
||||||
|
)
|
||||||
|
},
|
||||||
|
)
|
||||||
|
});
|
||||||
|
|
||||||
|
s.spawn(|| -> color_eyre::Result<()> {
|
||||||
|
self.indexes_to_13d_sma.compute(
|
||||||
|
indexer,
|
||||||
|
indexes,
|
||||||
|
fetched,
|
||||||
|
starting_indexes,
|
||||||
|
exit,
|
||||||
|
|v, _, _, starting_indexes, exit| {
|
||||||
|
v.compute_sma(
|
||||||
|
starting_indexes.dateindex,
|
||||||
|
&fetched.timeindexes_to_close.dateindex,
|
||||||
|
13,
|
||||||
|
exit,
|
||||||
|
)
|
||||||
|
},
|
||||||
|
)
|
||||||
|
});
|
||||||
|
|
||||||
|
s.spawn(|| -> color_eyre::Result<()> {
|
||||||
|
self.indexes_to_21d_sma.compute(
|
||||||
|
indexer,
|
||||||
|
indexes,
|
||||||
|
fetched,
|
||||||
|
starting_indexes,
|
||||||
|
exit,
|
||||||
|
|v, _, _, starting_indexes, exit| {
|
||||||
|
v.compute_sma(
|
||||||
|
starting_indexes.dateindex,
|
||||||
|
&fetched.timeindexes_to_close.dateindex,
|
||||||
|
21,
|
||||||
|
exit,
|
||||||
|
)
|
||||||
|
},
|
||||||
|
)
|
||||||
|
});
|
||||||
|
|
||||||
|
s.spawn(|| -> color_eyre::Result<()> {
|
||||||
|
self.indexes_to_1m_sma.compute(
|
||||||
|
indexer,
|
||||||
|
indexes,
|
||||||
|
fetched,
|
||||||
|
starting_indexes,
|
||||||
|
exit,
|
||||||
|
|v, _, _, starting_indexes, exit| {
|
||||||
|
v.compute_sma(
|
||||||
|
starting_indexes.dateindex,
|
||||||
|
&fetched.timeindexes_to_close.dateindex,
|
||||||
|
30,
|
||||||
|
exit,
|
||||||
|
)
|
||||||
|
},
|
||||||
|
)
|
||||||
|
});
|
||||||
|
|
||||||
|
s.spawn(|| -> color_eyre::Result<()> {
|
||||||
|
self.indexes_to_34d_sma.compute(
|
||||||
|
indexer,
|
||||||
|
indexes,
|
||||||
|
fetched,
|
||||||
|
starting_indexes,
|
||||||
|
exit,
|
||||||
|
|v, _, _, starting_indexes, exit| {
|
||||||
|
v.compute_sma(
|
||||||
|
starting_indexes.dateindex,
|
||||||
|
&fetched.timeindexes_to_close.dateindex,
|
||||||
|
34,
|
||||||
|
exit,
|
||||||
|
)
|
||||||
|
},
|
||||||
|
)
|
||||||
|
});
|
||||||
|
|
||||||
|
s.spawn(|| -> color_eyre::Result<()> {
|
||||||
|
self.indexes_to_55d_sma.compute(
|
||||||
|
indexer,
|
||||||
|
indexes,
|
||||||
|
fetched,
|
||||||
|
starting_indexes,
|
||||||
|
exit,
|
||||||
|
|v, _, _, starting_indexes, exit| {
|
||||||
|
v.compute_sma(
|
||||||
|
starting_indexes.dateindex,
|
||||||
|
&fetched.timeindexes_to_close.dateindex,
|
||||||
|
55,
|
||||||
|
exit,
|
||||||
|
)
|
||||||
|
},
|
||||||
|
)
|
||||||
|
});
|
||||||
|
|
||||||
|
s.spawn(|| -> color_eyre::Result<()> {
|
||||||
|
self.indexes_to_89d_sma.compute(
|
||||||
|
indexer,
|
||||||
|
indexes,
|
||||||
|
fetched,
|
||||||
|
starting_indexes,
|
||||||
|
exit,
|
||||||
|
|v, _, _, starting_indexes, exit| {
|
||||||
|
v.compute_sma(
|
||||||
|
starting_indexes.dateindex,
|
||||||
|
&fetched.timeindexes_to_close.dateindex,
|
||||||
|
89,
|
||||||
|
exit,
|
||||||
|
)
|
||||||
|
},
|
||||||
|
)
|
||||||
|
});
|
||||||
|
|
||||||
|
s.spawn(|| -> color_eyre::Result<()> {
|
||||||
|
self.indexes_to_144d_sma.compute(
|
||||||
|
indexer,
|
||||||
|
indexes,
|
||||||
|
fetched,
|
||||||
|
starting_indexes,
|
||||||
|
exit,
|
||||||
|
|v, _, _, starting_indexes, exit| {
|
||||||
|
v.compute_sma(
|
||||||
|
starting_indexes.dateindex,
|
||||||
|
&fetched.timeindexes_to_close.dateindex,
|
||||||
|
144,
|
||||||
|
exit,
|
||||||
|
)
|
||||||
|
},
|
||||||
|
)
|
||||||
|
});
|
||||||
|
|
||||||
|
s.spawn(|| -> color_eyre::Result<()> {
|
||||||
|
self.indexes_to_1y_sma.compute(
|
||||||
|
indexer,
|
||||||
|
indexes,
|
||||||
|
fetched,
|
||||||
|
starting_indexes,
|
||||||
|
exit,
|
||||||
|
|v, _, _, starting_indexes, exit| {
|
||||||
|
v.compute_sma(
|
||||||
|
starting_indexes.dateindex,
|
||||||
|
&fetched.timeindexes_to_close.dateindex,
|
||||||
|
365,
|
||||||
|
exit,
|
||||||
|
)
|
||||||
|
},
|
||||||
|
)
|
||||||
|
});
|
||||||
|
|
||||||
|
s.spawn(|| -> color_eyre::Result<()> {
|
||||||
|
self.indexes_to_2y_sma.compute(
|
||||||
|
indexer,
|
||||||
|
indexes,
|
||||||
|
fetched,
|
||||||
|
starting_indexes,
|
||||||
|
exit,
|
||||||
|
|v, _, _, starting_indexes, exit| {
|
||||||
|
v.compute_sma(
|
||||||
|
starting_indexes.dateindex,
|
||||||
|
&fetched.timeindexes_to_close.dateindex,
|
||||||
|
2 * 365,
|
||||||
|
exit,
|
||||||
|
)
|
||||||
|
},
|
||||||
|
)
|
||||||
|
});
|
||||||
|
|
||||||
|
s.spawn(|| -> color_eyre::Result<()> {
|
||||||
|
self.indexes_to_200w_sma.compute(
|
||||||
|
indexer,
|
||||||
|
indexes,
|
||||||
|
fetched,
|
||||||
|
starting_indexes,
|
||||||
|
exit,
|
||||||
|
|v, _, _, starting_indexes, exit| {
|
||||||
|
v.compute_sma(
|
||||||
|
starting_indexes.dateindex,
|
||||||
|
&fetched.timeindexes_to_close.dateindex,
|
||||||
|
200 * 7,
|
||||||
|
exit,
|
||||||
|
)
|
||||||
|
},
|
||||||
|
)
|
||||||
|
});
|
||||||
|
|
||||||
|
s.spawn(|| -> color_eyre::Result<()> {
|
||||||
|
self.indexes_to_4y_sma.compute(
|
||||||
|
indexer,
|
||||||
|
indexes,
|
||||||
|
fetched,
|
||||||
|
starting_indexes,
|
||||||
|
exit,
|
||||||
|
|v, _, _, starting_indexes, exit| {
|
||||||
|
v.compute_sma(
|
||||||
|
starting_indexes.dateindex,
|
||||||
|
&fetched.timeindexes_to_close.dateindex,
|
||||||
|
4 * 365,
|
||||||
|
exit,
|
||||||
|
)
|
||||||
|
},
|
||||||
|
)
|
||||||
|
});
|
||||||
|
|
||||||
|
Ok(())
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
pub fn vecs(&self) -> Vec<&dyn AnyCollectableVec> {
|
||||||
|
[
|
||||||
|
self.indexes_to_marketcap.vecs(),
|
||||||
|
self.indexes_to_ath.vecs(),
|
||||||
|
self.indexes_to_drawdown.vecs(),
|
||||||
|
self.indexes_to_days_since_ath.vecs(),
|
||||||
|
self.indexes_to_max_days_between_ath.vecs(),
|
||||||
|
self.indexes_to_max_years_between_ath.vecs(),
|
||||||
|
self.indexes_to_1w_sma.vecs(),
|
||||||
|
self.indexes_to_8d_sma.vecs(),
|
||||||
|
self.indexes_to_13d_sma.vecs(),
|
||||||
|
self.indexes_to_21d_sma.vecs(),
|
||||||
|
self.indexes_to_1m_sma.vecs(),
|
||||||
|
self.indexes_to_34d_sma.vecs(),
|
||||||
|
self.indexes_to_55d_sma.vecs(),
|
||||||
|
self.indexes_to_89d_sma.vecs(),
|
||||||
|
self.indexes_to_144d_sma.vecs(),
|
||||||
|
self.indexes_to_1y_sma.vecs(),
|
||||||
|
self.indexes_to_2y_sma.vecs(),
|
||||||
|
self.indexes_to_200w_sma.vecs(),
|
||||||
|
self.indexes_to_4y_sma.vecs(),
|
||||||
|
]
|
||||||
|
.concat()
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -7,15 +7,15 @@ use brk_vec::{AnyCollectableVec, Compressed, Computation, VecIterator, Version};
|
|||||||
|
|
||||||
use super::{
|
use super::{
|
||||||
Indexes,
|
Indexes,
|
||||||
grouped::{ComputedVecsFromDateindex, ComputedVecsFromHeight, StorableVecGeneatorOptions},
|
grouped::{ComputedVecsFromDateIndex, ComputedVecsFromHeight, StorableVecGeneatorOptions},
|
||||||
indexes,
|
indexes,
|
||||||
};
|
};
|
||||||
|
|
||||||
#[derive(Clone)]
|
#[derive(Clone)]
|
||||||
pub struct Vecs {
|
pub struct Vecs {
|
||||||
pub indexes_to_difficulty: ComputedVecsFromHeight<StoredF64>,
|
pub indexes_to_difficulty: ComputedVecsFromHeight<StoredF64>,
|
||||||
pub indexes_to_difficultyepoch: ComputedVecsFromDateindex<DifficultyEpoch>,
|
pub indexes_to_difficultyepoch: ComputedVecsFromDateIndex<DifficultyEpoch>,
|
||||||
pub indexes_to_halvingepoch: ComputedVecsFromDateindex<HalvingEpoch>,
|
pub indexes_to_halvingepoch: ComputedVecsFromDateIndex<HalvingEpoch>,
|
||||||
}
|
}
|
||||||
|
|
||||||
impl Vecs {
|
impl Vecs {
|
||||||
@@ -35,14 +35,14 @@ impl Vecs {
|
|||||||
compressed,
|
compressed,
|
||||||
StorableVecGeneatorOptions::default().add_last(),
|
StorableVecGeneatorOptions::default().add_last(),
|
||||||
)?,
|
)?,
|
||||||
indexes_to_difficultyepoch: ComputedVecsFromDateindex::forced_import(
|
indexes_to_difficultyepoch: ComputedVecsFromDateIndex::forced_import(
|
||||||
path,
|
path,
|
||||||
"difficultyepoch",
|
"difficultyepoch",
|
||||||
Version::ZERO,
|
Version::ZERO,
|
||||||
compressed,
|
compressed,
|
||||||
StorableVecGeneatorOptions::default().add_last(),
|
StorableVecGeneatorOptions::default().add_last(),
|
||||||
)?,
|
)?,
|
||||||
indexes_to_halvingepoch: ComputedVecsFromDateindex::forced_import(
|
indexes_to_halvingepoch: ComputedVecsFromDateIndex::forced_import(
|
||||||
path,
|
path,
|
||||||
"halvingepoch",
|
"halvingepoch",
|
||||||
Version::ZERO,
|
Version::ZERO,
|
||||||
|
|||||||
@@ -6,9 +6,10 @@ use brk_indexer::Indexer;
|
|||||||
use brk_vec::{AnyCollectableVec, Compressed, Computation};
|
use brk_vec::{AnyCollectableVec, Compressed, Computation};
|
||||||
|
|
||||||
pub mod blocks;
|
pub mod blocks;
|
||||||
|
pub mod fetched;
|
||||||
pub mod grouped;
|
pub mod grouped;
|
||||||
pub mod indexes;
|
pub mod indexes;
|
||||||
pub mod marketprice;
|
pub mod market;
|
||||||
pub mod mining;
|
pub mod mining;
|
||||||
pub mod transactions;
|
pub mod transactions;
|
||||||
|
|
||||||
@@ -19,8 +20,9 @@ pub struct Vecs {
|
|||||||
pub indexes: indexes::Vecs,
|
pub indexes: indexes::Vecs,
|
||||||
pub blocks: blocks::Vecs,
|
pub blocks: blocks::Vecs,
|
||||||
pub mining: mining::Vecs,
|
pub mining: mining::Vecs,
|
||||||
|
pub market: market::Vecs,
|
||||||
pub transactions: transactions::Vecs,
|
pub transactions: transactions::Vecs,
|
||||||
pub marketprice: Option<marketprice::Vecs>,
|
pub fetched: Option<fetched::Vecs>,
|
||||||
}
|
}
|
||||||
|
|
||||||
impl Vecs {
|
impl Vecs {
|
||||||
@@ -35,22 +37,23 @@ impl Vecs {
|
|||||||
|
|
||||||
let indexes = indexes::Vecs::forced_import(path, indexer, computation, compressed)?;
|
let indexes = indexes::Vecs::forced_import(path, indexer, computation, compressed)?;
|
||||||
|
|
||||||
let marketprice =
|
let fetched =
|
||||||
fetch.then(|| marketprice::Vecs::forced_import(path, computation, compressed).unwrap());
|
fetch.then(|| fetched::Vecs::forced_import(path, computation, compressed).unwrap());
|
||||||
|
|
||||||
Ok(Self {
|
Ok(Self {
|
||||||
blocks: blocks::Vecs::forced_import(path, computation, compressed)?,
|
blocks: blocks::Vecs::forced_import(path, computation, compressed)?,
|
||||||
mining: mining::Vecs::forced_import(path, computation, compressed)?,
|
mining: mining::Vecs::forced_import(path, computation, compressed)?,
|
||||||
|
market: market::Vecs::forced_import(path, computation, compressed)?,
|
||||||
transactions: transactions::Vecs::forced_import(
|
transactions: transactions::Vecs::forced_import(
|
||||||
path,
|
path,
|
||||||
indexer,
|
indexer,
|
||||||
&indexes,
|
&indexes,
|
||||||
computation,
|
computation,
|
||||||
compressed,
|
compressed,
|
||||||
marketprice.as_ref(),
|
fetched.as_ref(),
|
||||||
)?,
|
)?,
|
||||||
indexes,
|
indexes,
|
||||||
marketprice,
|
fetched,
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -69,8 +72,8 @@ impl Vecs {
|
|||||||
self.mining
|
self.mining
|
||||||
.compute(indexer, &self.indexes, &starting_indexes, exit)?;
|
.compute(indexer, &self.indexes, &starting_indexes, exit)?;
|
||||||
|
|
||||||
if let Some(marketprice) = self.marketprice.as_mut() {
|
if let Some(fetched) = self.fetched.as_mut() {
|
||||||
marketprice.compute(
|
fetched.compute(
|
||||||
indexer,
|
indexer,
|
||||||
&self.indexes,
|
&self.indexes,
|
||||||
&starting_indexes,
|
&starting_indexes,
|
||||||
@@ -83,10 +86,21 @@ impl Vecs {
|
|||||||
indexer,
|
indexer,
|
||||||
&self.indexes,
|
&self.indexes,
|
||||||
&starting_indexes,
|
&starting_indexes,
|
||||||
self.marketprice.as_ref(),
|
self.fetched.as_ref(),
|
||||||
exit,
|
exit,
|
||||||
)?;
|
)?;
|
||||||
|
|
||||||
|
if let Some(fetched) = self.fetched.as_ref() {
|
||||||
|
self.market.compute(
|
||||||
|
indexer,
|
||||||
|
&self.indexes,
|
||||||
|
fetched,
|
||||||
|
&mut self.transactions,
|
||||||
|
&starting_indexes,
|
||||||
|
exit,
|
||||||
|
)?;
|
||||||
|
}
|
||||||
|
|
||||||
Ok(())
|
Ok(())
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -95,8 +109,9 @@ impl Vecs {
|
|||||||
self.indexes.vecs(),
|
self.indexes.vecs(),
|
||||||
self.blocks.vecs(),
|
self.blocks.vecs(),
|
||||||
self.mining.vecs(),
|
self.mining.vecs(),
|
||||||
|
self.market.vecs(),
|
||||||
self.transactions.vecs(),
|
self.transactions.vecs(),
|
||||||
self.marketprice.as_ref().map_or(vec![], |v| v.vecs()),
|
self.fetched.as_ref().map_or(vec![], |v| v.vecs()),
|
||||||
]
|
]
|
||||||
.concat()
|
.concat()
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -13,12 +13,12 @@ use brk_vec::{
|
|||||||
};
|
};
|
||||||
|
|
||||||
use super::{
|
use super::{
|
||||||
Indexes,
|
Indexes, fetched,
|
||||||
grouped::{
|
grouped::{
|
||||||
ComputedValueVecsFromHeight, ComputedValueVecsFromTxindex, ComputedVecsFromHeight,
|
ComputedValueVecsFromHeight, ComputedValueVecsFromTxindex, ComputedVecsFromHeight,
|
||||||
ComputedVecsFromTxindex, StorableVecGeneatorOptions,
|
ComputedVecsFromTxindex, StorableVecGeneatorOptions,
|
||||||
},
|
},
|
||||||
indexes, marketprice,
|
indexes,
|
||||||
};
|
};
|
||||||
|
|
||||||
#[derive(Clone)]
|
#[derive(Clone)]
|
||||||
@@ -94,9 +94,9 @@ impl Vecs {
|
|||||||
indexes: &indexes::Vecs,
|
indexes: &indexes::Vecs,
|
||||||
computation: Computation,
|
computation: Computation,
|
||||||
compressed: Compressed,
|
compressed: Compressed,
|
||||||
marketprices: Option<&marketprice::Vecs>,
|
fetched: Option<&fetched::Vecs>,
|
||||||
) -> color_eyre::Result<Self> {
|
) -> color_eyre::Result<Self> {
|
||||||
let compute_dollars = marketprices.is_some();
|
let compute_dollars = fetched.is_some();
|
||||||
|
|
||||||
fs::create_dir_all(path)?;
|
fs::create_dir_all(path)?;
|
||||||
|
|
||||||
@@ -455,7 +455,7 @@ impl Vecs {
|
|||||||
Version::ZERO,
|
Version::ZERO,
|
||||||
computation,
|
computation,
|
||||||
compressed,
|
compressed,
|
||||||
marketprices,
|
fetched,
|
||||||
StorableVecGeneatorOptions::default()
|
StorableVecGeneatorOptions::default()
|
||||||
.add_sum()
|
.add_sum()
|
||||||
.add_total()
|
.add_total()
|
||||||
@@ -700,7 +700,7 @@ impl Vecs {
|
|||||||
indexer: &Indexer,
|
indexer: &Indexer,
|
||||||
indexes: &indexes::Vecs,
|
indexes: &indexes::Vecs,
|
||||||
starting_indexes: &Indexes,
|
starting_indexes: &Indexes,
|
||||||
marketprices: Option<&marketprice::Vecs>,
|
fetched: Option<&fetched::Vecs>,
|
||||||
exit: &Exit,
|
exit: &Exit,
|
||||||
) -> color_eyre::Result<()> {
|
) -> color_eyre::Result<()> {
|
||||||
self.indexes_to_tx_count.compute_all(
|
self.indexes_to_tx_count.compute_all(
|
||||||
@@ -845,7 +845,7 @@ impl Vecs {
|
|||||||
self.indexes_to_coinbase.compute_all(
|
self.indexes_to_coinbase.compute_all(
|
||||||
indexer,
|
indexer,
|
||||||
indexes,
|
indexes,
|
||||||
marketprices,
|
fetched,
|
||||||
starting_indexes,
|
starting_indexes,
|
||||||
exit,
|
exit,
|
||||||
|vec, indexer, _, starting_indexes, exit| {
|
|vec, indexer, _, starting_indexes, exit| {
|
||||||
@@ -878,7 +878,7 @@ impl Vecs {
|
|||||||
self.indexes_to_subsidy.compute_all(
|
self.indexes_to_subsidy.compute_all(
|
||||||
indexer,
|
indexer,
|
||||||
indexes,
|
indexes,
|
||||||
marketprices,
|
fetched,
|
||||||
starting_indexes,
|
starting_indexes,
|
||||||
exit,
|
exit,
|
||||||
|vec, _, _, starting_indexes, exit| {
|
|vec, _, _, starting_indexes, exit| {
|
||||||
|
|||||||
@@ -0,0 +1,27 @@
|
|||||||
|
use std::ops::{Add, Div};
|
||||||
|
|
||||||
|
pub fn get_percentile<T>(sorted: &[T], percentile: f64) -> T
|
||||||
|
where
|
||||||
|
T: Clone + Div<usize, Output = T> + Add<T, Output = T>,
|
||||||
|
{
|
||||||
|
let len = sorted.len();
|
||||||
|
|
||||||
|
if len == 0 {
|
||||||
|
panic!();
|
||||||
|
} else if len == 1 {
|
||||||
|
sorted[0].clone()
|
||||||
|
} else {
|
||||||
|
let index = (len - 1) as f64 * percentile;
|
||||||
|
|
||||||
|
let fract = index.fract();
|
||||||
|
|
||||||
|
if fract != 0.0 {
|
||||||
|
let left = sorted.get(index as usize).unwrap().clone();
|
||||||
|
let right = sorted.get(index.ceil() as usize).unwrap().clone();
|
||||||
|
left / 2 + right / 2
|
||||||
|
} else {
|
||||||
|
// dbg!(sorted.len(), index);
|
||||||
|
sorted.get(index as usize).unwrap().clone()
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -1,4 +1,4 @@
|
|||||||
use std::ops::{Add, Div};
|
use std::ops::{Add, Div, Mul};
|
||||||
|
|
||||||
use serde::Serialize;
|
use serde::Serialize;
|
||||||
use zerocopy_derive::{FromBytes, Immutable, IntoBytes, KnownLayout};
|
use zerocopy_derive::{FromBytes, Immutable, IntoBytes, KnownLayout};
|
||||||
@@ -59,3 +59,25 @@ impl Div<usize> for Cents {
|
|||||||
Self(self.0 / rhs as u64)
|
Self(self.0 / rhs as u64)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
impl From<u128> for Cents {
|
||||||
|
fn from(value: u128) -> Self {
|
||||||
|
if value > u64::MAX as u128 {
|
||||||
|
panic!("u128 bigger than u64")
|
||||||
|
}
|
||||||
|
Self(value as u64)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
impl From<Cents> for u128 {
|
||||||
|
fn from(value: Cents) -> Self {
|
||||||
|
value.0 as u128
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
impl Mul<Cents> for Cents {
|
||||||
|
type Output = Cents;
|
||||||
|
fn mul(self, rhs: Cents) -> Self::Output {
|
||||||
|
Self(self.0 * rhs.0)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|||||||
@@ -14,6 +14,7 @@ impl Date {
|
|||||||
pub const INDEX_ZERO_: Date_ = Date_::constant(2009, 1, 3);
|
pub const INDEX_ZERO_: Date_ = Date_::constant(2009, 1, 3);
|
||||||
pub const INDEX_ONE: Self = Self(20090109);
|
pub const INDEX_ONE: Self = Self(20090109);
|
||||||
pub const INDEX_ONE_: Date_ = Date_::constant(2009, 1, 9);
|
pub const INDEX_ONE_: Date_ = Date_::constant(2009, 1, 9);
|
||||||
|
pub const MIN_RATIO: Self = Self(20120101);
|
||||||
|
|
||||||
pub fn new(year: u16, month: u8, day: u8) -> Self {
|
pub fn new(year: u16, month: u8, day: u8) -> Self {
|
||||||
Self(year as u32 * 1_00_00 + month as u32 * 1_00 + day as u32)
|
Self(year as u32 * 1_00_00 + month as u32 * 1_00 + day as u32)
|
||||||
|
|||||||
@@ -1,10 +1,13 @@
|
|||||||
use std::ops::{Add, Div, Mul};
|
use std::{
|
||||||
|
f64,
|
||||||
|
ops::{Add, Div, Mul},
|
||||||
|
};
|
||||||
|
|
||||||
use derive_deref::Deref;
|
use derive_deref::Deref;
|
||||||
use serde::Serialize;
|
use serde::Serialize;
|
||||||
use zerocopy_derive::{FromBytes, Immutable, IntoBytes, KnownLayout};
|
use zerocopy_derive::{FromBytes, Immutable, IntoBytes, KnownLayout};
|
||||||
|
|
||||||
use super::{Bitcoin, Cents, Sats};
|
use super::{Bitcoin, Cents, Close, Sats, StoredF32};
|
||||||
|
|
||||||
#[derive(
|
#[derive(
|
||||||
Debug,
|
Debug,
|
||||||
@@ -22,6 +25,16 @@ use super::{Bitcoin, Cents, Sats};
|
|||||||
)]
|
)]
|
||||||
pub struct Dollars(f64);
|
pub struct Dollars(f64);
|
||||||
|
|
||||||
|
impl Dollars {
|
||||||
|
pub const ZERO: Self = Self(0.0);
|
||||||
|
}
|
||||||
|
|
||||||
|
impl From<f32> for Dollars {
|
||||||
|
fn from(value: f32) -> Self {
|
||||||
|
Self(value as f64)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
impl From<f64> for Dollars {
|
impl From<f64> for Dollars {
|
||||||
fn from(value: f64) -> Self {
|
fn from(value: f64) -> Self {
|
||||||
Self(value)
|
Self(value)
|
||||||
@@ -34,12 +47,24 @@ impl From<Cents> for Dollars {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
impl From<Dollars> for f32 {
|
||||||
|
fn from(value: Dollars) -> Self {
|
||||||
|
value.0 as f32
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
impl From<Dollars> for f64 {
|
impl From<Dollars> for f64 {
|
||||||
fn from(value: Dollars) -> Self {
|
fn from(value: Dollars) -> Self {
|
||||||
value.0
|
value.0
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
impl From<Close<Dollars>> for Dollars {
|
||||||
|
fn from(value: Close<Dollars>) -> Self {
|
||||||
|
Self(value.0)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
impl From<usize> for Dollars {
|
impl From<usize> for Dollars {
|
||||||
fn from(value: usize) -> Self {
|
fn from(value: usize) -> Self {
|
||||||
Self(value as f64)
|
Self(value as f64)
|
||||||
@@ -53,6 +78,13 @@ impl Add for Dollars {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
impl Div<Dollars> for Dollars {
|
||||||
|
type Output = StoredF32;
|
||||||
|
fn div(self, rhs: Dollars) -> Self::Output {
|
||||||
|
StoredF32::from((self.0 / rhs.0) as f32)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
impl Div<usize> for Dollars {
|
impl Div<usize> for Dollars {
|
||||||
type Output = Self;
|
type Output = Self;
|
||||||
fn div(self, rhs: usize) -> Self::Output {
|
fn div(self, rhs: usize) -> Self::Output {
|
||||||
@@ -70,10 +102,39 @@ impl Ord for Dollars {
|
|||||||
}
|
}
|
||||||
|
|
||||||
impl Mul<Bitcoin> for Dollars {
|
impl Mul<Bitcoin> for Dollars {
|
||||||
type Output = Dollars;
|
type Output = Self;
|
||||||
fn mul(self, rhs: Bitcoin) -> Self::Output {
|
fn mul(self, rhs: Bitcoin) -> Self::Output {
|
||||||
Self::from(Cents::from(
|
Self::from(Cents::from(
|
||||||
u64::from(Sats::from(rhs)) * u64::from(Cents::from(self)) / u64::from(Sats::ONE_BTC),
|
u128::from(Sats::from(rhs)) * u128::from(Cents::from(self)) / u128::from(Sats::ONE_BTC),
|
||||||
))
|
))
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
impl Mul<StoredF32> for Dollars {
|
||||||
|
type Output = Self;
|
||||||
|
fn mul(self, rhs: StoredF32) -> Self::Output {
|
||||||
|
if rhs.is_nan() {
|
||||||
|
Self(f64::NAN)
|
||||||
|
} else {
|
||||||
|
Self::from(Cents::from(Self::from(self.0 * *rhs as f64)))
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
impl From<u128> for Dollars {
|
||||||
|
fn from(value: u128) -> Self {
|
||||||
|
Self::from(Cents::from(value))
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
impl From<Close<Dollars>> for u128 {
|
||||||
|
fn from(value: Close<Dollars>) -> Self {
|
||||||
|
u128::from(*value)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
impl From<Dollars> for u128 {
|
||||||
|
fn from(value: Dollars) -> Self {
|
||||||
|
u128::from(Cents::from(value))
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|||||||
@@ -24,6 +24,7 @@ mod outputtypeindex;
|
|||||||
mod quarterindex;
|
mod quarterindex;
|
||||||
mod rawlocktime;
|
mod rawlocktime;
|
||||||
mod sats;
|
mod sats;
|
||||||
|
mod stored_f32;
|
||||||
mod stored_f64;
|
mod stored_f64;
|
||||||
mod stored_u32;
|
mod stored_u32;
|
||||||
mod stored_u64;
|
mod stored_u64;
|
||||||
@@ -67,6 +68,7 @@ pub use outputtypeindex::*;
|
|||||||
pub use quarterindex::*;
|
pub use quarterindex::*;
|
||||||
pub use rawlocktime::*;
|
pub use rawlocktime::*;
|
||||||
pub use sats::*;
|
pub use sats::*;
|
||||||
|
pub use stored_f32::*;
|
||||||
pub use stored_f64::*;
|
pub use stored_f64::*;
|
||||||
pub use stored_u8::*;
|
pub use stored_u8::*;
|
||||||
pub use stored_u32::*;
|
pub use stored_u32::*;
|
||||||
@@ -83,3 +85,5 @@ pub use vout::*;
|
|||||||
pub use weekindex::*;
|
pub use weekindex::*;
|
||||||
pub use weight::*;
|
pub use weight::*;
|
||||||
pub use yearindex::*;
|
pub use yearindex::*;
|
||||||
|
|
||||||
|
pub use rlimit;
|
||||||
|
|||||||
@@ -453,6 +453,15 @@ where
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
impl<T> From<f32> for Close<T>
|
||||||
|
where
|
||||||
|
T: From<f32>,
|
||||||
|
{
|
||||||
|
fn from(value: f32) -> Self {
|
||||||
|
Self(T::from(value))
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
impl<T> From<f64> for Close<T>
|
impl<T> From<f64> for Close<T>
|
||||||
where
|
where
|
||||||
T: From<f64>,
|
T: From<f64>,
|
||||||
@@ -462,6 +471,15 @@ where
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
impl<T> From<Close<T>> for f32
|
||||||
|
where
|
||||||
|
f32: From<T>,
|
||||||
|
{
|
||||||
|
fn from(value: Close<T>) -> Self {
|
||||||
|
Self::from(value.0)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
impl<T> From<Close<T>> for f64
|
impl<T> From<Close<T>> for f64
|
||||||
where
|
where
|
||||||
f64: From<T>,
|
f64: From<T>,
|
||||||
|
|||||||
@@ -156,3 +156,18 @@ impl From<Sats> for u64 {
|
|||||||
value.0
|
value.0
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
impl From<u128> for Sats {
|
||||||
|
fn from(value: u128) -> Self {
|
||||||
|
if value > u64::MAX as u128 {
|
||||||
|
panic!("u128 bigger than u64")
|
||||||
|
}
|
||||||
|
Self(value as u64)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
impl From<Sats> for u128 {
|
||||||
|
fn from(value: Sats) -> Self {
|
||||||
|
value.0 as u128
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|||||||
@@ -0,0 +1,106 @@
|
|||||||
|
use std::ops::{Add, Div, Mul, Sub};
|
||||||
|
|
||||||
|
use derive_deref::Deref;
|
||||||
|
use serde::Serialize;
|
||||||
|
use zerocopy_derive::{FromBytes, Immutable, IntoBytes, KnownLayout};
|
||||||
|
|
||||||
|
use crate::CheckedSub;
|
||||||
|
|
||||||
|
use super::Dollars;
|
||||||
|
|
||||||
|
#[derive(
|
||||||
|
Debug,
|
||||||
|
Deref,
|
||||||
|
Default,
|
||||||
|
Clone,
|
||||||
|
Copy,
|
||||||
|
PartialEq,
|
||||||
|
PartialOrd,
|
||||||
|
FromBytes,
|
||||||
|
Immutable,
|
||||||
|
IntoBytes,
|
||||||
|
KnownLayout,
|
||||||
|
Serialize,
|
||||||
|
)]
|
||||||
|
pub struct StoredF32(f32);
|
||||||
|
|
||||||
|
impl From<f32> for StoredF32 {
|
||||||
|
fn from(value: f32) -> Self {
|
||||||
|
Self(value)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
impl From<f64> for StoredF32 {
|
||||||
|
fn from(value: f64) -> Self {
|
||||||
|
Self(value as f32)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
impl From<usize> for StoredF32 {
|
||||||
|
fn from(value: usize) -> Self {
|
||||||
|
Self(value as f32)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
impl CheckedSub<StoredF32> for StoredF32 {
|
||||||
|
fn checked_sub(self, rhs: Self) -> Option<Self> {
|
||||||
|
Some(Self(self.0 - rhs.0))
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
impl Div<usize> for StoredF32 {
|
||||||
|
type Output = Self;
|
||||||
|
fn div(self, rhs: usize) -> Self::Output {
|
||||||
|
Self(self.0 / rhs as f32)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
impl Add for StoredF32 {
|
||||||
|
type Output = Self;
|
||||||
|
fn add(self, rhs: Self) -> Self::Output {
|
||||||
|
Self(self.0 + rhs.0)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
impl From<StoredF32> for f32 {
|
||||||
|
fn from(value: StoredF32) -> Self {
|
||||||
|
value.0
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
impl Eq for StoredF32 {}
|
||||||
|
|
||||||
|
#[allow(clippy::derive_ord_xor_partial_ord)]
|
||||||
|
impl Ord for StoredF32 {
|
||||||
|
fn cmp(&self, other: &Self) -> std::cmp::Ordering {
|
||||||
|
self.0.partial_cmp(&other.0).unwrap()
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
impl Div<Dollars> for StoredF32 {
|
||||||
|
type Output = Self;
|
||||||
|
fn div(self, rhs: Dollars) -> Self::Output {
|
||||||
|
Self::from(self.0 as f64 / *rhs)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
impl Mul<usize> for StoredF32 {
|
||||||
|
type Output = Self;
|
||||||
|
fn mul(self, rhs: usize) -> Self::Output {
|
||||||
|
Self(self.0 * rhs as f32)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
impl Mul<StoredF32> for usize {
|
||||||
|
type Output = StoredF32;
|
||||||
|
fn mul(self, rhs: StoredF32) -> Self::Output {
|
||||||
|
StoredF32(self as f32 * rhs.0)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
impl Sub<StoredF32> for StoredF32 {
|
||||||
|
type Output = Self;
|
||||||
|
fn sub(self, rhs: StoredF32) -> Self::Output {
|
||||||
|
Self(self.0 - rhs.0)
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -9,6 +9,7 @@ use crate::CheckedSub;
|
|||||||
#[derive(
|
#[derive(
|
||||||
Debug,
|
Debug,
|
||||||
Deref,
|
Deref,
|
||||||
|
Default,
|
||||||
Clone,
|
Clone,
|
||||||
Copy,
|
Copy,
|
||||||
PartialEq,
|
PartialEq,
|
||||||
|
|||||||
@@ -16,6 +16,7 @@ use super::{
|
|||||||
Debug,
|
Debug,
|
||||||
Deref,
|
Deref,
|
||||||
Clone,
|
Clone,
|
||||||
|
Default,
|
||||||
Copy,
|
Copy,
|
||||||
PartialEq,
|
PartialEq,
|
||||||
Eq,
|
Eq,
|
||||||
|
|||||||
@@ -4,7 +4,14 @@ use rlimit::{Resource, getrlimit};
|
|||||||
|
|
||||||
pub fn setrlimit() -> io::Result<()> {
|
pub fn setrlimit() -> io::Result<()> {
|
||||||
let no_file_limit = getrlimit(Resource::NOFILE)?;
|
let no_file_limit = getrlimit(Resource::NOFILE)?;
|
||||||
rlimit::setrlimit(Resource::NOFILE, no_file_limit.0.max(210_000), no_file_limit.1)?;
|
rlimit::setrlimit(
|
||||||
|
Resource::NOFILE,
|
||||||
|
no_file_limit.0.max(210_000),
|
||||||
|
no_file_limit.1,
|
||||||
|
)?;
|
||||||
|
|
||||||
|
// let no_stack = getrlimit(Resource::STACK)?;
|
||||||
|
// rlimit::setrlimit(Resource::STACK, no_stack.1, no_stack.1)?;
|
||||||
|
|
||||||
Ok(())
|
Ok(())
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -8,5 +8,5 @@ repository.workspace = true
|
|||||||
|
|
||||||
[dependencies]
|
[dependencies]
|
||||||
brk_logger = { workspace = true }
|
brk_logger = { workspace = true }
|
||||||
ctrlc = { version = "3.4.6", features = ["termination"] }
|
ctrlc = { version = "3.4.7", features = ["termination"] }
|
||||||
log = { workspace = true }
|
log = { workspace = true }
|
||||||
|
|||||||
@@ -38,7 +38,7 @@ impl Kibo {
|
|||||||
.unwrap()
|
.unwrap()
|
||||||
.get(usize::from(height.checked_sub(key).unwrap()))
|
.get(usize::from(height.checked_sub(key).unwrap()))
|
||||||
.cloned()
|
.cloned()
|
||||||
.ok_or(color_eyre::eyre::Error::msg("Couldn't find height in kibo"))
|
.ok_or(eyre!("Couldn't find height in kibo"))
|
||||||
}
|
}
|
||||||
|
|
||||||
fn fetch_height_prices(height: Height) -> color_eyre::Result<Vec<OHLCCents>> {
|
fn fetch_height_prices(height: Height) -> color_eyre::Result<Vec<OHLCCents>> {
|
||||||
|
|||||||
@@ -35,8 +35,14 @@ impl Fetcher {
|
|||||||
pub fn get_date(&mut self, date: Date) -> color_eyre::Result<OHLCCents> {
|
pub fn get_date(&mut self, date: Date) -> color_eyre::Result<OHLCCents> {
|
||||||
self.kraken
|
self.kraken
|
||||||
.get_from_1d(&date)
|
.get_from_1d(&date)
|
||||||
.or_else(|_| self.binance.get_from_1d(&date))
|
.or_else(|e| {
|
||||||
.or_else(|_| self.kibo.get_from_date(&date))
|
eprintln!("{e}");
|
||||||
|
self.binance.get_from_1d(&date)
|
||||||
|
})
|
||||||
|
.or_else(|e| {
|
||||||
|
eprintln!("{e}");
|
||||||
|
self.kibo.get_from_date(&date)
|
||||||
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
pub fn get_height(
|
pub fn get_height(
|
||||||
@@ -56,10 +62,12 @@ impl Fetcher {
|
|||||||
let ohlc = self
|
let ohlc = self
|
||||||
.kraken
|
.kraken
|
||||||
.get_from_1mn(timestamp, previous_timestamp)
|
.get_from_1mn(timestamp, previous_timestamp)
|
||||||
.unwrap_or_else(|_| {
|
.unwrap_or_else(|e| {
|
||||||
|
eprintln!("{e}");
|
||||||
self.binance
|
self.binance
|
||||||
.get_from_1mn(timestamp, previous_timestamp)
|
.get_from_1mn(timestamp, previous_timestamp)
|
||||||
.unwrap_or_else(|_| {
|
.unwrap_or_else(|e| {
|
||||||
|
eprintln!("{e}");
|
||||||
self.kibo.get_from_height(height).unwrap_or_else(|e| {
|
self.kibo.get_from_height(height).unwrap_or_else(|e| {
|
||||||
let date = Date::from(timestamp);
|
let date = Date::from(timestamp);
|
||||||
eprintln!("{e}");
|
eprintln!("{e}");
|
||||||
|
|||||||
@@ -23,9 +23,9 @@ color-eyre = { workspace = true }
|
|||||||
jiff = { workspace = true }
|
jiff = { workspace = true }
|
||||||
log = { workspace = true }
|
log = { workspace = true }
|
||||||
minreq = { workspace = true }
|
minreq = { workspace = true }
|
||||||
oxc = { version = "0.68.1", features = ["codegen", "minifier"] }
|
oxc = { version = "0.69.0", features = ["codegen", "minifier"] }
|
||||||
serde = { workspace = true }
|
serde = { workspace = true }
|
||||||
tokio = { version = "1.45.0", features = ["full"] }
|
tokio = { version = "1.45.0", features = ["full"] }
|
||||||
tower-http = { version = "0.6.3", features = ["compression-full", "trace"] }
|
tower-http = { version = "0.6.4", features = ["compression-full", "trace"] }
|
||||||
zip = "2.6.1"
|
zip = "2.6.1"
|
||||||
tracing = "0.1.41"
|
tracing = "0.1.41"
|
||||||
|
|||||||
@@ -20,6 +20,10 @@ impl Version {
|
|||||||
pub const ONE: Self = Self(1);
|
pub const ONE: Self = Self(1);
|
||||||
pub const TWO: Self = Self(2);
|
pub const TWO: Self = Self(2);
|
||||||
|
|
||||||
|
pub const fn new(v: u32) -> Self {
|
||||||
|
Self(v)
|
||||||
|
}
|
||||||
|
|
||||||
pub fn write(&self, path: &Path) -> Result<(), io::Error> {
|
pub fn write(&self, path: &Path) -> Result<(), io::Error> {
|
||||||
fs::write(path, self.as_bytes())
|
fs::write(path, self.as_bytes())
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -11,7 +11,7 @@ where
|
|||||||
fn collect_range(&self, from: Option<usize>, to: Option<usize>) -> Result<Vec<T>> {
|
fn collect_range(&self, from: Option<usize>, to: Option<usize>) -> Result<Vec<T>> {
|
||||||
let len = self.len();
|
let len = self.len();
|
||||||
let from = from.unwrap_or_default();
|
let from = from.unwrap_or_default();
|
||||||
let to = to.map_or(len, |i| i.min(len));
|
let to = to.map_or(len, |to| to.min(len));
|
||||||
|
|
||||||
if from >= len || from >= to {
|
if from >= len || from >= to {
|
||||||
return Ok(vec![]);
|
return Ok(vec![]);
|
||||||
|
|||||||
@@ -53,7 +53,12 @@ pub trait VecIterator<'a>: BaseVecIterator<Item = (Self::I, Value<'a, Self::T>)>
|
|||||||
|
|
||||||
#[inline]
|
#[inline]
|
||||||
fn unwrap_get_inner(&mut self, i: Self::I) -> Self::T {
|
fn unwrap_get_inner(&mut self, i: Self::I) -> Self::T {
|
||||||
self.get_(i.unwrap_to_usize()).unwrap().into_inner()
|
self.unwrap_get_inner_(i.unwrap_to_usize())
|
||||||
|
}
|
||||||
|
|
||||||
|
#[inline]
|
||||||
|
fn unwrap_get_inner_(&mut self, i: usize) -> Self::T {
|
||||||
|
self.get_(i).unwrap().into_inner()
|
||||||
}
|
}
|
||||||
|
|
||||||
#[inline]
|
#[inline]
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
use std::{path::Path, time::Duration};
|
use std::{fs, path::Path, time::Duration};
|
||||||
|
|
||||||
use brk_exit::Exit;
|
use brk_exit::Exit;
|
||||||
use clap_derive::ValueEnum;
|
use clap_derive::ValueEnum;
|
||||||
@@ -90,12 +90,14 @@ where
|
|||||||
source: BoxedAnyIterableVec<S1I, S1T>,
|
source: BoxedAnyIterableVec<S1I, S1T>,
|
||||||
compute: ComputeFrom1<I, T, S1I, S1T>,
|
compute: ComputeFrom1<I, T, S1I, S1T>,
|
||||||
) -> Result<Self> {
|
) -> Result<Self> {
|
||||||
|
let full_path = path.join(name);
|
||||||
Ok(match mode {
|
Ok(match mode {
|
||||||
Computation::Eager => Self::Eager {
|
Computation::Eager => Self::Eager {
|
||||||
vec: EagerVec::forced_import(path, version, compressed)?,
|
vec: EagerVec::forced_import(&full_path, version, compressed)?,
|
||||||
deps: Dependencies::From1(source, compute),
|
deps: Dependencies::From1(source, compute),
|
||||||
},
|
},
|
||||||
Computation::Lazy => {
|
Computation::Lazy => {
|
||||||
|
let _ = fs::remove_dir_all(full_path);
|
||||||
Self::LazyFrom1(LazyVecFrom1::init(name, version, source, compute))
|
Self::LazyFrom1(LazyVecFrom1::init(name, version, source, compute))
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
@@ -112,12 +114,14 @@ where
|
|||||||
source2: BoxedAnyIterableVec<S2I, S2T>,
|
source2: BoxedAnyIterableVec<S2I, S2T>,
|
||||||
compute: ComputeFrom2<I, T, S1I, S1T, S2I, S2T>,
|
compute: ComputeFrom2<I, T, S1I, S1T, S2I, S2T>,
|
||||||
) -> Result<Self> {
|
) -> Result<Self> {
|
||||||
|
let full_path = path.join(name);
|
||||||
Ok(match mode {
|
Ok(match mode {
|
||||||
Computation::Eager => Self::Eager {
|
Computation::Eager => Self::Eager {
|
||||||
vec: EagerVec::forced_import(path, version, compressed)?,
|
vec: EagerVec::forced_import(&full_path, version, compressed)?,
|
||||||
deps: Dependencies::From2((source1, source2), compute),
|
deps: Dependencies::From2((source1, source2), compute),
|
||||||
},
|
},
|
||||||
Computation::Lazy => {
|
Computation::Lazy => {
|
||||||
|
let _ = fs::remove_dir_all(full_path);
|
||||||
Self::LazyFrom2(LazyVecFrom2::init(name, version, source1, source2, compute))
|
Self::LazyFrom2(LazyVecFrom2::init(name, version, source1, source2, compute))
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
@@ -135,14 +139,18 @@ where
|
|||||||
source3: BoxedAnyIterableVec<S3I, S3T>,
|
source3: BoxedAnyIterableVec<S3I, S3T>,
|
||||||
compute: ComputeFrom3<I, T, S1I, S1T, S2I, S2T, S3I, S3T>,
|
compute: ComputeFrom3<I, T, S1I, S1T, S2I, S2T, S3I, S3T>,
|
||||||
) -> Result<Self> {
|
) -> Result<Self> {
|
||||||
|
let full_path = path.join(name);
|
||||||
Ok(match mode {
|
Ok(match mode {
|
||||||
Computation::Eager => Self::Eager {
|
Computation::Eager => Self::Eager {
|
||||||
vec: EagerVec::forced_import(path, version, compressed)?,
|
vec: EagerVec::forced_import(&full_path, version, compressed)?,
|
||||||
deps: Dependencies::From3((source1, source2, source3), compute),
|
deps: Dependencies::From3((source1, source2, source3), compute),
|
||||||
},
|
},
|
||||||
Computation::Lazy => Self::LazyFrom3(LazyVecFrom3::init(
|
Computation::Lazy => {
|
||||||
name, version, source1, source2, source3, compute,
|
let _ = fs::remove_dir_all(full_path);
|
||||||
)),
|
Self::LazyFrom3(LazyVecFrom3::init(
|
||||||
|
name, version, source1, source2, source3, compute,
|
||||||
|
))
|
||||||
|
}
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -1,8 +1,9 @@
|
|||||||
use core::error;
|
use core::error;
|
||||||
use std::{
|
use std::{
|
||||||
cmp::Ordering,
|
cmp::Ordering,
|
||||||
|
f32,
|
||||||
fmt::Debug,
|
fmt::Debug,
|
||||||
ops::Add,
|
ops::{Add, Div},
|
||||||
path::{Path, PathBuf},
|
path::{Path, PathBuf},
|
||||||
time::Duration,
|
time::Duration,
|
||||||
};
|
};
|
||||||
@@ -88,6 +89,10 @@ where
|
|||||||
self.inner.path()
|
self.inner.path()
|
||||||
}
|
}
|
||||||
|
|
||||||
|
pub fn inner_version(&self) -> Version {
|
||||||
|
self.inner.version()
|
||||||
|
}
|
||||||
|
|
||||||
#[inline]
|
#[inline]
|
||||||
fn path_computed_version(&self) -> PathBuf {
|
fn path_computed_version(&self) -> PathBuf {
|
||||||
self.inner.path().join("computed_version")
|
self.inner.path().join("computed_version")
|
||||||
@@ -406,6 +411,69 @@ where
|
|||||||
|
|
||||||
self.safe_flush(exit)
|
self.safe_flush(exit)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
pub fn compute_sma<T2>(
|
||||||
|
&mut self,
|
||||||
|
max_from: I,
|
||||||
|
source: &impl AnyIterableVec<I, T2>,
|
||||||
|
sma: usize,
|
||||||
|
exit: &Exit,
|
||||||
|
) -> Result<()>
|
||||||
|
where
|
||||||
|
T: Add<T, Output = T> + From<T2> + Div<usize, Output = T> + From<f32>,
|
||||||
|
T2: StoredType,
|
||||||
|
f32: From<T> + From<T2>,
|
||||||
|
{
|
||||||
|
self.compute_sma_(max_from, source, sma, exit, None)
|
||||||
|
}
|
||||||
|
|
||||||
|
pub fn compute_sma_<T2>(
|
||||||
|
&mut self,
|
||||||
|
max_from: I,
|
||||||
|
source: &impl AnyIterableVec<I, T2>,
|
||||||
|
sma: usize,
|
||||||
|
exit: &Exit,
|
||||||
|
min_i: Option<I>,
|
||||||
|
) -> Result<()>
|
||||||
|
where
|
||||||
|
T: Add<T, Output = T> + From<T2> + Div<usize, Output = T> + From<f32>,
|
||||||
|
T2: StoredType,
|
||||||
|
f32: From<T> + From<T2>,
|
||||||
|
{
|
||||||
|
self.validate_computed_version_or_reset_file(
|
||||||
|
Version::ZERO + self.inner.version() + source.version(),
|
||||||
|
)?;
|
||||||
|
|
||||||
|
let index = max_from.min(I::from(self.len()));
|
||||||
|
let mut prev = None;
|
||||||
|
let min_prev_i = min_i.unwrap_or_default().unwrap_to_usize();
|
||||||
|
source.iter_at(index).try_for_each(|(i, value)| {
|
||||||
|
let value = value.into_inner();
|
||||||
|
|
||||||
|
if min_i.is_none() || min_i.is_some_and(|min_i| min_i <= i) {
|
||||||
|
if prev.is_none() {
|
||||||
|
let i = i.unwrap_to_usize();
|
||||||
|
prev.replace(if i > min_prev_i {
|
||||||
|
self.into_iter().unwrap_get_inner_(i - 1)
|
||||||
|
} else {
|
||||||
|
T::from(0.0)
|
||||||
|
});
|
||||||
|
}
|
||||||
|
let len = (i.unwrap_to_usize() - min_prev_i + 1).min(sma);
|
||||||
|
let sma = T::from(
|
||||||
|
(f32::from(prev.clone().unwrap()) * (len - 1) as f32 + f32::from(value))
|
||||||
|
/ len as f32,
|
||||||
|
);
|
||||||
|
|
||||||
|
prev.replace(sma.clone());
|
||||||
|
self.forced_push_at(i, sma, exit)
|
||||||
|
} else {
|
||||||
|
self.forced_push_at(i, T::from(f32::NAN), exit)
|
||||||
|
}
|
||||||
|
})?;
|
||||||
|
|
||||||
|
self.safe_flush(exit)
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
impl<I> EagerVec<I, Bitcoin>
|
impl<I> EagerVec<I, Bitcoin>
|
||||||
|
|||||||
@@ -441,9 +441,9 @@
|
|||||||
h1,
|
h1,
|
||||||
h2 {
|
h2 {
|
||||||
text-transform: uppercase;
|
text-transform: uppercase;
|
||||||
font-size: var(--font-size-2xl);
|
font-size: var(--font-size-xl);
|
||||||
line-height: var(--line-height-2xl);
|
line-height: var(--line-height-xl);
|
||||||
font-weight: 300;
|
font-weight: 350;
|
||||||
}
|
}
|
||||||
|
|
||||||
h3 {
|
h3 {
|
||||||
@@ -994,12 +994,17 @@
|
|||||||
margin-right: var(--negative-main-padding);
|
margin-right: var(--negative-main-padding);
|
||||||
padding-left: var(--main-padding);
|
padding-left: var(--main-padding);
|
||||||
padding-right: var(--main-padding);
|
padding-right: var(--main-padding);
|
||||||
padding-bottom: 1rem;
|
padding-top: 0.5rem;
|
||||||
|
padding-bottom: 0.5rem;
|
||||||
overflow-x: auto;
|
overflow-x: auto;
|
||||||
min-width: 0;
|
min-width: 0;
|
||||||
font-size: var(--font-size-sm);
|
font-size: var(--font-size-sm);
|
||||||
line-height: var(--line-height-sm);
|
line-height: var(--line-height-sm);
|
||||||
height: 2rem;
|
scrollbar-width: thin;
|
||||||
|
|
||||||
|
&:empty {
|
||||||
|
display: none;
|
||||||
|
}
|
||||||
|
|
||||||
> div {
|
> div {
|
||||||
flex: 0;
|
flex: 0;
|
||||||
|
|||||||
@@ -50,7 +50,6 @@ export default import("./v5.0.6-treeshaked/script.js").then((lc) => {
|
|||||||
autoSize: true,
|
autoSize: true,
|
||||||
layout: {
|
layout: {
|
||||||
fontFamily: elements.style.fontFamily,
|
fontFamily: elements.style.fontFamily,
|
||||||
// fontSize: 13,
|
|
||||||
background: { color: "transparent" },
|
background: { color: "transparent" },
|
||||||
attributionLogo: false,
|
attributionLogo: false,
|
||||||
colorSpace: "display-p3",
|
colorSpace: "display-p3",
|
||||||
@@ -71,10 +70,6 @@ export default import("./v5.0.6-treeshaked/script.js").then((lc) => {
|
|||||||
const chart = lc.createChart(element, options);
|
const chart = lc.createChart(element, options);
|
||||||
|
|
||||||
chart.priceScale("right").applyOptions({
|
chart.priceScale("right").applyOptions({
|
||||||
// scaleMargins: {
|
|
||||||
// top: 0.15,
|
|
||||||
// bottom: 0.05,
|
|
||||||
// },
|
|
||||||
minimumWidth: 80,
|
minimumWidth: 80,
|
||||||
});
|
});
|
||||||
|
|
||||||
@@ -161,16 +156,24 @@ export default import("./v5.0.6-treeshaked/script.js").then((lc) => {
|
|||||||
div.classList.add("chart");
|
div.classList.add("chart");
|
||||||
parent.append(div);
|
parent.append(div);
|
||||||
|
|
||||||
const legend = createLegend({
|
const legendTop = createLegend({
|
||||||
parent: div,
|
parent: div,
|
||||||
utils,
|
utils,
|
||||||
signals,
|
signals,
|
||||||
|
paneIndex: 0,
|
||||||
});
|
});
|
||||||
|
|
||||||
const chartDiv = window.document.createElement("div");
|
const chartDiv = window.document.createElement("div");
|
||||||
chartDiv.classList.add("lightweight-chart");
|
chartDiv.classList.add("lightweight-chart");
|
||||||
div.append(chartDiv);
|
div.append(chartDiv);
|
||||||
|
|
||||||
|
const legendBottom = createLegend({
|
||||||
|
parent: div,
|
||||||
|
utils,
|
||||||
|
signals,
|
||||||
|
paneIndex: 1,
|
||||||
|
});
|
||||||
|
|
||||||
let ichart = /** @type {IChartApi | null} */ (null);
|
let ichart = /** @type {IChartApi | null} */ (null);
|
||||||
let timeScaleSet = false;
|
let timeScaleSet = false;
|
||||||
|
|
||||||
@@ -220,7 +223,12 @@ export default import("./v5.0.6-treeshaked/script.js").then((lc) => {
|
|||||||
offset += 1;
|
offset += 1;
|
||||||
}
|
}
|
||||||
const v = ohlcs[i];
|
const v = ohlcs[i];
|
||||||
if (typeof v === "number") {
|
if (v === null) {
|
||||||
|
data[i - offset] = {
|
||||||
|
time,
|
||||||
|
value: NaN,
|
||||||
|
};
|
||||||
|
} else if (typeof v === "number") {
|
||||||
data[i - offset] = {
|
data[i - offset] = {
|
||||||
time,
|
time,
|
||||||
value: v,
|
value: v,
|
||||||
@@ -363,7 +371,7 @@ export default import("./v5.0.6-treeshaked/script.js").then((lc) => {
|
|||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
legend.add({
|
(paneIndex ? legendBottom : legendTop).add({
|
||||||
series,
|
series,
|
||||||
name,
|
name,
|
||||||
defaultActive,
|
defaultActive,
|
||||||
@@ -445,7 +453,7 @@ export default import("./v5.0.6-treeshaked/script.js").then((lc) => {
|
|||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
legend.add({
|
(paneIndex ? legendBottom : legendTop).add({
|
||||||
series,
|
series,
|
||||||
colors: [color],
|
colors: [color],
|
||||||
name,
|
name,
|
||||||
@@ -477,6 +485,7 @@ export default import("./v5.0.6-treeshaked/script.js").then((lc) => {
|
|||||||
* @param {VecId} [args.vecId]
|
* @param {VecId} [args.vecId]
|
||||||
* @param {number} [args.paneIndex]
|
* @param {number} [args.paneIndex]
|
||||||
* @param {boolean} [args.defaultActive]
|
* @param {boolean} [args.defaultActive]
|
||||||
|
* @param {DeepPartial<LineStyleOptions & SeriesOptionsCommon>} [args.options]
|
||||||
*/
|
*/
|
||||||
addBaselineSeries({
|
addBaselineSeries({
|
||||||
vecId,
|
vecId,
|
||||||
@@ -485,11 +494,14 @@ export default import("./v5.0.6-treeshaked/script.js").then((lc) => {
|
|||||||
paneIndex: _paneIndex,
|
paneIndex: _paneIndex,
|
||||||
defaultActive,
|
defaultActive,
|
||||||
data,
|
data,
|
||||||
|
options,
|
||||||
}) {
|
}) {
|
||||||
if (!ichart || !timeResource) throw Error("Chart not fully set");
|
if (!ichart || !timeResource) throw Error("Chart not fully set");
|
||||||
|
|
||||||
const paneIndex = _paneIndex ?? 0;
|
const paneIndex = _paneIndex ?? 0;
|
||||||
|
|
||||||
|
console.log("OPTIONS", options);
|
||||||
|
|
||||||
const series = ichart.addSeries(
|
const series = ichart.addSeries(
|
||||||
/** @type {SeriesDefinition<'Baseline'>} */ (lc.BaselineSeries),
|
/** @type {SeriesDefinition<'Baseline'>} */ (lc.BaselineSeries),
|
||||||
{
|
{
|
||||||
@@ -497,13 +509,16 @@ export default import("./v5.0.6-treeshaked/script.js").then((lc) => {
|
|||||||
visible: defaultActive !== false,
|
visible: defaultActive !== false,
|
||||||
topLineColor: colors.green(),
|
topLineColor: colors.green(),
|
||||||
bottomLineColor: colors.red(),
|
bottomLineColor: colors.red(),
|
||||||
|
priceLineVisible: false,
|
||||||
|
// bottomFillColor1: "transparent",
|
||||||
|
// bottomFillColor2: "transparent",
|
||||||
|
// topFillColor1: "transparent",
|
||||||
|
// topFillColor2: "transparent",
|
||||||
baseValue: {
|
baseValue: {
|
||||||
price: 0,
|
price: 0,
|
||||||
},
|
},
|
||||||
baseLineStyle: 0,
|
|
||||||
baseLineWidth: 1,
|
|
||||||
baseLineVisible: true,
|
|
||||||
lineVisible: true,
|
lineVisible: true,
|
||||||
|
...options,
|
||||||
},
|
},
|
||||||
paneIndex,
|
paneIndex,
|
||||||
);
|
);
|
||||||
@@ -528,7 +543,7 @@ export default import("./v5.0.6-treeshaked/script.js").then((lc) => {
|
|||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
legend.add({
|
(paneIndex ? legendBottom : legendTop).add({
|
||||||
series,
|
series,
|
||||||
colors: [colors.green, colors.red],
|
colors: [colors.green, colors.red],
|
||||||
name,
|
name,
|
||||||
@@ -647,7 +662,8 @@ export default import("./v5.0.6-treeshaked/script.js").then((lc) => {
|
|||||||
ichart = null;
|
ichart = null;
|
||||||
timeScaleSet = false;
|
timeScaleSet = false;
|
||||||
activeResources.length = 0;
|
activeResources.length = 0;
|
||||||
legend.reset();
|
legendTop.reset();
|
||||||
|
legendBottom.reset();
|
||||||
},
|
},
|
||||||
};
|
};
|
||||||
|
|
||||||
@@ -697,9 +713,10 @@ export default import("./v5.0.6-treeshaked/script.js").then((lc) => {
|
|||||||
* @param {Object} args
|
* @param {Object} args
|
||||||
* @param {Element} args.parent
|
* @param {Element} args.parent
|
||||||
* @param {Signals} args.signals
|
* @param {Signals} args.signals
|
||||||
|
* @param {number} args.paneIndex
|
||||||
* @param {Utilities} args.utils
|
* @param {Utilities} args.utils
|
||||||
*/
|
*/
|
||||||
function createLegend({ parent, signals, utils }) {
|
function createLegend({ parent, signals, utils, paneIndex }) {
|
||||||
const legendElement = window.document.createElement("legend");
|
const legendElement = window.document.createElement("legend");
|
||||||
parent.append(legendElement);
|
parent.append(legendElement);
|
||||||
|
|
||||||
@@ -721,7 +738,7 @@ function createLegend({ parent, signals, utils }) {
|
|||||||
|
|
||||||
legendElement.append(div);
|
legendElement.append(div);
|
||||||
|
|
||||||
const nameId = utils.stringToId(name);
|
const nameId = `${utils.stringToId(name)}-${paneIndex}`;
|
||||||
|
|
||||||
const active = signals.createSignal(defaultActive ?? true, {
|
const active = signals.createSignal(defaultActive ?? true, {
|
||||||
save: {
|
save: {
|
||||||
|
|||||||
@@ -229,14 +229,34 @@ export function init({
|
|||||||
vecIdToIndexes[blueprint.key]
|
vecIdToIndexes[blueprint.key]
|
||||||
);
|
);
|
||||||
if (indexes.includes(index)) {
|
if (indexes.includes(index)) {
|
||||||
chart.addLineSeries({
|
switch (blueprint.type) {
|
||||||
vecId: blueprint.key,
|
case "Baseline": {
|
||||||
color: blueprint.color,
|
chart.addBaselineSeries({
|
||||||
name: blueprint.title,
|
vecId: blueprint.key,
|
||||||
unit,
|
// color: blueprint.color,
|
||||||
defaultActive: blueprint.defaultActive,
|
name: blueprint.title,
|
||||||
paneIndex,
|
unit,
|
||||||
});
|
defaultActive: blueprint.defaultActive,
|
||||||
|
paneIndex,
|
||||||
|
options: blueprint.options,
|
||||||
|
});
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
case "Candlestick": {
|
||||||
|
throw Error("TODO");
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
default:
|
||||||
|
chart.addLineSeries({
|
||||||
|
vecId: blueprint.key,
|
||||||
|
color: blueprint.color,
|
||||||
|
name: blueprint.title,
|
||||||
|
unit,
|
||||||
|
defaultActive: blueprint.defaultActive,
|
||||||
|
paneIndex,
|
||||||
|
options: blueprint.options,
|
||||||
|
});
|
||||||
|
}
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|||||||
@@ -4,7 +4,7 @@
|
|||||||
* @import { Option, PartialChartOption, ChartOption, AnyPartialOption, ProcessedOptionAddons, OptionsTree, SimulationOption, AnySeriesBlueprint, ChartableIndex } from "./options"
|
* @import { Option, PartialChartOption, ChartOption, AnyPartialOption, ProcessedOptionAddons, OptionsTree, SimulationOption, AnySeriesBlueprint, ChartableIndex } from "./options"
|
||||||
* @import {Valued, SingleValueData, CandlestickData, ChartData, OHLCTuple} from "../packages/lightweight-charts/wrapper"
|
* @import {Valued, SingleValueData, CandlestickData, ChartData, OHLCTuple} from "../packages/lightweight-charts/wrapper"
|
||||||
* @import * as _ from "../packages/ufuzzy/v1.0.14/types"
|
* @import * as _ from "../packages/ufuzzy/v1.0.14/types"
|
||||||
* @import { createChart as CreateClassicChart, LineStyleOptions, DeepPartial, ChartOptions, IChartApi, IHorzScaleBehavior, WhitespaceData, ISeriesApi, Time, LineData, LogicalRange, SeriesType, BaselineStyleOptions, SeriesOptionsCommon, BaselineData, CandlestickStyleOptions } from "../packages/lightweight-charts/v5.0.6-treeshaked/types"
|
* @import { createChart as CreateClassicChart, LineStyleOptions, DeepPartial, ChartOptions, IChartApi, IHorzScaleBehavior, WhitespaceData, ISeriesApi, Time, LineData, LogicalRange, BaselineStyleOptions, SeriesOptionsCommon, BaselineData, CandlestickStyleOptions } from "../packages/lightweight-charts/v5.0.6-treeshaked/types"
|
||||||
* @import { SignalOptions } from "../packages/solid-signals/v0.3.0-treeshaked/types/core/core"
|
* @import { SignalOptions } from "../packages/solid-signals/v0.3.0-treeshaked/types/core/core"
|
||||||
* @import {Signal, Signals} from "../packages/solid-signals/types";
|
* @import {Signal, Signals} from "../packages/solid-signals/types";
|
||||||
* @import { getOwner as GetOwner, onCleanup as OnCleanup, Owner } from "../packages/solid-signals/v0.3.0-treeshaked/types/core/owner"
|
* @import { getOwner as GetOwner, onCleanup as OnCleanup, Owner } from "../packages/solid-signals/v0.3.0-treeshaked/types/core/owner"
|
||||||
@@ -25,7 +25,7 @@
|
|||||||
* "Hash" |
|
* "Hash" |
|
||||||
* "Index" |
|
* "Index" |
|
||||||
* "mb" |
|
* "mb" |
|
||||||
* "%" |
|
* "percentage" |
|
||||||
* "Ratio" |
|
* "Ratio" |
|
||||||
* "Sats" |
|
* "Sats" |
|
||||||
* "Seconds" |
|
* "Seconds" |
|
||||||
@@ -37,6 +37,8 @@
|
|||||||
* "Version" |
|
* "Version" |
|
||||||
* "WU" |
|
* "WU" |
|
||||||
* "Bool" |
|
* "Bool" |
|
||||||
|
* "Days" |
|
||||||
|
* "Years" |
|
||||||
* "Locktime" |
|
* "Locktime" |
|
||||||
* "sat/vB" |
|
* "sat/vB" |
|
||||||
* "vB"
|
* "vB"
|
||||||
@@ -684,8 +686,16 @@ function createUtils() {
|
|||||||
let unit;
|
let unit;
|
||||||
if (id.includes("index") || id.includes("height") || id.includes("epoch")) {
|
if (id.includes("index") || id.includes("height") || id.includes("epoch")) {
|
||||||
unit = "Index";
|
unit = "Index";
|
||||||
|
} else if (id === "drawdown" || id.endsWith("oscillator")) {
|
||||||
|
unit = "percentage";
|
||||||
|
} else if (id.endsWith("-as-price")) {
|
||||||
|
unit = "USD";
|
||||||
} else if (id.includes("type")) {
|
} else if (id.includes("type")) {
|
||||||
unit = "Type";
|
unit = "Type";
|
||||||
|
} else if (id.includes("days-")) {
|
||||||
|
unit = "Days";
|
||||||
|
} else if (id.includes("years-")) {
|
||||||
|
unit = "Years";
|
||||||
} else if (id === "rawlocktime") {
|
} else if (id === "rawlocktime") {
|
||||||
unit = "Locktime";
|
unit = "Locktime";
|
||||||
} else if (id.startsWith("is-")) {
|
} else if (id.startsWith("is-")) {
|
||||||
@@ -705,6 +715,8 @@ function createUtils() {
|
|||||||
unit = "Cents";
|
unit = "Cents";
|
||||||
} else if (id.includes("in-usd")) {
|
} else if (id.includes("in-usd")) {
|
||||||
unit = "USD";
|
unit = "USD";
|
||||||
|
} else if (id.includes("ratio")) {
|
||||||
|
unit = "Ratio";
|
||||||
} else if (id.includes("in-btc")) {
|
} else if (id.includes("in-btc")) {
|
||||||
unit = "BTC";
|
unit = "BTC";
|
||||||
} else if (
|
} else if (
|
||||||
@@ -722,7 +734,10 @@ function createUtils() {
|
|||||||
id.includes("high") ||
|
id.includes("high") ||
|
||||||
id.includes("low") ||
|
id.includes("low") ||
|
||||||
id.includes("close") ||
|
id.includes("close") ||
|
||||||
id.includes("ohlc")
|
id.includes("ohlc") ||
|
||||||
|
id.includes("marketcap") ||
|
||||||
|
id.includes("ath") ||
|
||||||
|
id.includes("-sma")
|
||||||
) {
|
) {
|
||||||
unit = "USD";
|
unit = "USD";
|
||||||
} else if (id.includes("count") || id.match(/v[1-3]/g)) {
|
} else if (id.includes("count") || id.match(/v[1-3]/g)) {
|
||||||
@@ -1072,7 +1087,13 @@ function createUtils() {
|
|||||||
* @param {string} s
|
* @param {string} s
|
||||||
*/
|
*/
|
||||||
function stringToId(s) {
|
function stringToId(s) {
|
||||||
return s.replace(/\W/g, " ").trim().replace(/ +/g, "-").toLowerCase();
|
return (
|
||||||
|
s
|
||||||
|
// .replace(/\W/g, " ")
|
||||||
|
.trim()
|
||||||
|
.replace(/ +/g, "-")
|
||||||
|
.toLowerCase()
|
||||||
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
const api = (() => {
|
const api = (() => {
|
||||||
@@ -1570,6 +1591,7 @@ function createColors(dark, elements) {
|
|||||||
red,
|
red,
|
||||||
sky,
|
sky,
|
||||||
blue,
|
blue,
|
||||||
|
emerald,
|
||||||
rose,
|
rose,
|
||||||
green,
|
green,
|
||||||
amber,
|
amber,
|
||||||
|
|||||||
@@ -39,6 +39,11 @@
|
|||||||
*
|
*
|
||||||
* @typedef {BaselineSeriesBlueprint | CandlestickSeriesBlueprint | LineSeriesBlueprint} AnySeriesBlueprint
|
* @typedef {BaselineSeriesBlueprint | CandlestickSeriesBlueprint | LineSeriesBlueprint} AnySeriesBlueprint
|
||||||
*
|
*
|
||||||
|
* @typedef {AnySeriesBlueprint["type"]} SeriesType
|
||||||
|
*
|
||||||
|
* @typedef {BaselineSeriesBlueprint & { key: ChartableVecId }} FetchedBaselineSeriesBlueprint
|
||||||
|
* @typedef {CandlestickSeriesBlueprint & { key: ChartableVecId }} FetchedCandlestickSeriesBlueprint
|
||||||
|
* @typedef {LineSeriesBlueprint & { key: ChartableVecId }} FetchedLineSeriesBlueprint
|
||||||
* @typedef {AnySeriesBlueprint & { key: ChartableVecId }} AnyFetchedSeriesBlueprint
|
* @typedef {AnySeriesBlueprint & { key: ChartableVecId }} AnyFetchedSeriesBlueprint
|
||||||
*
|
*
|
||||||
* @typedef {Object} PartialOption
|
* @typedef {Object} PartialOption
|
||||||
@@ -164,13 +169,38 @@ function createPartialOptions(colors) {
|
|||||||
* @typedef {WithoutSuffix<VecIdMin, MinSuffix>} VecIdMinBase
|
* @typedef {WithoutSuffix<VecIdMin, MinSuffix>} VecIdMinBase
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
const averages = /** @type {const} */ ([
|
||||||
|
{ name: "1 Week", key: "1w", days: 7 },
|
||||||
|
{ name: "8 Days", key: "8d", days: 8 },
|
||||||
|
{ name: "13 Days", key: "13d", days: 13 },
|
||||||
|
{ name: "21 Days", key: "21d", days: 21 },
|
||||||
|
{ name: "1 Month", key: "1m", days: 30 },
|
||||||
|
{ name: "34 Days", key: "34d", days: 34 },
|
||||||
|
{ name: "55 Days", key: "55d", days: 55 },
|
||||||
|
{ name: "89 Days", key: "89d", days: 89 },
|
||||||
|
{ name: "144 Days", key: "144d", days: 144 },
|
||||||
|
{ name: "1 Year", key: "1y", days: 365 },
|
||||||
|
{ name: "2 Years", key: "2y", days: 2 * 365 },
|
||||||
|
{ name: "200 Weeks", key: "200w", days: 200 * 7 },
|
||||||
|
{ name: "4 Years", key: "4y", days: 4 * 365 },
|
||||||
|
]);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @param {Object} args
|
* @param {Object} args
|
||||||
* @param {ChartableVecId} args.key
|
* @param {ChartableVecId} args.key
|
||||||
* @param {string} args.name
|
* @param {string} args.name
|
||||||
|
* @param {Color} [args.color]
|
||||||
|
* @param {boolean} [args.defaultActive]
|
||||||
|
* @param {DeepPartial<LineStyleOptions & SeriesOptionsCommon>} [args.options]
|
||||||
*/
|
*/
|
||||||
function createBaseSeries({ key, name }) {
|
function createBaseSeries({ key, name, color, defaultActive, options }) {
|
||||||
return { key, title: name };
|
return /** @satisfies {AnyFetchedSeriesBlueprint} */ ({
|
||||||
|
key,
|
||||||
|
title: name,
|
||||||
|
color,
|
||||||
|
defaultActive,
|
||||||
|
options,
|
||||||
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -509,8 +539,216 @@ function createPartialOptions(colors) {
|
|||||||
// ],
|
// ],
|
||||||
// },
|
// },
|
||||||
{
|
{
|
||||||
name: "By type",
|
name: "types",
|
||||||
tree: [],
|
tree: [
|
||||||
|
{
|
||||||
|
name: "p2pk",
|
||||||
|
title: "Pay To Public Key Outputs",
|
||||||
|
bottom: [
|
||||||
|
createBaseSeries({
|
||||||
|
key: "p2pk33-count",
|
||||||
|
name: "33B Count",
|
||||||
|
}),
|
||||||
|
createBaseSeries({
|
||||||
|
key: "p2pk33-count-sum",
|
||||||
|
name: "33B sum",
|
||||||
|
}),
|
||||||
|
createBaseSeries({
|
||||||
|
key: "total-p2pk33-count",
|
||||||
|
name: "33B total",
|
||||||
|
}),
|
||||||
|
createBaseSeries({
|
||||||
|
key: "p2pk65-count",
|
||||||
|
name: "65B Count",
|
||||||
|
}),
|
||||||
|
createBaseSeries({
|
||||||
|
key: "p2pk65-count-sum",
|
||||||
|
name: "65B sum",
|
||||||
|
}),
|
||||||
|
createBaseSeries({
|
||||||
|
key: "total-p2pk65-count",
|
||||||
|
name: "65B total",
|
||||||
|
}),
|
||||||
|
],
|
||||||
|
},
|
||||||
|
{
|
||||||
|
name: "p2pkh",
|
||||||
|
title: "Pay To Public Key Hash Outputs",
|
||||||
|
bottom: [
|
||||||
|
createBaseSeries({
|
||||||
|
key: "p2pkh-count",
|
||||||
|
name: "Count",
|
||||||
|
}),
|
||||||
|
createBaseSeries({
|
||||||
|
key: "p2pkh-count-sum",
|
||||||
|
name: "sum",
|
||||||
|
}),
|
||||||
|
createBaseSeries({
|
||||||
|
key: "total-p2pkh-count",
|
||||||
|
name: "total",
|
||||||
|
}),
|
||||||
|
],
|
||||||
|
},
|
||||||
|
{
|
||||||
|
name: "p2ms",
|
||||||
|
title: "Pay To Multisig Outputs",
|
||||||
|
bottom: [
|
||||||
|
createBaseSeries({
|
||||||
|
key: "p2ms-count",
|
||||||
|
name: "Count",
|
||||||
|
}),
|
||||||
|
createBaseSeries({
|
||||||
|
key: "p2ms-count-sum",
|
||||||
|
name: "sum",
|
||||||
|
}),
|
||||||
|
createBaseSeries({
|
||||||
|
key: "total-p2ms-count",
|
||||||
|
name: "total",
|
||||||
|
}),
|
||||||
|
],
|
||||||
|
},
|
||||||
|
{
|
||||||
|
name: "p2sh",
|
||||||
|
title: "Pay To Script Hash Outputs",
|
||||||
|
bottom: [
|
||||||
|
createBaseSeries({
|
||||||
|
key: "p2sh-count",
|
||||||
|
name: "Count",
|
||||||
|
}),
|
||||||
|
createBaseSeries({
|
||||||
|
key: "p2sh-count-sum",
|
||||||
|
name: "sum",
|
||||||
|
}),
|
||||||
|
createBaseSeries({
|
||||||
|
key: "total-p2sh-count",
|
||||||
|
name: "total",
|
||||||
|
}),
|
||||||
|
],
|
||||||
|
},
|
||||||
|
{
|
||||||
|
name: "op_return",
|
||||||
|
title: "op_return outputs",
|
||||||
|
bottom: [
|
||||||
|
createBaseSeries({ key: "opreturn-count", name: "Count" }),
|
||||||
|
createBaseSeries({
|
||||||
|
key: "opreturn-count-sum",
|
||||||
|
name: "sum",
|
||||||
|
}),
|
||||||
|
createBaseSeries({
|
||||||
|
key: "total-opreturn-count",
|
||||||
|
name: "total",
|
||||||
|
}),
|
||||||
|
],
|
||||||
|
},
|
||||||
|
{
|
||||||
|
name: "p2wpkh",
|
||||||
|
title: "Pay To Witness Public Key Hash Outputs",
|
||||||
|
bottom: [
|
||||||
|
createBaseSeries({
|
||||||
|
key: "p2wpkh-count",
|
||||||
|
name: "Count",
|
||||||
|
}),
|
||||||
|
createBaseSeries({
|
||||||
|
key: "p2wpkh-count-sum",
|
||||||
|
name: "sum",
|
||||||
|
}),
|
||||||
|
createBaseSeries({
|
||||||
|
key: "total-p2wpkh-count",
|
||||||
|
name: "total",
|
||||||
|
}),
|
||||||
|
],
|
||||||
|
},
|
||||||
|
{
|
||||||
|
name: "p2wsh",
|
||||||
|
title: "Pay To Witness Script Hash Outputs",
|
||||||
|
bottom: [
|
||||||
|
createBaseSeries({
|
||||||
|
key: "p2wsh-count",
|
||||||
|
name: "Count",
|
||||||
|
}),
|
||||||
|
createBaseSeries({
|
||||||
|
key: "p2wsh-count-sum",
|
||||||
|
name: "sum",
|
||||||
|
}),
|
||||||
|
createBaseSeries({
|
||||||
|
key: "total-p2wsh-count",
|
||||||
|
name: "total",
|
||||||
|
}),
|
||||||
|
],
|
||||||
|
},
|
||||||
|
{
|
||||||
|
name: "p2tr",
|
||||||
|
title: "Pay To Taproot Outputs",
|
||||||
|
bottom: [
|
||||||
|
createBaseSeries({
|
||||||
|
key: "p2tr-count",
|
||||||
|
name: "Count",
|
||||||
|
}),
|
||||||
|
createBaseSeries({
|
||||||
|
key: "p2tr-count-sum",
|
||||||
|
name: "sum",
|
||||||
|
}),
|
||||||
|
createBaseSeries({
|
||||||
|
key: "total-p2tr-count",
|
||||||
|
name: "total",
|
||||||
|
}),
|
||||||
|
],
|
||||||
|
},
|
||||||
|
{
|
||||||
|
name: "p2a",
|
||||||
|
title: "Pay To Anchor outputs",
|
||||||
|
bottom: [
|
||||||
|
createBaseSeries({
|
||||||
|
key: "p2a-count",
|
||||||
|
name: "Count",
|
||||||
|
}),
|
||||||
|
createBaseSeries({
|
||||||
|
key: "p2a-count-sum",
|
||||||
|
name: "sum",
|
||||||
|
}),
|
||||||
|
createBaseSeries({
|
||||||
|
key: "total-p2a-count",
|
||||||
|
name: "total",
|
||||||
|
}),
|
||||||
|
],
|
||||||
|
},
|
||||||
|
{
|
||||||
|
name: "empty",
|
||||||
|
title: "empty outputs",
|
||||||
|
bottom: [
|
||||||
|
createBaseSeries({
|
||||||
|
key: "emptyoutput-count",
|
||||||
|
name: "Count",
|
||||||
|
}),
|
||||||
|
createBaseSeries({
|
||||||
|
key: "emptyoutput-count-sum",
|
||||||
|
name: "sum",
|
||||||
|
}),
|
||||||
|
createBaseSeries({
|
||||||
|
key: "total-emptyoutput-count",
|
||||||
|
name: "total",
|
||||||
|
}),
|
||||||
|
],
|
||||||
|
},
|
||||||
|
{
|
||||||
|
name: "unknown",
|
||||||
|
title: "unknown outputs",
|
||||||
|
bottom: [
|
||||||
|
createBaseSeries({
|
||||||
|
key: "unknownoutput-count",
|
||||||
|
name: "Count",
|
||||||
|
}),
|
||||||
|
createBaseSeries({
|
||||||
|
key: "unknownoutput-count-sum",
|
||||||
|
name: "sum",
|
||||||
|
}),
|
||||||
|
createBaseSeries({
|
||||||
|
key: "total-unknownoutput-count",
|
||||||
|
name: "total",
|
||||||
|
}),
|
||||||
|
],
|
||||||
|
},
|
||||||
|
],
|
||||||
// title: "Transaction Output Value",
|
// title: "Transaction Output Value",
|
||||||
// bottom: [
|
// bottom: [
|
||||||
// createAverageSeries({ concat: "output-value" }),
|
// createAverageSeries({ concat: "output-value" }),
|
||||||
@@ -564,6 +802,299 @@ function createPartialOptions(colors) {
|
|||||||
},
|
},
|
||||||
],
|
],
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
name: "Market",
|
||||||
|
tree: [
|
||||||
|
{
|
||||||
|
name: "Capitalization",
|
||||||
|
title: "Market Capitalization",
|
||||||
|
bottom: [
|
||||||
|
createBaseSeries({
|
||||||
|
key: "marketcap",
|
||||||
|
name: "Capitalization",
|
||||||
|
}),
|
||||||
|
],
|
||||||
|
},
|
||||||
|
{
|
||||||
|
name: "All Time High",
|
||||||
|
tree: [
|
||||||
|
{
|
||||||
|
name: "Value",
|
||||||
|
title: "All Time High",
|
||||||
|
top: [
|
||||||
|
createBaseSeries({
|
||||||
|
key: "ath",
|
||||||
|
name: "ath",
|
||||||
|
}),
|
||||||
|
],
|
||||||
|
},
|
||||||
|
{
|
||||||
|
name: "drawdown",
|
||||||
|
title: "All Time High Drawdown",
|
||||||
|
top: [
|
||||||
|
createBaseSeries({
|
||||||
|
key: "ath",
|
||||||
|
name: "ath",
|
||||||
|
}),
|
||||||
|
],
|
||||||
|
bottom: [
|
||||||
|
createBaseSeries({
|
||||||
|
key: "drawdown",
|
||||||
|
name: "Drawdown",
|
||||||
|
color: colors.red,
|
||||||
|
}),
|
||||||
|
],
|
||||||
|
},
|
||||||
|
{
|
||||||
|
name: "days since",
|
||||||
|
title: "Number of days Since All Time High",
|
||||||
|
top: [
|
||||||
|
createBaseSeries({
|
||||||
|
key: "ath",
|
||||||
|
name: "ath",
|
||||||
|
}),
|
||||||
|
],
|
||||||
|
bottom: [
|
||||||
|
createBaseSeries({
|
||||||
|
key: "days-since-ath",
|
||||||
|
name: "Days",
|
||||||
|
}),
|
||||||
|
],
|
||||||
|
},
|
||||||
|
{
|
||||||
|
name: "max between",
|
||||||
|
title: "Maximum time between All Time Highs",
|
||||||
|
top: [
|
||||||
|
createBaseSeries({
|
||||||
|
key: "ath",
|
||||||
|
name: "ath",
|
||||||
|
}),
|
||||||
|
],
|
||||||
|
bottom: [
|
||||||
|
createBaseSeries({
|
||||||
|
key: "max-days-between-ath",
|
||||||
|
name: "Days",
|
||||||
|
}),
|
||||||
|
createBaseSeries({
|
||||||
|
key: "max-years-between-ath",
|
||||||
|
name: "Years",
|
||||||
|
}),
|
||||||
|
],
|
||||||
|
},
|
||||||
|
],
|
||||||
|
},
|
||||||
|
{
|
||||||
|
name: "Average",
|
||||||
|
tree: [
|
||||||
|
{
|
||||||
|
name: "Compare",
|
||||||
|
title: "Moving Averages",
|
||||||
|
top: averages.map(({ days, key, name }) =>
|
||||||
|
createBaseSeries({
|
||||||
|
key: `${key}-sma`,
|
||||||
|
name: key,
|
||||||
|
color: colors[`_${key}`],
|
||||||
|
}),
|
||||||
|
),
|
||||||
|
},
|
||||||
|
...averages.map(({ key, name }) => ({
|
||||||
|
name,
|
||||||
|
title: `${name} Market Price Moving Average`,
|
||||||
|
top: [
|
||||||
|
createBaseSeries({
|
||||||
|
key: `${key}-sma`,
|
||||||
|
name: "Average",
|
||||||
|
color: colors[`_${key}`],
|
||||||
|
}),
|
||||||
|
createBaseSeries({
|
||||||
|
key: `${key}-sma-ratio-p1sd-as-price`,
|
||||||
|
name: "+1σ",
|
||||||
|
color: colors.orange,
|
||||||
|
defaultActive: false,
|
||||||
|
}),
|
||||||
|
createBaseSeries({
|
||||||
|
key: `${key}-sma-ratio-p2sd-as-price`,
|
||||||
|
name: "+2σ",
|
||||||
|
color: colors.red,
|
||||||
|
defaultActive: false,
|
||||||
|
}),
|
||||||
|
createBaseSeries({
|
||||||
|
key: `${key}-sma-ratio-p3sd-as-price`,
|
||||||
|
name: "+3σ",
|
||||||
|
color: colors.pink,
|
||||||
|
defaultActive: false,
|
||||||
|
}),
|
||||||
|
createBaseSeries({
|
||||||
|
key: `${key}-sma-ratio-m1sd-as-price`,
|
||||||
|
name: "−1σ",
|
||||||
|
color: colors.cyan,
|
||||||
|
defaultActive: false,
|
||||||
|
}),
|
||||||
|
createBaseSeries({
|
||||||
|
key: `${key}-sma-ratio-m2sd-as-price`,
|
||||||
|
name: "−2σ",
|
||||||
|
color: colors.blue,
|
||||||
|
defaultActive: false,
|
||||||
|
}),
|
||||||
|
createBaseSeries({
|
||||||
|
key: `${key}-sma-ratio-m3sd-as-price`,
|
||||||
|
name: "−3σ",
|
||||||
|
color: colors.violet,
|
||||||
|
defaultActive: false,
|
||||||
|
}),
|
||||||
|
createBaseSeries({
|
||||||
|
key: `${key}-sma-ratio-p99-as-price`,
|
||||||
|
name: "p99",
|
||||||
|
color: colors.orange,
|
||||||
|
defaultActive: false,
|
||||||
|
}),
|
||||||
|
createBaseSeries({
|
||||||
|
key: `${key}-sma-ratio-p99-5-as-price`,
|
||||||
|
name: "p99.5",
|
||||||
|
color: colors.red,
|
||||||
|
defaultActive: false,
|
||||||
|
}),
|
||||||
|
createBaseSeries({
|
||||||
|
key: `${key}-sma-ratio-p99-9-as-price`,
|
||||||
|
name: "p99.9",
|
||||||
|
color: colors.pink,
|
||||||
|
defaultActive: false,
|
||||||
|
}),
|
||||||
|
createBaseSeries({
|
||||||
|
key: `${key}-sma-ratio-p1-as-price`,
|
||||||
|
name: "p1",
|
||||||
|
color: colors.cyan,
|
||||||
|
defaultActive: false,
|
||||||
|
}),
|
||||||
|
createBaseSeries({
|
||||||
|
key: `${key}-sma-ratio-p0-5-as-price`,
|
||||||
|
name: "p0.5",
|
||||||
|
color: colors.blue,
|
||||||
|
defaultActive: false,
|
||||||
|
}),
|
||||||
|
createBaseSeries({
|
||||||
|
key: `${key}-sma-ratio-p0-1-as-price`,
|
||||||
|
name: "p0.1",
|
||||||
|
color: colors.violet,
|
||||||
|
defaultActive: false,
|
||||||
|
}),
|
||||||
|
],
|
||||||
|
bottom: [
|
||||||
|
/** @satisfies {FetchedBaselineSeriesBlueprint} */ ({
|
||||||
|
key: `${key}-sma-ratio`,
|
||||||
|
title: "Ratio",
|
||||||
|
type: "Baseline",
|
||||||
|
options: {
|
||||||
|
baseValue: { type: "price", price: 1 },
|
||||||
|
},
|
||||||
|
}),
|
||||||
|
createBaseSeries({
|
||||||
|
key: `${key}-sma-ratio-sma`,
|
||||||
|
name: "sma",
|
||||||
|
color: colors.yellow,
|
||||||
|
defaultActive: false,
|
||||||
|
}),
|
||||||
|
createBaseSeries({
|
||||||
|
key: `${key}-sma-ratio-p1sd`,
|
||||||
|
name: "+1σ",
|
||||||
|
color: colors.orange,
|
||||||
|
defaultActive: false,
|
||||||
|
}),
|
||||||
|
createBaseSeries({
|
||||||
|
key: `${key}-sma-ratio-p2sd`,
|
||||||
|
name: "+2σ",
|
||||||
|
color: colors.red,
|
||||||
|
defaultActive: false,
|
||||||
|
}),
|
||||||
|
createBaseSeries({
|
||||||
|
key: `${key}-sma-ratio-p3sd`,
|
||||||
|
name: "+3σ",
|
||||||
|
color: colors.pink,
|
||||||
|
defaultActive: false,
|
||||||
|
}),
|
||||||
|
createBaseSeries({
|
||||||
|
key: `${key}-sma-ratio-m1sd`,
|
||||||
|
name: "−1σ",
|
||||||
|
color: colors.cyan,
|
||||||
|
defaultActive: false,
|
||||||
|
}),
|
||||||
|
createBaseSeries({
|
||||||
|
key: `${key}-sma-ratio-m2sd`,
|
||||||
|
name: "−2σ",
|
||||||
|
color: colors.blue,
|
||||||
|
defaultActive: false,
|
||||||
|
}),
|
||||||
|
createBaseSeries({
|
||||||
|
key: `${key}-sma-ratio-m3sd`,
|
||||||
|
name: "−3σ",
|
||||||
|
color: colors.violet,
|
||||||
|
defaultActive: false,
|
||||||
|
}),
|
||||||
|
createBaseSeries({
|
||||||
|
key: `${key}-sma-ratio-p99`,
|
||||||
|
name: "p99",
|
||||||
|
color: colors.orange,
|
||||||
|
defaultActive: false,
|
||||||
|
}),
|
||||||
|
createBaseSeries({
|
||||||
|
key: `${key}-sma-ratio-p99-5`,
|
||||||
|
name: "p99.5",
|
||||||
|
color: colors.red,
|
||||||
|
defaultActive: false,
|
||||||
|
}),
|
||||||
|
createBaseSeries({
|
||||||
|
key: `${key}-sma-ratio-p99-9`,
|
||||||
|
name: "p99.9",
|
||||||
|
color: colors.pink,
|
||||||
|
defaultActive: false,
|
||||||
|
}),
|
||||||
|
createBaseSeries({
|
||||||
|
key: `${key}-sma-ratio-p1`,
|
||||||
|
name: "p1",
|
||||||
|
color: colors.cyan,
|
||||||
|
defaultActive: false,
|
||||||
|
}),
|
||||||
|
createBaseSeries({
|
||||||
|
key: `${key}-sma-ratio-p0-5`,
|
||||||
|
name: "p0.5",
|
||||||
|
color: colors.blue,
|
||||||
|
defaultActive: false,
|
||||||
|
}),
|
||||||
|
createBaseSeries({
|
||||||
|
key: `${key}-sma-ratio-p0-1`,
|
||||||
|
name: "p0.1",
|
||||||
|
color: colors.violet,
|
||||||
|
defaultActive: false,
|
||||||
|
}),
|
||||||
|
createBaseSeries({
|
||||||
|
key: `${key}-sma-ratio-1w-sma`,
|
||||||
|
name: "1w sma",
|
||||||
|
color: colors.fuchsia,
|
||||||
|
defaultActive: false,
|
||||||
|
}),
|
||||||
|
createBaseSeries({
|
||||||
|
key: `${key}-sma-ratio-1m-sma`,
|
||||||
|
name: "1m sma",
|
||||||
|
color: colors.pink,
|
||||||
|
defaultActive: false,
|
||||||
|
}),
|
||||||
|
createBaseSeries({
|
||||||
|
key: `${key}-sma-ratio-1y-sma`,
|
||||||
|
name: "1y sma",
|
||||||
|
color: colors.rose,
|
||||||
|
defaultActive: false,
|
||||||
|
}),
|
||||||
|
/** @satisfies {FetchedBaselineSeriesBlueprint} */ ({
|
||||||
|
key: `${key}-sma-ratio-1y-sma-momentum-oscillator`,
|
||||||
|
title: "1Y Momentum",
|
||||||
|
type: "Baseline",
|
||||||
|
}),
|
||||||
|
],
|
||||||
|
})),
|
||||||
|
],
|
||||||
|
},
|
||||||
|
],
|
||||||
|
},
|
||||||
],
|
],
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
@@ -1401,22 +1932,6 @@ export function initOptions({
|
|||||||
// },
|
// },
|
||||||
// ]);
|
// ]);
|
||||||
|
|
||||||
// const averages = /** @type {const} */ ([
|
|
||||||
// { name: "1 Week", key: "1w", days: 7 },
|
|
||||||
// { name: "8 Days", key: "8d", days: 8 },
|
|
||||||
// { name: "13 Days", key: "13d", days: 13 },
|
|
||||||
// { name: "21 Days", key: "21d", days: 21 },
|
|
||||||
// { name: "1 Month", key: "1m", days: 30 },
|
|
||||||
// { name: "34 Days", key: "34d", days: 34 },
|
|
||||||
// { name: "55 Days", key: "55d", days: 55 },
|
|
||||||
// { name: "89 Days", key: "89d", days: 89 },
|
|
||||||
// { name: "144 Days", key: "144d", days: 144 },
|
|
||||||
// { name: "1 Year", key: "1y", days: 365 },
|
|
||||||
// { name: "2 Years", key: "2y", days: 2 * 365 },
|
|
||||||
// { name: "200 Weeks", key: "200w", days: 200 * 7 },
|
|
||||||
// { name: "4 Years", key: "4y", days: 4 * 365 },
|
|
||||||
// ]);
|
|
||||||
|
|
||||||
// const totalReturns = /** @type {const} */ ([
|
// const totalReturns = /** @type {const} */ ([
|
||||||
// { name: "1 Day", key: "1d" },
|
// { name: "1 Day", key: "1d" },
|
||||||
// { name: "1 Month", key: "1m" },
|
// { name: "1 Month", key: "1m" },
|
||||||
|
|||||||
@@ -56,6 +56,423 @@ export function createVecIdToIndexes() {
|
|||||||
const YearIndex = /** @satisfies {YearIndex} */ (23);
|
const YearIndex = /** @satisfies {YearIndex} */ (23);
|
||||||
|
|
||||||
return /** @type {const} */ ({
|
return /** @type {const} */ ({
|
||||||
|
"13d-sma": [DateIndex, DecadeIndex, MonthIndex, QuarterIndex, WeekIndex, YearIndex],
|
||||||
|
"13d-sma-ratio": [DateIndex, DecadeIndex, MonthIndex, QuarterIndex, WeekIndex, YearIndex],
|
||||||
|
"13d-sma-ratio-1m-sma": [DateIndex, DecadeIndex, MonthIndex, QuarterIndex, WeekIndex, YearIndex],
|
||||||
|
"13d-sma-ratio-1w-sma": [DateIndex, DecadeIndex, MonthIndex, QuarterIndex, WeekIndex, YearIndex],
|
||||||
|
"13d-sma-ratio-1y-sma": [DateIndex, DecadeIndex, MonthIndex, QuarterIndex, WeekIndex, YearIndex],
|
||||||
|
"13d-sma-ratio-1y-sma-momentum-oscillator": [DateIndex, DecadeIndex, MonthIndex, QuarterIndex, WeekIndex, YearIndex],
|
||||||
|
"13d-sma-ratio-m1sd": [DateIndex, DecadeIndex, MonthIndex, QuarterIndex, WeekIndex, YearIndex],
|
||||||
|
"13d-sma-ratio-m1sd-as-price": [DateIndex, DecadeIndex, MonthIndex, QuarterIndex, WeekIndex, YearIndex],
|
||||||
|
"13d-sma-ratio-m2sd": [DateIndex, DecadeIndex, MonthIndex, QuarterIndex, WeekIndex, YearIndex],
|
||||||
|
"13d-sma-ratio-m2sd-as-price": [DateIndex, DecadeIndex, MonthIndex, QuarterIndex, WeekIndex, YearIndex],
|
||||||
|
"13d-sma-ratio-m3sd": [DateIndex, DecadeIndex, MonthIndex, QuarterIndex, WeekIndex, YearIndex],
|
||||||
|
"13d-sma-ratio-m3sd-as-price": [DateIndex, DecadeIndex, MonthIndex, QuarterIndex, WeekIndex, YearIndex],
|
||||||
|
"13d-sma-ratio-p0-1": [DateIndex, DecadeIndex, MonthIndex, QuarterIndex, WeekIndex, YearIndex],
|
||||||
|
"13d-sma-ratio-p0-1-as-price": [DateIndex, DecadeIndex, MonthIndex, QuarterIndex, WeekIndex, YearIndex],
|
||||||
|
"13d-sma-ratio-p0-5": [DateIndex, DecadeIndex, MonthIndex, QuarterIndex, WeekIndex, YearIndex],
|
||||||
|
"13d-sma-ratio-p0-5-as-price": [DateIndex, DecadeIndex, MonthIndex, QuarterIndex, WeekIndex, YearIndex],
|
||||||
|
"13d-sma-ratio-p1": [DateIndex, DecadeIndex, MonthIndex, QuarterIndex, WeekIndex, YearIndex],
|
||||||
|
"13d-sma-ratio-p1-as-price": [DateIndex, DecadeIndex, MonthIndex, QuarterIndex, WeekIndex, YearIndex],
|
||||||
|
"13d-sma-ratio-p1sd": [DateIndex, DecadeIndex, MonthIndex, QuarterIndex, WeekIndex, YearIndex],
|
||||||
|
"13d-sma-ratio-p1sd-as-price": [DateIndex, DecadeIndex, MonthIndex, QuarterIndex, WeekIndex, YearIndex],
|
||||||
|
"13d-sma-ratio-p2sd": [DateIndex, DecadeIndex, MonthIndex, QuarterIndex, WeekIndex, YearIndex],
|
||||||
|
"13d-sma-ratio-p2sd-as-price": [DateIndex, DecadeIndex, MonthIndex, QuarterIndex, WeekIndex, YearIndex],
|
||||||
|
"13d-sma-ratio-p3sd": [DateIndex, DecadeIndex, MonthIndex, QuarterIndex, WeekIndex, YearIndex],
|
||||||
|
"13d-sma-ratio-p3sd-as-price": [DateIndex, DecadeIndex, MonthIndex, QuarterIndex, WeekIndex, YearIndex],
|
||||||
|
"13d-sma-ratio-p99": [DateIndex, DecadeIndex, MonthIndex, QuarterIndex, WeekIndex, YearIndex],
|
||||||
|
"13d-sma-ratio-p99-5": [DateIndex, DecadeIndex, MonthIndex, QuarterIndex, WeekIndex, YearIndex],
|
||||||
|
"13d-sma-ratio-p99-5-as-price": [DateIndex, DecadeIndex, MonthIndex, QuarterIndex, WeekIndex, YearIndex],
|
||||||
|
"13d-sma-ratio-p99-9": [DateIndex, DecadeIndex, MonthIndex, QuarterIndex, WeekIndex, YearIndex],
|
||||||
|
"13d-sma-ratio-p99-9-as-price": [DateIndex, DecadeIndex, MonthIndex, QuarterIndex, WeekIndex, YearIndex],
|
||||||
|
"13d-sma-ratio-p99-as-price": [DateIndex, DecadeIndex, MonthIndex, QuarterIndex, WeekIndex, YearIndex],
|
||||||
|
"13d-sma-ratio-sma": [DateIndex, DecadeIndex, MonthIndex, QuarterIndex, WeekIndex, YearIndex],
|
||||||
|
"13d-sma-ratio-standard-deviation": [DateIndex, DecadeIndex, MonthIndex, QuarterIndex, WeekIndex, YearIndex],
|
||||||
|
"144d-sma": [DateIndex, DecadeIndex, MonthIndex, QuarterIndex, WeekIndex, YearIndex],
|
||||||
|
"144d-sma-ratio": [DateIndex, DecadeIndex, MonthIndex, QuarterIndex, WeekIndex, YearIndex],
|
||||||
|
"144d-sma-ratio-1m-sma": [DateIndex, DecadeIndex, MonthIndex, QuarterIndex, WeekIndex, YearIndex],
|
||||||
|
"144d-sma-ratio-1w-sma": [DateIndex, DecadeIndex, MonthIndex, QuarterIndex, WeekIndex, YearIndex],
|
||||||
|
"144d-sma-ratio-1y-sma": [DateIndex, DecadeIndex, MonthIndex, QuarterIndex, WeekIndex, YearIndex],
|
||||||
|
"144d-sma-ratio-1y-sma-momentum-oscillator": [DateIndex, DecadeIndex, MonthIndex, QuarterIndex, WeekIndex, YearIndex],
|
||||||
|
"144d-sma-ratio-m1sd": [DateIndex, DecadeIndex, MonthIndex, QuarterIndex, WeekIndex, YearIndex],
|
||||||
|
"144d-sma-ratio-m1sd-as-price": [DateIndex, DecadeIndex, MonthIndex, QuarterIndex, WeekIndex, YearIndex],
|
||||||
|
"144d-sma-ratio-m2sd": [DateIndex, DecadeIndex, MonthIndex, QuarterIndex, WeekIndex, YearIndex],
|
||||||
|
"144d-sma-ratio-m2sd-as-price": [DateIndex, DecadeIndex, MonthIndex, QuarterIndex, WeekIndex, YearIndex],
|
||||||
|
"144d-sma-ratio-m3sd": [DateIndex, DecadeIndex, MonthIndex, QuarterIndex, WeekIndex, YearIndex],
|
||||||
|
"144d-sma-ratio-m3sd-as-price": [DateIndex, DecadeIndex, MonthIndex, QuarterIndex, WeekIndex, YearIndex],
|
||||||
|
"144d-sma-ratio-p0-1": [DateIndex, DecadeIndex, MonthIndex, QuarterIndex, WeekIndex, YearIndex],
|
||||||
|
"144d-sma-ratio-p0-1-as-price": [DateIndex, DecadeIndex, MonthIndex, QuarterIndex, WeekIndex, YearIndex],
|
||||||
|
"144d-sma-ratio-p0-5": [DateIndex, DecadeIndex, MonthIndex, QuarterIndex, WeekIndex, YearIndex],
|
||||||
|
"144d-sma-ratio-p0-5-as-price": [DateIndex, DecadeIndex, MonthIndex, QuarterIndex, WeekIndex, YearIndex],
|
||||||
|
"144d-sma-ratio-p1": [DateIndex, DecadeIndex, MonthIndex, QuarterIndex, WeekIndex, YearIndex],
|
||||||
|
"144d-sma-ratio-p1-as-price": [DateIndex, DecadeIndex, MonthIndex, QuarterIndex, WeekIndex, YearIndex],
|
||||||
|
"144d-sma-ratio-p1sd": [DateIndex, DecadeIndex, MonthIndex, QuarterIndex, WeekIndex, YearIndex],
|
||||||
|
"144d-sma-ratio-p1sd-as-price": [DateIndex, DecadeIndex, MonthIndex, QuarterIndex, WeekIndex, YearIndex],
|
||||||
|
"144d-sma-ratio-p2sd": [DateIndex, DecadeIndex, MonthIndex, QuarterIndex, WeekIndex, YearIndex],
|
||||||
|
"144d-sma-ratio-p2sd-as-price": [DateIndex, DecadeIndex, MonthIndex, QuarterIndex, WeekIndex, YearIndex],
|
||||||
|
"144d-sma-ratio-p3sd": [DateIndex, DecadeIndex, MonthIndex, QuarterIndex, WeekIndex, YearIndex],
|
||||||
|
"144d-sma-ratio-p3sd-as-price": [DateIndex, DecadeIndex, MonthIndex, QuarterIndex, WeekIndex, YearIndex],
|
||||||
|
"144d-sma-ratio-p99": [DateIndex, DecadeIndex, MonthIndex, QuarterIndex, WeekIndex, YearIndex],
|
||||||
|
"144d-sma-ratio-p99-5": [DateIndex, DecadeIndex, MonthIndex, QuarterIndex, WeekIndex, YearIndex],
|
||||||
|
"144d-sma-ratio-p99-5-as-price": [DateIndex, DecadeIndex, MonthIndex, QuarterIndex, WeekIndex, YearIndex],
|
||||||
|
"144d-sma-ratio-p99-9": [DateIndex, DecadeIndex, MonthIndex, QuarterIndex, WeekIndex, YearIndex],
|
||||||
|
"144d-sma-ratio-p99-9-as-price": [DateIndex, DecadeIndex, MonthIndex, QuarterIndex, WeekIndex, YearIndex],
|
||||||
|
"144d-sma-ratio-p99-as-price": [DateIndex, DecadeIndex, MonthIndex, QuarterIndex, WeekIndex, YearIndex],
|
||||||
|
"144d-sma-ratio-sma": [DateIndex, DecadeIndex, MonthIndex, QuarterIndex, WeekIndex, YearIndex],
|
||||||
|
"144d-sma-ratio-standard-deviation": [DateIndex, DecadeIndex, MonthIndex, QuarterIndex, WeekIndex, YearIndex],
|
||||||
|
"1m-sma": [DateIndex, DecadeIndex, MonthIndex, QuarterIndex, WeekIndex, YearIndex],
|
||||||
|
"1m-sma-ratio": [DateIndex, DecadeIndex, MonthIndex, QuarterIndex, WeekIndex, YearIndex],
|
||||||
|
"1m-sma-ratio-1m-sma": [DateIndex, DecadeIndex, MonthIndex, QuarterIndex, WeekIndex, YearIndex],
|
||||||
|
"1m-sma-ratio-1w-sma": [DateIndex, DecadeIndex, MonthIndex, QuarterIndex, WeekIndex, YearIndex],
|
||||||
|
"1m-sma-ratio-1y-sma": [DateIndex, DecadeIndex, MonthIndex, QuarterIndex, WeekIndex, YearIndex],
|
||||||
|
"1m-sma-ratio-1y-sma-momentum-oscillator": [DateIndex, DecadeIndex, MonthIndex, QuarterIndex, WeekIndex, YearIndex],
|
||||||
|
"1m-sma-ratio-m1sd": [DateIndex, DecadeIndex, MonthIndex, QuarterIndex, WeekIndex, YearIndex],
|
||||||
|
"1m-sma-ratio-m1sd-as-price": [DateIndex, DecadeIndex, MonthIndex, QuarterIndex, WeekIndex, YearIndex],
|
||||||
|
"1m-sma-ratio-m2sd": [DateIndex, DecadeIndex, MonthIndex, QuarterIndex, WeekIndex, YearIndex],
|
||||||
|
"1m-sma-ratio-m2sd-as-price": [DateIndex, DecadeIndex, MonthIndex, QuarterIndex, WeekIndex, YearIndex],
|
||||||
|
"1m-sma-ratio-m3sd": [DateIndex, DecadeIndex, MonthIndex, QuarterIndex, WeekIndex, YearIndex],
|
||||||
|
"1m-sma-ratio-m3sd-as-price": [DateIndex, DecadeIndex, MonthIndex, QuarterIndex, WeekIndex, YearIndex],
|
||||||
|
"1m-sma-ratio-p0-1": [DateIndex, DecadeIndex, MonthIndex, QuarterIndex, WeekIndex, YearIndex],
|
||||||
|
"1m-sma-ratio-p0-1-as-price": [DateIndex, DecadeIndex, MonthIndex, QuarterIndex, WeekIndex, YearIndex],
|
||||||
|
"1m-sma-ratio-p0-5": [DateIndex, DecadeIndex, MonthIndex, QuarterIndex, WeekIndex, YearIndex],
|
||||||
|
"1m-sma-ratio-p0-5-as-price": [DateIndex, DecadeIndex, MonthIndex, QuarterIndex, WeekIndex, YearIndex],
|
||||||
|
"1m-sma-ratio-p1": [DateIndex, DecadeIndex, MonthIndex, QuarterIndex, WeekIndex, YearIndex],
|
||||||
|
"1m-sma-ratio-p1-as-price": [DateIndex, DecadeIndex, MonthIndex, QuarterIndex, WeekIndex, YearIndex],
|
||||||
|
"1m-sma-ratio-p1sd": [DateIndex, DecadeIndex, MonthIndex, QuarterIndex, WeekIndex, YearIndex],
|
||||||
|
"1m-sma-ratio-p1sd-as-price": [DateIndex, DecadeIndex, MonthIndex, QuarterIndex, WeekIndex, YearIndex],
|
||||||
|
"1m-sma-ratio-p2sd": [DateIndex, DecadeIndex, MonthIndex, QuarterIndex, WeekIndex, YearIndex],
|
||||||
|
"1m-sma-ratio-p2sd-as-price": [DateIndex, DecadeIndex, MonthIndex, QuarterIndex, WeekIndex, YearIndex],
|
||||||
|
"1m-sma-ratio-p3sd": [DateIndex, DecadeIndex, MonthIndex, QuarterIndex, WeekIndex, YearIndex],
|
||||||
|
"1m-sma-ratio-p3sd-as-price": [DateIndex, DecadeIndex, MonthIndex, QuarterIndex, WeekIndex, YearIndex],
|
||||||
|
"1m-sma-ratio-p99": [DateIndex, DecadeIndex, MonthIndex, QuarterIndex, WeekIndex, YearIndex],
|
||||||
|
"1m-sma-ratio-p99-5": [DateIndex, DecadeIndex, MonthIndex, QuarterIndex, WeekIndex, YearIndex],
|
||||||
|
"1m-sma-ratio-p99-5-as-price": [DateIndex, DecadeIndex, MonthIndex, QuarterIndex, WeekIndex, YearIndex],
|
||||||
|
"1m-sma-ratio-p99-9": [DateIndex, DecadeIndex, MonthIndex, QuarterIndex, WeekIndex, YearIndex],
|
||||||
|
"1m-sma-ratio-p99-9-as-price": [DateIndex, DecadeIndex, MonthIndex, QuarterIndex, WeekIndex, YearIndex],
|
||||||
|
"1m-sma-ratio-p99-as-price": [DateIndex, DecadeIndex, MonthIndex, QuarterIndex, WeekIndex, YearIndex],
|
||||||
|
"1m-sma-ratio-sma": [DateIndex, DecadeIndex, MonthIndex, QuarterIndex, WeekIndex, YearIndex],
|
||||||
|
"1m-sma-ratio-standard-deviation": [DateIndex, DecadeIndex, MonthIndex, QuarterIndex, WeekIndex, YearIndex],
|
||||||
|
"1w-sma": [DateIndex, DecadeIndex, MonthIndex, QuarterIndex, WeekIndex, YearIndex],
|
||||||
|
"1w-sma-ratio": [DateIndex, DecadeIndex, MonthIndex, QuarterIndex, WeekIndex, YearIndex],
|
||||||
|
"1w-sma-ratio-1m-sma": [DateIndex, DecadeIndex, MonthIndex, QuarterIndex, WeekIndex, YearIndex],
|
||||||
|
"1w-sma-ratio-1w-sma": [DateIndex, DecadeIndex, MonthIndex, QuarterIndex, WeekIndex, YearIndex],
|
||||||
|
"1w-sma-ratio-1y-sma": [DateIndex, DecadeIndex, MonthIndex, QuarterIndex, WeekIndex, YearIndex],
|
||||||
|
"1w-sma-ratio-1y-sma-momentum-oscillator": [DateIndex, DecadeIndex, MonthIndex, QuarterIndex, WeekIndex, YearIndex],
|
||||||
|
"1w-sma-ratio-m1sd": [DateIndex, DecadeIndex, MonthIndex, QuarterIndex, WeekIndex, YearIndex],
|
||||||
|
"1w-sma-ratio-m1sd-as-price": [DateIndex, DecadeIndex, MonthIndex, QuarterIndex, WeekIndex, YearIndex],
|
||||||
|
"1w-sma-ratio-m2sd": [DateIndex, DecadeIndex, MonthIndex, QuarterIndex, WeekIndex, YearIndex],
|
||||||
|
"1w-sma-ratio-m2sd-as-price": [DateIndex, DecadeIndex, MonthIndex, QuarterIndex, WeekIndex, YearIndex],
|
||||||
|
"1w-sma-ratio-m3sd": [DateIndex, DecadeIndex, MonthIndex, QuarterIndex, WeekIndex, YearIndex],
|
||||||
|
"1w-sma-ratio-m3sd-as-price": [DateIndex, DecadeIndex, MonthIndex, QuarterIndex, WeekIndex, YearIndex],
|
||||||
|
"1w-sma-ratio-p0-1": [DateIndex, DecadeIndex, MonthIndex, QuarterIndex, WeekIndex, YearIndex],
|
||||||
|
"1w-sma-ratio-p0-1-as-price": [DateIndex, DecadeIndex, MonthIndex, QuarterIndex, WeekIndex, YearIndex],
|
||||||
|
"1w-sma-ratio-p0-5": [DateIndex, DecadeIndex, MonthIndex, QuarterIndex, WeekIndex, YearIndex],
|
||||||
|
"1w-sma-ratio-p0-5-as-price": [DateIndex, DecadeIndex, MonthIndex, QuarterIndex, WeekIndex, YearIndex],
|
||||||
|
"1w-sma-ratio-p1": [DateIndex, DecadeIndex, MonthIndex, QuarterIndex, WeekIndex, YearIndex],
|
||||||
|
"1w-sma-ratio-p1-as-price": [DateIndex, DecadeIndex, MonthIndex, QuarterIndex, WeekIndex, YearIndex],
|
||||||
|
"1w-sma-ratio-p1sd": [DateIndex, DecadeIndex, MonthIndex, QuarterIndex, WeekIndex, YearIndex],
|
||||||
|
"1w-sma-ratio-p1sd-as-price": [DateIndex, DecadeIndex, MonthIndex, QuarterIndex, WeekIndex, YearIndex],
|
||||||
|
"1w-sma-ratio-p2sd": [DateIndex, DecadeIndex, MonthIndex, QuarterIndex, WeekIndex, YearIndex],
|
||||||
|
"1w-sma-ratio-p2sd-as-price": [DateIndex, DecadeIndex, MonthIndex, QuarterIndex, WeekIndex, YearIndex],
|
||||||
|
"1w-sma-ratio-p3sd": [DateIndex, DecadeIndex, MonthIndex, QuarterIndex, WeekIndex, YearIndex],
|
||||||
|
"1w-sma-ratio-p3sd-as-price": [DateIndex, DecadeIndex, MonthIndex, QuarterIndex, WeekIndex, YearIndex],
|
||||||
|
"1w-sma-ratio-p99": [DateIndex, DecadeIndex, MonthIndex, QuarterIndex, WeekIndex, YearIndex],
|
||||||
|
"1w-sma-ratio-p99-5": [DateIndex, DecadeIndex, MonthIndex, QuarterIndex, WeekIndex, YearIndex],
|
||||||
|
"1w-sma-ratio-p99-5-as-price": [DateIndex, DecadeIndex, MonthIndex, QuarterIndex, WeekIndex, YearIndex],
|
||||||
|
"1w-sma-ratio-p99-9": [DateIndex, DecadeIndex, MonthIndex, QuarterIndex, WeekIndex, YearIndex],
|
||||||
|
"1w-sma-ratio-p99-9-as-price": [DateIndex, DecadeIndex, MonthIndex, QuarterIndex, WeekIndex, YearIndex],
|
||||||
|
"1w-sma-ratio-p99-as-price": [DateIndex, DecadeIndex, MonthIndex, QuarterIndex, WeekIndex, YearIndex],
|
||||||
|
"1w-sma-ratio-sma": [DateIndex, DecadeIndex, MonthIndex, QuarterIndex, WeekIndex, YearIndex],
|
||||||
|
"1w-sma-ratio-standard-deviation": [DateIndex, DecadeIndex, MonthIndex, QuarterIndex, WeekIndex, YearIndex],
|
||||||
|
"1y-sma": [DateIndex, DecadeIndex, MonthIndex, QuarterIndex, WeekIndex, YearIndex],
|
||||||
|
"1y-sma-ratio": [DateIndex, DecadeIndex, MonthIndex, QuarterIndex, WeekIndex, YearIndex],
|
||||||
|
"1y-sma-ratio-1m-sma": [DateIndex, DecadeIndex, MonthIndex, QuarterIndex, WeekIndex, YearIndex],
|
||||||
|
"1y-sma-ratio-1w-sma": [DateIndex, DecadeIndex, MonthIndex, QuarterIndex, WeekIndex, YearIndex],
|
||||||
|
"1y-sma-ratio-1y-sma": [DateIndex, DecadeIndex, MonthIndex, QuarterIndex, WeekIndex, YearIndex],
|
||||||
|
"1y-sma-ratio-1y-sma-momentum-oscillator": [DateIndex, DecadeIndex, MonthIndex, QuarterIndex, WeekIndex, YearIndex],
|
||||||
|
"1y-sma-ratio-m1sd": [DateIndex, DecadeIndex, MonthIndex, QuarterIndex, WeekIndex, YearIndex],
|
||||||
|
"1y-sma-ratio-m1sd-as-price": [DateIndex, DecadeIndex, MonthIndex, QuarterIndex, WeekIndex, YearIndex],
|
||||||
|
"1y-sma-ratio-m2sd": [DateIndex, DecadeIndex, MonthIndex, QuarterIndex, WeekIndex, YearIndex],
|
||||||
|
"1y-sma-ratio-m2sd-as-price": [DateIndex, DecadeIndex, MonthIndex, QuarterIndex, WeekIndex, YearIndex],
|
||||||
|
"1y-sma-ratio-m3sd": [DateIndex, DecadeIndex, MonthIndex, QuarterIndex, WeekIndex, YearIndex],
|
||||||
|
"1y-sma-ratio-m3sd-as-price": [DateIndex, DecadeIndex, MonthIndex, QuarterIndex, WeekIndex, YearIndex],
|
||||||
|
"1y-sma-ratio-p0-1": [DateIndex, DecadeIndex, MonthIndex, QuarterIndex, WeekIndex, YearIndex],
|
||||||
|
"1y-sma-ratio-p0-1-as-price": [DateIndex, DecadeIndex, MonthIndex, QuarterIndex, WeekIndex, YearIndex],
|
||||||
|
"1y-sma-ratio-p0-5": [DateIndex, DecadeIndex, MonthIndex, QuarterIndex, WeekIndex, YearIndex],
|
||||||
|
"1y-sma-ratio-p0-5-as-price": [DateIndex, DecadeIndex, MonthIndex, QuarterIndex, WeekIndex, YearIndex],
|
||||||
|
"1y-sma-ratio-p1": [DateIndex, DecadeIndex, MonthIndex, QuarterIndex, WeekIndex, YearIndex],
|
||||||
|
"1y-sma-ratio-p1-as-price": [DateIndex, DecadeIndex, MonthIndex, QuarterIndex, WeekIndex, YearIndex],
|
||||||
|
"1y-sma-ratio-p1sd": [DateIndex, DecadeIndex, MonthIndex, QuarterIndex, WeekIndex, YearIndex],
|
||||||
|
"1y-sma-ratio-p1sd-as-price": [DateIndex, DecadeIndex, MonthIndex, QuarterIndex, WeekIndex, YearIndex],
|
||||||
|
"1y-sma-ratio-p2sd": [DateIndex, DecadeIndex, MonthIndex, QuarterIndex, WeekIndex, YearIndex],
|
||||||
|
"1y-sma-ratio-p2sd-as-price": [DateIndex, DecadeIndex, MonthIndex, QuarterIndex, WeekIndex, YearIndex],
|
||||||
|
"1y-sma-ratio-p3sd": [DateIndex, DecadeIndex, MonthIndex, QuarterIndex, WeekIndex, YearIndex],
|
||||||
|
"1y-sma-ratio-p3sd-as-price": [DateIndex, DecadeIndex, MonthIndex, QuarterIndex, WeekIndex, YearIndex],
|
||||||
|
"1y-sma-ratio-p99": [DateIndex, DecadeIndex, MonthIndex, QuarterIndex, WeekIndex, YearIndex],
|
||||||
|
"1y-sma-ratio-p99-5": [DateIndex, DecadeIndex, MonthIndex, QuarterIndex, WeekIndex, YearIndex],
|
||||||
|
"1y-sma-ratio-p99-5-as-price": [DateIndex, DecadeIndex, MonthIndex, QuarterIndex, WeekIndex, YearIndex],
|
||||||
|
"1y-sma-ratio-p99-9": [DateIndex, DecadeIndex, MonthIndex, QuarterIndex, WeekIndex, YearIndex],
|
||||||
|
"1y-sma-ratio-p99-9-as-price": [DateIndex, DecadeIndex, MonthIndex, QuarterIndex, WeekIndex, YearIndex],
|
||||||
|
"1y-sma-ratio-p99-as-price": [DateIndex, DecadeIndex, MonthIndex, QuarterIndex, WeekIndex, YearIndex],
|
||||||
|
"1y-sma-ratio-sma": [DateIndex, DecadeIndex, MonthIndex, QuarterIndex, WeekIndex, YearIndex],
|
||||||
|
"1y-sma-ratio-standard-deviation": [DateIndex, DecadeIndex, MonthIndex, QuarterIndex, WeekIndex, YearIndex],
|
||||||
|
"200w-sma": [DateIndex, DecadeIndex, MonthIndex, QuarterIndex, WeekIndex, YearIndex],
|
||||||
|
"200w-sma-ratio": [DateIndex, DecadeIndex, MonthIndex, QuarterIndex, WeekIndex, YearIndex],
|
||||||
|
"200w-sma-ratio-1m-sma": [DateIndex, DecadeIndex, MonthIndex, QuarterIndex, WeekIndex, YearIndex],
|
||||||
|
"200w-sma-ratio-1w-sma": [DateIndex, DecadeIndex, MonthIndex, QuarterIndex, WeekIndex, YearIndex],
|
||||||
|
"200w-sma-ratio-1y-sma": [DateIndex, DecadeIndex, MonthIndex, QuarterIndex, WeekIndex, YearIndex],
|
||||||
|
"200w-sma-ratio-1y-sma-momentum-oscillator": [DateIndex, DecadeIndex, MonthIndex, QuarterIndex, WeekIndex, YearIndex],
|
||||||
|
"200w-sma-ratio-m1sd": [DateIndex, DecadeIndex, MonthIndex, QuarterIndex, WeekIndex, YearIndex],
|
||||||
|
"200w-sma-ratio-m1sd-as-price": [DateIndex, DecadeIndex, MonthIndex, QuarterIndex, WeekIndex, YearIndex],
|
||||||
|
"200w-sma-ratio-m2sd": [DateIndex, DecadeIndex, MonthIndex, QuarterIndex, WeekIndex, YearIndex],
|
||||||
|
"200w-sma-ratio-m2sd-as-price": [DateIndex, DecadeIndex, MonthIndex, QuarterIndex, WeekIndex, YearIndex],
|
||||||
|
"200w-sma-ratio-m3sd": [DateIndex, DecadeIndex, MonthIndex, QuarterIndex, WeekIndex, YearIndex],
|
||||||
|
"200w-sma-ratio-m3sd-as-price": [DateIndex, DecadeIndex, MonthIndex, QuarterIndex, WeekIndex, YearIndex],
|
||||||
|
"200w-sma-ratio-p0-1": [DateIndex, DecadeIndex, MonthIndex, QuarterIndex, WeekIndex, YearIndex],
|
||||||
|
"200w-sma-ratio-p0-1-as-price": [DateIndex, DecadeIndex, MonthIndex, QuarterIndex, WeekIndex, YearIndex],
|
||||||
|
"200w-sma-ratio-p0-5": [DateIndex, DecadeIndex, MonthIndex, QuarterIndex, WeekIndex, YearIndex],
|
||||||
|
"200w-sma-ratio-p0-5-as-price": [DateIndex, DecadeIndex, MonthIndex, QuarterIndex, WeekIndex, YearIndex],
|
||||||
|
"200w-sma-ratio-p1": [DateIndex, DecadeIndex, MonthIndex, QuarterIndex, WeekIndex, YearIndex],
|
||||||
|
"200w-sma-ratio-p1-as-price": [DateIndex, DecadeIndex, MonthIndex, QuarterIndex, WeekIndex, YearIndex],
|
||||||
|
"200w-sma-ratio-p1sd": [DateIndex, DecadeIndex, MonthIndex, QuarterIndex, WeekIndex, YearIndex],
|
||||||
|
"200w-sma-ratio-p1sd-as-price": [DateIndex, DecadeIndex, MonthIndex, QuarterIndex, WeekIndex, YearIndex],
|
||||||
|
"200w-sma-ratio-p2sd": [DateIndex, DecadeIndex, MonthIndex, QuarterIndex, WeekIndex, YearIndex],
|
||||||
|
"200w-sma-ratio-p2sd-as-price": [DateIndex, DecadeIndex, MonthIndex, QuarterIndex, WeekIndex, YearIndex],
|
||||||
|
"200w-sma-ratio-p3sd": [DateIndex, DecadeIndex, MonthIndex, QuarterIndex, WeekIndex, YearIndex],
|
||||||
|
"200w-sma-ratio-p3sd-as-price": [DateIndex, DecadeIndex, MonthIndex, QuarterIndex, WeekIndex, YearIndex],
|
||||||
|
"200w-sma-ratio-p99": [DateIndex, DecadeIndex, MonthIndex, QuarterIndex, WeekIndex, YearIndex],
|
||||||
|
"200w-sma-ratio-p99-5": [DateIndex, DecadeIndex, MonthIndex, QuarterIndex, WeekIndex, YearIndex],
|
||||||
|
"200w-sma-ratio-p99-5-as-price": [DateIndex, DecadeIndex, MonthIndex, QuarterIndex, WeekIndex, YearIndex],
|
||||||
|
"200w-sma-ratio-p99-9": [DateIndex, DecadeIndex, MonthIndex, QuarterIndex, WeekIndex, YearIndex],
|
||||||
|
"200w-sma-ratio-p99-9-as-price": [DateIndex, DecadeIndex, MonthIndex, QuarterIndex, WeekIndex, YearIndex],
|
||||||
|
"200w-sma-ratio-p99-as-price": [DateIndex, DecadeIndex, MonthIndex, QuarterIndex, WeekIndex, YearIndex],
|
||||||
|
"200w-sma-ratio-sma": [DateIndex, DecadeIndex, MonthIndex, QuarterIndex, WeekIndex, YearIndex],
|
||||||
|
"200w-sma-ratio-standard-deviation": [DateIndex, DecadeIndex, MonthIndex, QuarterIndex, WeekIndex, YearIndex],
|
||||||
|
"21d-sma": [DateIndex, DecadeIndex, MonthIndex, QuarterIndex, WeekIndex, YearIndex],
|
||||||
|
"21d-sma-ratio": [DateIndex, DecadeIndex, MonthIndex, QuarterIndex, WeekIndex, YearIndex],
|
||||||
|
"21d-sma-ratio-1m-sma": [DateIndex, DecadeIndex, MonthIndex, QuarterIndex, WeekIndex, YearIndex],
|
||||||
|
"21d-sma-ratio-1w-sma": [DateIndex, DecadeIndex, MonthIndex, QuarterIndex, WeekIndex, YearIndex],
|
||||||
|
"21d-sma-ratio-1y-sma": [DateIndex, DecadeIndex, MonthIndex, QuarterIndex, WeekIndex, YearIndex],
|
||||||
|
"21d-sma-ratio-1y-sma-momentum-oscillator": [DateIndex, DecadeIndex, MonthIndex, QuarterIndex, WeekIndex, YearIndex],
|
||||||
|
"21d-sma-ratio-m1sd": [DateIndex, DecadeIndex, MonthIndex, QuarterIndex, WeekIndex, YearIndex],
|
||||||
|
"21d-sma-ratio-m1sd-as-price": [DateIndex, DecadeIndex, MonthIndex, QuarterIndex, WeekIndex, YearIndex],
|
||||||
|
"21d-sma-ratio-m2sd": [DateIndex, DecadeIndex, MonthIndex, QuarterIndex, WeekIndex, YearIndex],
|
||||||
|
"21d-sma-ratio-m2sd-as-price": [DateIndex, DecadeIndex, MonthIndex, QuarterIndex, WeekIndex, YearIndex],
|
||||||
|
"21d-sma-ratio-m3sd": [DateIndex, DecadeIndex, MonthIndex, QuarterIndex, WeekIndex, YearIndex],
|
||||||
|
"21d-sma-ratio-m3sd-as-price": [DateIndex, DecadeIndex, MonthIndex, QuarterIndex, WeekIndex, YearIndex],
|
||||||
|
"21d-sma-ratio-p0-1": [DateIndex, DecadeIndex, MonthIndex, QuarterIndex, WeekIndex, YearIndex],
|
||||||
|
"21d-sma-ratio-p0-1-as-price": [DateIndex, DecadeIndex, MonthIndex, QuarterIndex, WeekIndex, YearIndex],
|
||||||
|
"21d-sma-ratio-p0-5": [DateIndex, DecadeIndex, MonthIndex, QuarterIndex, WeekIndex, YearIndex],
|
||||||
|
"21d-sma-ratio-p0-5-as-price": [DateIndex, DecadeIndex, MonthIndex, QuarterIndex, WeekIndex, YearIndex],
|
||||||
|
"21d-sma-ratio-p1": [DateIndex, DecadeIndex, MonthIndex, QuarterIndex, WeekIndex, YearIndex],
|
||||||
|
"21d-sma-ratio-p1-as-price": [DateIndex, DecadeIndex, MonthIndex, QuarterIndex, WeekIndex, YearIndex],
|
||||||
|
"21d-sma-ratio-p1sd": [DateIndex, DecadeIndex, MonthIndex, QuarterIndex, WeekIndex, YearIndex],
|
||||||
|
"21d-sma-ratio-p1sd-as-price": [DateIndex, DecadeIndex, MonthIndex, QuarterIndex, WeekIndex, YearIndex],
|
||||||
|
"21d-sma-ratio-p2sd": [DateIndex, DecadeIndex, MonthIndex, QuarterIndex, WeekIndex, YearIndex],
|
||||||
|
"21d-sma-ratio-p2sd-as-price": [DateIndex, DecadeIndex, MonthIndex, QuarterIndex, WeekIndex, YearIndex],
|
||||||
|
"21d-sma-ratio-p3sd": [DateIndex, DecadeIndex, MonthIndex, QuarterIndex, WeekIndex, YearIndex],
|
||||||
|
"21d-sma-ratio-p3sd-as-price": [DateIndex, DecadeIndex, MonthIndex, QuarterIndex, WeekIndex, YearIndex],
|
||||||
|
"21d-sma-ratio-p99": [DateIndex, DecadeIndex, MonthIndex, QuarterIndex, WeekIndex, YearIndex],
|
||||||
|
"21d-sma-ratio-p99-5": [DateIndex, DecadeIndex, MonthIndex, QuarterIndex, WeekIndex, YearIndex],
|
||||||
|
"21d-sma-ratio-p99-5-as-price": [DateIndex, DecadeIndex, MonthIndex, QuarterIndex, WeekIndex, YearIndex],
|
||||||
|
"21d-sma-ratio-p99-9": [DateIndex, DecadeIndex, MonthIndex, QuarterIndex, WeekIndex, YearIndex],
|
||||||
|
"21d-sma-ratio-p99-9-as-price": [DateIndex, DecadeIndex, MonthIndex, QuarterIndex, WeekIndex, YearIndex],
|
||||||
|
"21d-sma-ratio-p99-as-price": [DateIndex, DecadeIndex, MonthIndex, QuarterIndex, WeekIndex, YearIndex],
|
||||||
|
"21d-sma-ratio-sma": [DateIndex, DecadeIndex, MonthIndex, QuarterIndex, WeekIndex, YearIndex],
|
||||||
|
"21d-sma-ratio-standard-deviation": [DateIndex, DecadeIndex, MonthIndex, QuarterIndex, WeekIndex, YearIndex],
|
||||||
|
"2y-sma": [DateIndex, DecadeIndex, MonthIndex, QuarterIndex, WeekIndex, YearIndex],
|
||||||
|
"2y-sma-ratio": [DateIndex, DecadeIndex, MonthIndex, QuarterIndex, WeekIndex, YearIndex],
|
||||||
|
"2y-sma-ratio-1m-sma": [DateIndex, DecadeIndex, MonthIndex, QuarterIndex, WeekIndex, YearIndex],
|
||||||
|
"2y-sma-ratio-1w-sma": [DateIndex, DecadeIndex, MonthIndex, QuarterIndex, WeekIndex, YearIndex],
|
||||||
|
"2y-sma-ratio-1y-sma": [DateIndex, DecadeIndex, MonthIndex, QuarterIndex, WeekIndex, YearIndex],
|
||||||
|
"2y-sma-ratio-1y-sma-momentum-oscillator": [DateIndex, DecadeIndex, MonthIndex, QuarterIndex, WeekIndex, YearIndex],
|
||||||
|
"2y-sma-ratio-m1sd": [DateIndex, DecadeIndex, MonthIndex, QuarterIndex, WeekIndex, YearIndex],
|
||||||
|
"2y-sma-ratio-m1sd-as-price": [DateIndex, DecadeIndex, MonthIndex, QuarterIndex, WeekIndex, YearIndex],
|
||||||
|
"2y-sma-ratio-m2sd": [DateIndex, DecadeIndex, MonthIndex, QuarterIndex, WeekIndex, YearIndex],
|
||||||
|
"2y-sma-ratio-m2sd-as-price": [DateIndex, DecadeIndex, MonthIndex, QuarterIndex, WeekIndex, YearIndex],
|
||||||
|
"2y-sma-ratio-m3sd": [DateIndex, DecadeIndex, MonthIndex, QuarterIndex, WeekIndex, YearIndex],
|
||||||
|
"2y-sma-ratio-m3sd-as-price": [DateIndex, DecadeIndex, MonthIndex, QuarterIndex, WeekIndex, YearIndex],
|
||||||
|
"2y-sma-ratio-p0-1": [DateIndex, DecadeIndex, MonthIndex, QuarterIndex, WeekIndex, YearIndex],
|
||||||
|
"2y-sma-ratio-p0-1-as-price": [DateIndex, DecadeIndex, MonthIndex, QuarterIndex, WeekIndex, YearIndex],
|
||||||
|
"2y-sma-ratio-p0-5": [DateIndex, DecadeIndex, MonthIndex, QuarterIndex, WeekIndex, YearIndex],
|
||||||
|
"2y-sma-ratio-p0-5-as-price": [DateIndex, DecadeIndex, MonthIndex, QuarterIndex, WeekIndex, YearIndex],
|
||||||
|
"2y-sma-ratio-p1": [DateIndex, DecadeIndex, MonthIndex, QuarterIndex, WeekIndex, YearIndex],
|
||||||
|
"2y-sma-ratio-p1-as-price": [DateIndex, DecadeIndex, MonthIndex, QuarterIndex, WeekIndex, YearIndex],
|
||||||
|
"2y-sma-ratio-p1sd": [DateIndex, DecadeIndex, MonthIndex, QuarterIndex, WeekIndex, YearIndex],
|
||||||
|
"2y-sma-ratio-p1sd-as-price": [DateIndex, DecadeIndex, MonthIndex, QuarterIndex, WeekIndex, YearIndex],
|
||||||
|
"2y-sma-ratio-p2sd": [DateIndex, DecadeIndex, MonthIndex, QuarterIndex, WeekIndex, YearIndex],
|
||||||
|
"2y-sma-ratio-p2sd-as-price": [DateIndex, DecadeIndex, MonthIndex, QuarterIndex, WeekIndex, YearIndex],
|
||||||
|
"2y-sma-ratio-p3sd": [DateIndex, DecadeIndex, MonthIndex, QuarterIndex, WeekIndex, YearIndex],
|
||||||
|
"2y-sma-ratio-p3sd-as-price": [DateIndex, DecadeIndex, MonthIndex, QuarterIndex, WeekIndex, YearIndex],
|
||||||
|
"2y-sma-ratio-p99": [DateIndex, DecadeIndex, MonthIndex, QuarterIndex, WeekIndex, YearIndex],
|
||||||
|
"2y-sma-ratio-p99-5": [DateIndex, DecadeIndex, MonthIndex, QuarterIndex, WeekIndex, YearIndex],
|
||||||
|
"2y-sma-ratio-p99-5-as-price": [DateIndex, DecadeIndex, MonthIndex, QuarterIndex, WeekIndex, YearIndex],
|
||||||
|
"2y-sma-ratio-p99-9": [DateIndex, DecadeIndex, MonthIndex, QuarterIndex, WeekIndex, YearIndex],
|
||||||
|
"2y-sma-ratio-p99-9-as-price": [DateIndex, DecadeIndex, MonthIndex, QuarterIndex, WeekIndex, YearIndex],
|
||||||
|
"2y-sma-ratio-p99-as-price": [DateIndex, DecadeIndex, MonthIndex, QuarterIndex, WeekIndex, YearIndex],
|
||||||
|
"2y-sma-ratio-sma": [DateIndex, DecadeIndex, MonthIndex, QuarterIndex, WeekIndex, YearIndex],
|
||||||
|
"2y-sma-ratio-standard-deviation": [DateIndex, DecadeIndex, MonthIndex, QuarterIndex, WeekIndex, YearIndex],
|
||||||
|
"34d-sma": [DateIndex, DecadeIndex, MonthIndex, QuarterIndex, WeekIndex, YearIndex],
|
||||||
|
"34d-sma-ratio": [DateIndex, DecadeIndex, MonthIndex, QuarterIndex, WeekIndex, YearIndex],
|
||||||
|
"34d-sma-ratio-1m-sma": [DateIndex, DecadeIndex, MonthIndex, QuarterIndex, WeekIndex, YearIndex],
|
||||||
|
"34d-sma-ratio-1w-sma": [DateIndex, DecadeIndex, MonthIndex, QuarterIndex, WeekIndex, YearIndex],
|
||||||
|
"34d-sma-ratio-1y-sma": [DateIndex, DecadeIndex, MonthIndex, QuarterIndex, WeekIndex, YearIndex],
|
||||||
|
"34d-sma-ratio-1y-sma-momentum-oscillator": [DateIndex, DecadeIndex, MonthIndex, QuarterIndex, WeekIndex, YearIndex],
|
||||||
|
"34d-sma-ratio-m1sd": [DateIndex, DecadeIndex, MonthIndex, QuarterIndex, WeekIndex, YearIndex],
|
||||||
|
"34d-sma-ratio-m1sd-as-price": [DateIndex, DecadeIndex, MonthIndex, QuarterIndex, WeekIndex, YearIndex],
|
||||||
|
"34d-sma-ratio-m2sd": [DateIndex, DecadeIndex, MonthIndex, QuarterIndex, WeekIndex, YearIndex],
|
||||||
|
"34d-sma-ratio-m2sd-as-price": [DateIndex, DecadeIndex, MonthIndex, QuarterIndex, WeekIndex, YearIndex],
|
||||||
|
"34d-sma-ratio-m3sd": [DateIndex, DecadeIndex, MonthIndex, QuarterIndex, WeekIndex, YearIndex],
|
||||||
|
"34d-sma-ratio-m3sd-as-price": [DateIndex, DecadeIndex, MonthIndex, QuarterIndex, WeekIndex, YearIndex],
|
||||||
|
"34d-sma-ratio-p0-1": [DateIndex, DecadeIndex, MonthIndex, QuarterIndex, WeekIndex, YearIndex],
|
||||||
|
"34d-sma-ratio-p0-1-as-price": [DateIndex, DecadeIndex, MonthIndex, QuarterIndex, WeekIndex, YearIndex],
|
||||||
|
"34d-sma-ratio-p0-5": [DateIndex, DecadeIndex, MonthIndex, QuarterIndex, WeekIndex, YearIndex],
|
||||||
|
"34d-sma-ratio-p0-5-as-price": [DateIndex, DecadeIndex, MonthIndex, QuarterIndex, WeekIndex, YearIndex],
|
||||||
|
"34d-sma-ratio-p1": [DateIndex, DecadeIndex, MonthIndex, QuarterIndex, WeekIndex, YearIndex],
|
||||||
|
"34d-sma-ratio-p1-as-price": [DateIndex, DecadeIndex, MonthIndex, QuarterIndex, WeekIndex, YearIndex],
|
||||||
|
"34d-sma-ratio-p1sd": [DateIndex, DecadeIndex, MonthIndex, QuarterIndex, WeekIndex, YearIndex],
|
||||||
|
"34d-sma-ratio-p1sd-as-price": [DateIndex, DecadeIndex, MonthIndex, QuarterIndex, WeekIndex, YearIndex],
|
||||||
|
"34d-sma-ratio-p2sd": [DateIndex, DecadeIndex, MonthIndex, QuarterIndex, WeekIndex, YearIndex],
|
||||||
|
"34d-sma-ratio-p2sd-as-price": [DateIndex, DecadeIndex, MonthIndex, QuarterIndex, WeekIndex, YearIndex],
|
||||||
|
"34d-sma-ratio-p3sd": [DateIndex, DecadeIndex, MonthIndex, QuarterIndex, WeekIndex, YearIndex],
|
||||||
|
"34d-sma-ratio-p3sd-as-price": [DateIndex, DecadeIndex, MonthIndex, QuarterIndex, WeekIndex, YearIndex],
|
||||||
|
"34d-sma-ratio-p99": [DateIndex, DecadeIndex, MonthIndex, QuarterIndex, WeekIndex, YearIndex],
|
||||||
|
"34d-sma-ratio-p99-5": [DateIndex, DecadeIndex, MonthIndex, QuarterIndex, WeekIndex, YearIndex],
|
||||||
|
"34d-sma-ratio-p99-5-as-price": [DateIndex, DecadeIndex, MonthIndex, QuarterIndex, WeekIndex, YearIndex],
|
||||||
|
"34d-sma-ratio-p99-9": [DateIndex, DecadeIndex, MonthIndex, QuarterIndex, WeekIndex, YearIndex],
|
||||||
|
"34d-sma-ratio-p99-9-as-price": [DateIndex, DecadeIndex, MonthIndex, QuarterIndex, WeekIndex, YearIndex],
|
||||||
|
"34d-sma-ratio-p99-as-price": [DateIndex, DecadeIndex, MonthIndex, QuarterIndex, WeekIndex, YearIndex],
|
||||||
|
"34d-sma-ratio-sma": [DateIndex, DecadeIndex, MonthIndex, QuarterIndex, WeekIndex, YearIndex],
|
||||||
|
"34d-sma-ratio-standard-deviation": [DateIndex, DecadeIndex, MonthIndex, QuarterIndex, WeekIndex, YearIndex],
|
||||||
|
"4y-sma": [DateIndex, DecadeIndex, MonthIndex, QuarterIndex, WeekIndex, YearIndex],
|
||||||
|
"4y-sma-ratio": [DateIndex, DecadeIndex, MonthIndex, QuarterIndex, WeekIndex, YearIndex],
|
||||||
|
"4y-sma-ratio-1m-sma": [DateIndex, DecadeIndex, MonthIndex, QuarterIndex, WeekIndex, YearIndex],
|
||||||
|
"4y-sma-ratio-1w-sma": [DateIndex, DecadeIndex, MonthIndex, QuarterIndex, WeekIndex, YearIndex],
|
||||||
|
"4y-sma-ratio-1y-sma": [DateIndex, DecadeIndex, MonthIndex, QuarterIndex, WeekIndex, YearIndex],
|
||||||
|
"4y-sma-ratio-1y-sma-momentum-oscillator": [DateIndex, DecadeIndex, MonthIndex, QuarterIndex, WeekIndex, YearIndex],
|
||||||
|
"4y-sma-ratio-m1sd": [DateIndex, DecadeIndex, MonthIndex, QuarterIndex, WeekIndex, YearIndex],
|
||||||
|
"4y-sma-ratio-m1sd-as-price": [DateIndex, DecadeIndex, MonthIndex, QuarterIndex, WeekIndex, YearIndex],
|
||||||
|
"4y-sma-ratio-m2sd": [DateIndex, DecadeIndex, MonthIndex, QuarterIndex, WeekIndex, YearIndex],
|
||||||
|
"4y-sma-ratio-m2sd-as-price": [DateIndex, DecadeIndex, MonthIndex, QuarterIndex, WeekIndex, YearIndex],
|
||||||
|
"4y-sma-ratio-m3sd": [DateIndex, DecadeIndex, MonthIndex, QuarterIndex, WeekIndex, YearIndex],
|
||||||
|
"4y-sma-ratio-m3sd-as-price": [DateIndex, DecadeIndex, MonthIndex, QuarterIndex, WeekIndex, YearIndex],
|
||||||
|
"4y-sma-ratio-p0-1": [DateIndex, DecadeIndex, MonthIndex, QuarterIndex, WeekIndex, YearIndex],
|
||||||
|
"4y-sma-ratio-p0-1-as-price": [DateIndex, DecadeIndex, MonthIndex, QuarterIndex, WeekIndex, YearIndex],
|
||||||
|
"4y-sma-ratio-p0-5": [DateIndex, DecadeIndex, MonthIndex, QuarterIndex, WeekIndex, YearIndex],
|
||||||
|
"4y-sma-ratio-p0-5-as-price": [DateIndex, DecadeIndex, MonthIndex, QuarterIndex, WeekIndex, YearIndex],
|
||||||
|
"4y-sma-ratio-p1": [DateIndex, DecadeIndex, MonthIndex, QuarterIndex, WeekIndex, YearIndex],
|
||||||
|
"4y-sma-ratio-p1-as-price": [DateIndex, DecadeIndex, MonthIndex, QuarterIndex, WeekIndex, YearIndex],
|
||||||
|
"4y-sma-ratio-p1sd": [DateIndex, DecadeIndex, MonthIndex, QuarterIndex, WeekIndex, YearIndex],
|
||||||
|
"4y-sma-ratio-p1sd-as-price": [DateIndex, DecadeIndex, MonthIndex, QuarterIndex, WeekIndex, YearIndex],
|
||||||
|
"4y-sma-ratio-p2sd": [DateIndex, DecadeIndex, MonthIndex, QuarterIndex, WeekIndex, YearIndex],
|
||||||
|
"4y-sma-ratio-p2sd-as-price": [DateIndex, DecadeIndex, MonthIndex, QuarterIndex, WeekIndex, YearIndex],
|
||||||
|
"4y-sma-ratio-p3sd": [DateIndex, DecadeIndex, MonthIndex, QuarterIndex, WeekIndex, YearIndex],
|
||||||
|
"4y-sma-ratio-p3sd-as-price": [DateIndex, DecadeIndex, MonthIndex, QuarterIndex, WeekIndex, YearIndex],
|
||||||
|
"4y-sma-ratio-p99": [DateIndex, DecadeIndex, MonthIndex, QuarterIndex, WeekIndex, YearIndex],
|
||||||
|
"4y-sma-ratio-p99-5": [DateIndex, DecadeIndex, MonthIndex, QuarterIndex, WeekIndex, YearIndex],
|
||||||
|
"4y-sma-ratio-p99-5-as-price": [DateIndex, DecadeIndex, MonthIndex, QuarterIndex, WeekIndex, YearIndex],
|
||||||
|
"4y-sma-ratio-p99-9": [DateIndex, DecadeIndex, MonthIndex, QuarterIndex, WeekIndex, YearIndex],
|
||||||
|
"4y-sma-ratio-p99-9-as-price": [DateIndex, DecadeIndex, MonthIndex, QuarterIndex, WeekIndex, YearIndex],
|
||||||
|
"4y-sma-ratio-p99-as-price": [DateIndex, DecadeIndex, MonthIndex, QuarterIndex, WeekIndex, YearIndex],
|
||||||
|
"4y-sma-ratio-sma": [DateIndex, DecadeIndex, MonthIndex, QuarterIndex, WeekIndex, YearIndex],
|
||||||
|
"4y-sma-ratio-standard-deviation": [DateIndex, DecadeIndex, MonthIndex, QuarterIndex, WeekIndex, YearIndex],
|
||||||
|
"55d-sma": [DateIndex, DecadeIndex, MonthIndex, QuarterIndex, WeekIndex, YearIndex],
|
||||||
|
"55d-sma-ratio": [DateIndex, DecadeIndex, MonthIndex, QuarterIndex, WeekIndex, YearIndex],
|
||||||
|
"55d-sma-ratio-1m-sma": [DateIndex, DecadeIndex, MonthIndex, QuarterIndex, WeekIndex, YearIndex],
|
||||||
|
"55d-sma-ratio-1w-sma": [DateIndex, DecadeIndex, MonthIndex, QuarterIndex, WeekIndex, YearIndex],
|
||||||
|
"55d-sma-ratio-1y-sma": [DateIndex, DecadeIndex, MonthIndex, QuarterIndex, WeekIndex, YearIndex],
|
||||||
|
"55d-sma-ratio-1y-sma-momentum-oscillator": [DateIndex, DecadeIndex, MonthIndex, QuarterIndex, WeekIndex, YearIndex],
|
||||||
|
"55d-sma-ratio-m1sd": [DateIndex, DecadeIndex, MonthIndex, QuarterIndex, WeekIndex, YearIndex],
|
||||||
|
"55d-sma-ratio-m1sd-as-price": [DateIndex, DecadeIndex, MonthIndex, QuarterIndex, WeekIndex, YearIndex],
|
||||||
|
"55d-sma-ratio-m2sd": [DateIndex, DecadeIndex, MonthIndex, QuarterIndex, WeekIndex, YearIndex],
|
||||||
|
"55d-sma-ratio-m2sd-as-price": [DateIndex, DecadeIndex, MonthIndex, QuarterIndex, WeekIndex, YearIndex],
|
||||||
|
"55d-sma-ratio-m3sd": [DateIndex, DecadeIndex, MonthIndex, QuarterIndex, WeekIndex, YearIndex],
|
||||||
|
"55d-sma-ratio-m3sd-as-price": [DateIndex, DecadeIndex, MonthIndex, QuarterIndex, WeekIndex, YearIndex],
|
||||||
|
"55d-sma-ratio-p0-1": [DateIndex, DecadeIndex, MonthIndex, QuarterIndex, WeekIndex, YearIndex],
|
||||||
|
"55d-sma-ratio-p0-1-as-price": [DateIndex, DecadeIndex, MonthIndex, QuarterIndex, WeekIndex, YearIndex],
|
||||||
|
"55d-sma-ratio-p0-5": [DateIndex, DecadeIndex, MonthIndex, QuarterIndex, WeekIndex, YearIndex],
|
||||||
|
"55d-sma-ratio-p0-5-as-price": [DateIndex, DecadeIndex, MonthIndex, QuarterIndex, WeekIndex, YearIndex],
|
||||||
|
"55d-sma-ratio-p1": [DateIndex, DecadeIndex, MonthIndex, QuarterIndex, WeekIndex, YearIndex],
|
||||||
|
"55d-sma-ratio-p1-as-price": [DateIndex, DecadeIndex, MonthIndex, QuarterIndex, WeekIndex, YearIndex],
|
||||||
|
"55d-sma-ratio-p1sd": [DateIndex, DecadeIndex, MonthIndex, QuarterIndex, WeekIndex, YearIndex],
|
||||||
|
"55d-sma-ratio-p1sd-as-price": [DateIndex, DecadeIndex, MonthIndex, QuarterIndex, WeekIndex, YearIndex],
|
||||||
|
"55d-sma-ratio-p2sd": [DateIndex, DecadeIndex, MonthIndex, QuarterIndex, WeekIndex, YearIndex],
|
||||||
|
"55d-sma-ratio-p2sd-as-price": [DateIndex, DecadeIndex, MonthIndex, QuarterIndex, WeekIndex, YearIndex],
|
||||||
|
"55d-sma-ratio-p3sd": [DateIndex, DecadeIndex, MonthIndex, QuarterIndex, WeekIndex, YearIndex],
|
||||||
|
"55d-sma-ratio-p3sd-as-price": [DateIndex, DecadeIndex, MonthIndex, QuarterIndex, WeekIndex, YearIndex],
|
||||||
|
"55d-sma-ratio-p99": [DateIndex, DecadeIndex, MonthIndex, QuarterIndex, WeekIndex, YearIndex],
|
||||||
|
"55d-sma-ratio-p99-5": [DateIndex, DecadeIndex, MonthIndex, QuarterIndex, WeekIndex, YearIndex],
|
||||||
|
"55d-sma-ratio-p99-5-as-price": [DateIndex, DecadeIndex, MonthIndex, QuarterIndex, WeekIndex, YearIndex],
|
||||||
|
"55d-sma-ratio-p99-9": [DateIndex, DecadeIndex, MonthIndex, QuarterIndex, WeekIndex, YearIndex],
|
||||||
|
"55d-sma-ratio-p99-9-as-price": [DateIndex, DecadeIndex, MonthIndex, QuarterIndex, WeekIndex, YearIndex],
|
||||||
|
"55d-sma-ratio-p99-as-price": [DateIndex, DecadeIndex, MonthIndex, QuarterIndex, WeekIndex, YearIndex],
|
||||||
|
"55d-sma-ratio-sma": [DateIndex, DecadeIndex, MonthIndex, QuarterIndex, WeekIndex, YearIndex],
|
||||||
|
"55d-sma-ratio-standard-deviation": [DateIndex, DecadeIndex, MonthIndex, QuarterIndex, WeekIndex, YearIndex],
|
||||||
|
"89d-sma": [DateIndex, DecadeIndex, MonthIndex, QuarterIndex, WeekIndex, YearIndex],
|
||||||
|
"89d-sma-ratio": [DateIndex, DecadeIndex, MonthIndex, QuarterIndex, WeekIndex, YearIndex],
|
||||||
|
"89d-sma-ratio-1m-sma": [DateIndex, DecadeIndex, MonthIndex, QuarterIndex, WeekIndex, YearIndex],
|
||||||
|
"89d-sma-ratio-1w-sma": [DateIndex, DecadeIndex, MonthIndex, QuarterIndex, WeekIndex, YearIndex],
|
||||||
|
"89d-sma-ratio-1y-sma": [DateIndex, DecadeIndex, MonthIndex, QuarterIndex, WeekIndex, YearIndex],
|
||||||
|
"89d-sma-ratio-1y-sma-momentum-oscillator": [DateIndex, DecadeIndex, MonthIndex, QuarterIndex, WeekIndex, YearIndex],
|
||||||
|
"89d-sma-ratio-m1sd": [DateIndex, DecadeIndex, MonthIndex, QuarterIndex, WeekIndex, YearIndex],
|
||||||
|
"89d-sma-ratio-m1sd-as-price": [DateIndex, DecadeIndex, MonthIndex, QuarterIndex, WeekIndex, YearIndex],
|
||||||
|
"89d-sma-ratio-m2sd": [DateIndex, DecadeIndex, MonthIndex, QuarterIndex, WeekIndex, YearIndex],
|
||||||
|
"89d-sma-ratio-m2sd-as-price": [DateIndex, DecadeIndex, MonthIndex, QuarterIndex, WeekIndex, YearIndex],
|
||||||
|
"89d-sma-ratio-m3sd": [DateIndex, DecadeIndex, MonthIndex, QuarterIndex, WeekIndex, YearIndex],
|
||||||
|
"89d-sma-ratio-m3sd-as-price": [DateIndex, DecadeIndex, MonthIndex, QuarterIndex, WeekIndex, YearIndex],
|
||||||
|
"89d-sma-ratio-p0-1": [DateIndex, DecadeIndex, MonthIndex, QuarterIndex, WeekIndex, YearIndex],
|
||||||
|
"89d-sma-ratio-p0-1-as-price": [DateIndex, DecadeIndex, MonthIndex, QuarterIndex, WeekIndex, YearIndex],
|
||||||
|
"89d-sma-ratio-p0-5": [DateIndex, DecadeIndex, MonthIndex, QuarterIndex, WeekIndex, YearIndex],
|
||||||
|
"89d-sma-ratio-p0-5-as-price": [DateIndex, DecadeIndex, MonthIndex, QuarterIndex, WeekIndex, YearIndex],
|
||||||
|
"89d-sma-ratio-p1": [DateIndex, DecadeIndex, MonthIndex, QuarterIndex, WeekIndex, YearIndex],
|
||||||
|
"89d-sma-ratio-p1-as-price": [DateIndex, DecadeIndex, MonthIndex, QuarterIndex, WeekIndex, YearIndex],
|
||||||
|
"89d-sma-ratio-p1sd": [DateIndex, DecadeIndex, MonthIndex, QuarterIndex, WeekIndex, YearIndex],
|
||||||
|
"89d-sma-ratio-p1sd-as-price": [DateIndex, DecadeIndex, MonthIndex, QuarterIndex, WeekIndex, YearIndex],
|
||||||
|
"89d-sma-ratio-p2sd": [DateIndex, DecadeIndex, MonthIndex, QuarterIndex, WeekIndex, YearIndex],
|
||||||
|
"89d-sma-ratio-p2sd-as-price": [DateIndex, DecadeIndex, MonthIndex, QuarterIndex, WeekIndex, YearIndex],
|
||||||
|
"89d-sma-ratio-p3sd": [DateIndex, DecadeIndex, MonthIndex, QuarterIndex, WeekIndex, YearIndex],
|
||||||
|
"89d-sma-ratio-p3sd-as-price": [DateIndex, DecadeIndex, MonthIndex, QuarterIndex, WeekIndex, YearIndex],
|
||||||
|
"89d-sma-ratio-p99": [DateIndex, DecadeIndex, MonthIndex, QuarterIndex, WeekIndex, YearIndex],
|
||||||
|
"89d-sma-ratio-p99-5": [DateIndex, DecadeIndex, MonthIndex, QuarterIndex, WeekIndex, YearIndex],
|
||||||
|
"89d-sma-ratio-p99-5-as-price": [DateIndex, DecadeIndex, MonthIndex, QuarterIndex, WeekIndex, YearIndex],
|
||||||
|
"89d-sma-ratio-p99-9": [DateIndex, DecadeIndex, MonthIndex, QuarterIndex, WeekIndex, YearIndex],
|
||||||
|
"89d-sma-ratio-p99-9-as-price": [DateIndex, DecadeIndex, MonthIndex, QuarterIndex, WeekIndex, YearIndex],
|
||||||
|
"89d-sma-ratio-p99-as-price": [DateIndex, DecadeIndex, MonthIndex, QuarterIndex, WeekIndex, YearIndex],
|
||||||
|
"89d-sma-ratio-sma": [DateIndex, DecadeIndex, MonthIndex, QuarterIndex, WeekIndex, YearIndex],
|
||||||
|
"89d-sma-ratio-standard-deviation": [DateIndex, DecadeIndex, MonthIndex, QuarterIndex, WeekIndex, YearIndex],
|
||||||
|
"8d-sma": [DateIndex, DecadeIndex, MonthIndex, QuarterIndex, WeekIndex, YearIndex],
|
||||||
|
"8d-sma-ratio": [DateIndex, DecadeIndex, MonthIndex, QuarterIndex, WeekIndex, YearIndex],
|
||||||
|
"8d-sma-ratio-1m-sma": [DateIndex, DecadeIndex, MonthIndex, QuarterIndex, WeekIndex, YearIndex],
|
||||||
|
"8d-sma-ratio-1w-sma": [DateIndex, DecadeIndex, MonthIndex, QuarterIndex, WeekIndex, YearIndex],
|
||||||
|
"8d-sma-ratio-1y-sma": [DateIndex, DecadeIndex, MonthIndex, QuarterIndex, WeekIndex, YearIndex],
|
||||||
|
"8d-sma-ratio-1y-sma-momentum-oscillator": [DateIndex, DecadeIndex, MonthIndex, QuarterIndex, WeekIndex, YearIndex],
|
||||||
|
"8d-sma-ratio-m1sd": [DateIndex, DecadeIndex, MonthIndex, QuarterIndex, WeekIndex, YearIndex],
|
||||||
|
"8d-sma-ratio-m1sd-as-price": [DateIndex, DecadeIndex, MonthIndex, QuarterIndex, WeekIndex, YearIndex],
|
||||||
|
"8d-sma-ratio-m2sd": [DateIndex, DecadeIndex, MonthIndex, QuarterIndex, WeekIndex, YearIndex],
|
||||||
|
"8d-sma-ratio-m2sd-as-price": [DateIndex, DecadeIndex, MonthIndex, QuarterIndex, WeekIndex, YearIndex],
|
||||||
|
"8d-sma-ratio-m3sd": [DateIndex, DecadeIndex, MonthIndex, QuarterIndex, WeekIndex, YearIndex],
|
||||||
|
"8d-sma-ratio-m3sd-as-price": [DateIndex, DecadeIndex, MonthIndex, QuarterIndex, WeekIndex, YearIndex],
|
||||||
|
"8d-sma-ratio-p0-1": [DateIndex, DecadeIndex, MonthIndex, QuarterIndex, WeekIndex, YearIndex],
|
||||||
|
"8d-sma-ratio-p0-1-as-price": [DateIndex, DecadeIndex, MonthIndex, QuarterIndex, WeekIndex, YearIndex],
|
||||||
|
"8d-sma-ratio-p0-5": [DateIndex, DecadeIndex, MonthIndex, QuarterIndex, WeekIndex, YearIndex],
|
||||||
|
"8d-sma-ratio-p0-5-as-price": [DateIndex, DecadeIndex, MonthIndex, QuarterIndex, WeekIndex, YearIndex],
|
||||||
|
"8d-sma-ratio-p1": [DateIndex, DecadeIndex, MonthIndex, QuarterIndex, WeekIndex, YearIndex],
|
||||||
|
"8d-sma-ratio-p1-as-price": [DateIndex, DecadeIndex, MonthIndex, QuarterIndex, WeekIndex, YearIndex],
|
||||||
|
"8d-sma-ratio-p1sd": [DateIndex, DecadeIndex, MonthIndex, QuarterIndex, WeekIndex, YearIndex],
|
||||||
|
"8d-sma-ratio-p1sd-as-price": [DateIndex, DecadeIndex, MonthIndex, QuarterIndex, WeekIndex, YearIndex],
|
||||||
|
"8d-sma-ratio-p2sd": [DateIndex, DecadeIndex, MonthIndex, QuarterIndex, WeekIndex, YearIndex],
|
||||||
|
"8d-sma-ratio-p2sd-as-price": [DateIndex, DecadeIndex, MonthIndex, QuarterIndex, WeekIndex, YearIndex],
|
||||||
|
"8d-sma-ratio-p3sd": [DateIndex, DecadeIndex, MonthIndex, QuarterIndex, WeekIndex, YearIndex],
|
||||||
|
"8d-sma-ratio-p3sd-as-price": [DateIndex, DecadeIndex, MonthIndex, QuarterIndex, WeekIndex, YearIndex],
|
||||||
|
"8d-sma-ratio-p99": [DateIndex, DecadeIndex, MonthIndex, QuarterIndex, WeekIndex, YearIndex],
|
||||||
|
"8d-sma-ratio-p99-5": [DateIndex, DecadeIndex, MonthIndex, QuarterIndex, WeekIndex, YearIndex],
|
||||||
|
"8d-sma-ratio-p99-5-as-price": [DateIndex, DecadeIndex, MonthIndex, QuarterIndex, WeekIndex, YearIndex],
|
||||||
|
"8d-sma-ratio-p99-9": [DateIndex, DecadeIndex, MonthIndex, QuarterIndex, WeekIndex, YearIndex],
|
||||||
|
"8d-sma-ratio-p99-9-as-price": [DateIndex, DecadeIndex, MonthIndex, QuarterIndex, WeekIndex, YearIndex],
|
||||||
|
"8d-sma-ratio-p99-as-price": [DateIndex, DecadeIndex, MonthIndex, QuarterIndex, WeekIndex, YearIndex],
|
||||||
|
"8d-sma-ratio-sma": [DateIndex, DecadeIndex, MonthIndex, QuarterIndex, WeekIndex, YearIndex],
|
||||||
|
"8d-sma-ratio-standard-deviation": [DateIndex, DecadeIndex, MonthIndex, QuarterIndex, WeekIndex, YearIndex],
|
||||||
|
ath: [DateIndex, DecadeIndex, MonthIndex, QuarterIndex, WeekIndex, YearIndex],
|
||||||
"base-size": [TxIndex],
|
"base-size": [TxIndex],
|
||||||
"block-count": [Height],
|
"block-count": [Height],
|
||||||
"block-count-sum": [DateIndex, DecadeIndex, DifficultyEpoch, MonthIndex, QuarterIndex, WeekIndex, YearIndex],
|
"block-count-sum": [DateIndex, DecadeIndex, DifficultyEpoch, MonthIndex, QuarterIndex, WeekIndex, YearIndex],
|
||||||
@@ -108,9 +525,11 @@ export function createVecIdToIndexes() {
|
|||||||
"date-fixed": [Height],
|
"date-fixed": [Height],
|
||||||
dateindex: [DateIndex, Height],
|
dateindex: [DateIndex, Height],
|
||||||
"dateindex-count": [MonthIndex, WeekIndex],
|
"dateindex-count": [MonthIndex, WeekIndex],
|
||||||
|
"days-since-ath": [DateIndex, DecadeIndex, MonthIndex, QuarterIndex, WeekIndex, YearIndex],
|
||||||
decadeindex: [DecadeIndex, YearIndex],
|
decadeindex: [DecadeIndex, YearIndex],
|
||||||
difficulty: [DateIndex, DecadeIndex, DifficultyEpoch, Height, MonthIndex, QuarterIndex, WeekIndex, YearIndex],
|
difficulty: [DateIndex, DecadeIndex, DifficultyEpoch, Height, MonthIndex, QuarterIndex, WeekIndex, YearIndex],
|
||||||
difficultyepoch: [DateIndex, DecadeIndex, DifficultyEpoch, Height, MonthIndex, QuarterIndex, WeekIndex, YearIndex],
|
difficultyepoch: [DateIndex, DecadeIndex, DifficultyEpoch, Height, MonthIndex, QuarterIndex, WeekIndex, YearIndex],
|
||||||
|
drawdown: [DateIndex, DecadeIndex, MonthIndex, QuarterIndex, WeekIndex, YearIndex],
|
||||||
"emptyoutput-count": [Height],
|
"emptyoutput-count": [Height],
|
||||||
"emptyoutput-count-10p": [DateIndex],
|
"emptyoutput-count-10p": [DateIndex],
|
||||||
"emptyoutput-count-25p": [DateIndex],
|
"emptyoutput-count-25p": [DateIndex],
|
||||||
@@ -202,6 +621,9 @@ export function createVecIdToIndexes() {
|
|||||||
low: [DateIndex, DecadeIndex, DifficultyEpoch, Height, MonthIndex, QuarterIndex, WeekIndex, YearIndex],
|
low: [DateIndex, DecadeIndex, DifficultyEpoch, Height, MonthIndex, QuarterIndex, WeekIndex, YearIndex],
|
||||||
"low-in-cents": [DateIndex, Height],
|
"low-in-cents": [DateIndex, Height],
|
||||||
"low-in-sats": [DateIndex, DecadeIndex, DifficultyEpoch, Height, MonthIndex, QuarterIndex, WeekIndex, YearIndex],
|
"low-in-sats": [DateIndex, DecadeIndex, DifficultyEpoch, Height, MonthIndex, QuarterIndex, WeekIndex, YearIndex],
|
||||||
|
marketcap: [DateIndex, DecadeIndex, MonthIndex, QuarterIndex, WeekIndex, YearIndex],
|
||||||
|
"max-days-between-ath": [DateIndex, DecadeIndex, MonthIndex, QuarterIndex, WeekIndex, YearIndex],
|
||||||
|
"max-years-between-ath": [DateIndex, DecadeIndex, MonthIndex, QuarterIndex, WeekIndex, YearIndex],
|
||||||
monthindex: [DateIndex, MonthIndex],
|
monthindex: [DateIndex, MonthIndex],
|
||||||
"monthindex-count": [QuarterIndex, YearIndex],
|
"monthindex-count": [QuarterIndex, YearIndex],
|
||||||
ohlc: [DateIndex, DecadeIndex, DifficultyEpoch, Height, MonthIndex, QuarterIndex, WeekIndex, YearIndex],
|
ohlc: [DateIndex, DecadeIndex, DifficultyEpoch, Height, MonthIndex, QuarterIndex, WeekIndex, YearIndex],
|
||||||
|
|||||||
Reference in New Issue
Block a user