mirror of
https://github.com/bitcoinresearchkit/brk.git
synced 2026-05-23 00:04:48 -07:00
global: returns (lump sum vs dca)
This commit is contained in:
@@ -108,7 +108,7 @@ pub fn run(config: RunConfig) -> color_eyre::Result<()> {
|
|||||||
};
|
};
|
||||||
|
|
||||||
thread::Builder::new()
|
thread::Builder::new()
|
||||||
.stack_size(64 * 1024 * 1024)
|
.stack_size(128 * 1024 * 1024)
|
||||||
.spawn(f)?
|
.spawn(f)?
|
||||||
.join()
|
.join()
|
||||||
.unwrap()
|
.unwrap()
|
||||||
|
|||||||
@@ -333,7 +333,7 @@ impl ComputedRatioVecsFromDateIndex {
|
|||||||
if price == Dollars::ZERO {
|
if price == Dollars::ZERO {
|
||||||
(i, StoredF32::from(1.0))
|
(i, StoredF32::from(1.0))
|
||||||
} else {
|
} else {
|
||||||
(i, *close / price)
|
(i, StoredF32::from(*close / price))
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
exit,
|
exit,
|
||||||
|
|||||||
File diff suppressed because it is too large
Load Diff
@@ -3,7 +3,7 @@ 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};
|
||||||
|
|
||||||
use super::Sats;
|
use super::{Sats, StoredF64};
|
||||||
|
|
||||||
#[derive(
|
#[derive(
|
||||||
Debug,
|
Debug,
|
||||||
@@ -53,6 +53,12 @@ impl From<f64> for Bitcoin {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
impl From<StoredF64> for Bitcoin {
|
||||||
|
fn from(value: StoredF64) -> Self {
|
||||||
|
Self(*value)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
impl From<Bitcoin> for f64 {
|
impl From<Bitcoin> for f64 {
|
||||||
fn from(value: Bitcoin) -> Self {
|
fn from(value: Bitcoin) -> Self {
|
||||||
value.0
|
value.0
|
||||||
|
|||||||
@@ -81,3 +81,10 @@ impl Mul<Cents> for Cents {
|
|||||||
Self(self.0 * rhs.0)
|
Self(self.0 * rhs.0)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
impl Mul<usize> for Cents {
|
||||||
|
type Output = Cents;
|
||||||
|
fn mul(self, rhs: usize) -> Self::Output {
|
||||||
|
Self(self.0 * rhs as u64)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|||||||
@@ -7,7 +7,7 @@ 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, Close, Sats, StoredF32};
|
use super::{Bitcoin, Cents, Close, Sats, StoredF32, StoredF64};
|
||||||
|
|
||||||
#[derive(
|
#[derive(
|
||||||
Debug,
|
Debug,
|
||||||
@@ -27,6 +27,10 @@ pub struct Dollars(f64);
|
|||||||
|
|
||||||
impl Dollars {
|
impl Dollars {
|
||||||
pub const ZERO: Self = Self(0.0);
|
pub const ZERO: Self = Self(0.0);
|
||||||
|
|
||||||
|
pub const fn mint(dollars: f64) -> Self {
|
||||||
|
Self(dollars)
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
impl From<f32> for Dollars {
|
impl From<f32> for Dollars {
|
||||||
@@ -79,9 +83,23 @@ impl Add for Dollars {
|
|||||||
}
|
}
|
||||||
|
|
||||||
impl Div<Dollars> for Dollars {
|
impl Div<Dollars> for Dollars {
|
||||||
type Output = StoredF32;
|
type Output = StoredF64;
|
||||||
fn div(self, rhs: Dollars) -> Self::Output {
|
fn div(self, rhs: Dollars) -> Self::Output {
|
||||||
StoredF32::from((self.0 / rhs.0) as f32)
|
StoredF64::from(self.0 / rhs.0)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
impl Div<Close<Dollars>> for Dollars {
|
||||||
|
type Output = StoredF64;
|
||||||
|
fn div(self, rhs: Close<Dollars>) -> Self::Output {
|
||||||
|
StoredF64::from(self.0 / rhs.0)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
impl Div<Dollars> for Close<Dollars> {
|
||||||
|
type Output = StoredF64;
|
||||||
|
fn div(self, rhs: Dollars) -> Self::Output {
|
||||||
|
StoredF64::from(self.0 / rhs.0)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -92,6 +110,13 @@ impl Div<usize> for Dollars {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
impl Div<Bitcoin> for Dollars {
|
||||||
|
type Output = Self;
|
||||||
|
fn div(self, rhs: Bitcoin) -> Self::Output {
|
||||||
|
Self(f64::from(self) / f64::from(rhs))
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
impl Eq for Dollars {}
|
impl Eq for Dollars {}
|
||||||
|
|
||||||
#[allow(clippy::derive_ord_xor_partial_ord)]
|
#[allow(clippy::derive_ord_xor_partial_ord)]
|
||||||
@@ -121,6 +146,13 @@ impl Mul<StoredF32> for Dollars {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
impl Mul<usize> for Dollars {
|
||||||
|
type Output = Self;
|
||||||
|
fn mul(self, rhs: usize) -> Self::Output {
|
||||||
|
Self::from(Cents::from(self) * rhs)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
impl From<u128> for Dollars {
|
impl From<u128> for Dollars {
|
||||||
fn from(value: u128) -> Self {
|
fn from(value: u128) -> Self {
|
||||||
Self::from(Cents::from(value))
|
Self::from(Cents::from(value))
|
||||||
|
|||||||
@@ -6,7 +6,7 @@ use zerocopy_derive::{FromBytes, Immutable, IntoBytes, KnownLayout};
|
|||||||
|
|
||||||
use crate::CheckedSub;
|
use crate::CheckedSub;
|
||||||
|
|
||||||
use super::Dollars;
|
use super::{Dollars, StoredF64};
|
||||||
|
|
||||||
#[derive(
|
#[derive(
|
||||||
Debug,
|
Debug,
|
||||||
@@ -36,6 +36,12 @@ impl From<f64> for StoredF32 {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
impl From<StoredF64> for StoredF32 {
|
||||||
|
fn from(value: StoredF64) -> Self {
|
||||||
|
Self(*value as f32)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
impl From<usize> for StoredF32 {
|
impl From<usize> for StoredF32 {
|
||||||
fn from(value: usize) -> Self {
|
fn from(value: usize) -> Self {
|
||||||
Self(value as f32)
|
Self(value as f32)
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
use std::ops::{Add, Div};
|
use std::ops::{Add, Div, Mul};
|
||||||
|
|
||||||
use derive_deref::Deref;
|
use derive_deref::Deref;
|
||||||
use serde::Serialize;
|
use serde::Serialize;
|
||||||
@@ -40,6 +40,13 @@ impl CheckedSub<StoredF64> for StoredF64 {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
impl Mul<usize> for StoredF64 {
|
||||||
|
type Output = Self;
|
||||||
|
fn mul(self, rhs: usize) -> Self::Output {
|
||||||
|
Self(self.0 * rhs as f64)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
impl Div<usize> for StoredF64 {
|
impl Div<usize> for StoredF64 {
|
||||||
type Output = Self;
|
type Output = Self;
|
||||||
fn div(self, rhs: usize) -> Self::Output {
|
fn div(self, rhs: usize) -> Self::Output {
|
||||||
@@ -68,3 +75,9 @@ impl Ord for StoredF64 {
|
|||||||
self.0.partial_cmp(&other.0).unwrap()
|
self.0.partial_cmp(&other.0).unwrap()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
impl CheckedSub<usize> for StoredF64 {
|
||||||
|
fn checked_sub(self, rhs: usize) -> Option<Self> {
|
||||||
|
Some(Self(self.0 - rhs as f64))
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|||||||
@@ -3,12 +3,14 @@ use std::{
|
|||||||
cmp::Ordering,
|
cmp::Ordering,
|
||||||
f32,
|
f32,
|
||||||
fmt::Debug,
|
fmt::Debug,
|
||||||
ops::{Add, Div},
|
ops::{Add, Div, Mul},
|
||||||
path::{Path, PathBuf},
|
path::{Path, PathBuf},
|
||||||
time::Duration,
|
time::Duration,
|
||||||
};
|
};
|
||||||
|
|
||||||
use brk_core::{Bitcoin, CheckedSub, Close, Dollars, Height, Sats, StoredUsize, TxIndex};
|
use brk_core::{
|
||||||
|
Bitcoin, CheckedSub, Close, DateIndex, Dollars, Height, Sats, StoredUsize, TxIndex,
|
||||||
|
};
|
||||||
use brk_exit::Exit;
|
use brk_exit::Exit;
|
||||||
use log::info;
|
use log::info;
|
||||||
|
|
||||||
@@ -21,6 +23,7 @@ use crate::{
|
|||||||
const ONE_KIB: usize = 1024;
|
const ONE_KIB: usize = 1024;
|
||||||
const ONE_MIB: usize = ONE_KIB * ONE_KIB;
|
const ONE_MIB: usize = ONE_KIB * ONE_KIB;
|
||||||
const MAX_CACHE_SIZE: usize = 210 * ONE_MIB;
|
const MAX_CACHE_SIZE: usize = 210 * ONE_MIB;
|
||||||
|
const DCA_AMOUNT: Dollars = Dollars::mint(100.0);
|
||||||
|
|
||||||
#[derive(Debug, Clone)]
|
#[derive(Debug, Clone)]
|
||||||
pub struct EagerVec<I, T> {
|
pub struct EagerVec<I, T> {
|
||||||
@@ -176,6 +179,88 @@ where
|
|||||||
self.safe_flush(exit)
|
self.safe_flush(exit)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
pub fn compute_divide<T2, T3, T4>(
|
||||||
|
&mut self,
|
||||||
|
max_from: I,
|
||||||
|
divided: &impl AnyIterableVec<I, T2>,
|
||||||
|
divider: &impl AnyIterableVec<I, T3>,
|
||||||
|
exit: &Exit,
|
||||||
|
) -> Result<()>
|
||||||
|
where
|
||||||
|
T2: StoredType + Div<T3, Output = T4>,
|
||||||
|
T3: StoredType,
|
||||||
|
T4: Mul<usize, Output = T4> + CheckedSub<usize>,
|
||||||
|
T: From<T4>,
|
||||||
|
{
|
||||||
|
self.compute_divide_(max_from, divided, divider, exit, false, false)
|
||||||
|
}
|
||||||
|
|
||||||
|
pub fn compute_percentage<T2, T3, T4>(
|
||||||
|
&mut self,
|
||||||
|
max_from: I,
|
||||||
|
divided: &impl AnyIterableVec<I, T2>,
|
||||||
|
divider: &impl AnyIterableVec<I, T3>,
|
||||||
|
exit: &Exit,
|
||||||
|
) -> Result<()>
|
||||||
|
where
|
||||||
|
T2: StoredType + Div<T3, Output = T4>,
|
||||||
|
T3: StoredType,
|
||||||
|
T4: Mul<usize, Output = T4> + CheckedSub<usize>,
|
||||||
|
T: From<T4>,
|
||||||
|
{
|
||||||
|
self.compute_divide_(max_from, divided, divider, exit, true, false)
|
||||||
|
}
|
||||||
|
|
||||||
|
pub fn compute_percentage_difference<T2, T3, T4>(
|
||||||
|
&mut self,
|
||||||
|
max_from: I,
|
||||||
|
divided: &impl AnyIterableVec<I, T2>,
|
||||||
|
divider: &impl AnyIterableVec<I, T3>,
|
||||||
|
exit: &Exit,
|
||||||
|
) -> Result<()>
|
||||||
|
where
|
||||||
|
T2: StoredType + Div<T3, Output = T4>,
|
||||||
|
T3: StoredType,
|
||||||
|
T4: Mul<usize, Output = T4> + CheckedSub<usize>,
|
||||||
|
T: From<T4>,
|
||||||
|
{
|
||||||
|
self.compute_divide_(max_from, divided, divider, exit, true, true)
|
||||||
|
}
|
||||||
|
|
||||||
|
pub fn compute_divide_<T2, T3, T4>(
|
||||||
|
&mut self,
|
||||||
|
max_from: I,
|
||||||
|
divided: &impl AnyIterableVec<I, T2>,
|
||||||
|
divider: &impl AnyIterableVec<I, T3>,
|
||||||
|
exit: &Exit,
|
||||||
|
as_percentage: bool,
|
||||||
|
as_difference: bool,
|
||||||
|
) -> Result<()>
|
||||||
|
where
|
||||||
|
T2: StoredType + Div<T3, Output = T4>,
|
||||||
|
T3: StoredType,
|
||||||
|
T4: Mul<usize, Output = T4> + CheckedSub<usize>,
|
||||||
|
T: From<T4>,
|
||||||
|
{
|
||||||
|
self.validate_computed_version_or_reset_file(
|
||||||
|
Version::ZERO + self.inner.version() + divided.version() + divider.version(),
|
||||||
|
)?;
|
||||||
|
|
||||||
|
let index = max_from.min(I::from(self.len()));
|
||||||
|
let multiplier = if as_percentage { 100 } else { 1 };
|
||||||
|
let subtract = if as_difference { multiplier } else { 0 };
|
||||||
|
|
||||||
|
let mut divider_iter = divider.iter();
|
||||||
|
divided.iter_at(index).try_for_each(|(i, divided)| {
|
||||||
|
let v = (divided.into_inner() / divider_iter.unwrap_get_inner(i) * multiplier)
|
||||||
|
.checked_sub(subtract)
|
||||||
|
.unwrap();
|
||||||
|
self.forced_push_at(i, T::from(v), exit)
|
||||||
|
})?;
|
||||||
|
|
||||||
|
self.safe_flush(exit)
|
||||||
|
}
|
||||||
|
|
||||||
pub fn compute_inverse_more_to_less(
|
pub fn compute_inverse_more_to_less(
|
||||||
&mut self,
|
&mut self,
|
||||||
max_from: T,
|
max_from: T,
|
||||||
@@ -474,6 +559,186 @@ where
|
|||||||
|
|
||||||
self.safe_flush(exit)
|
self.safe_flush(exit)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
pub fn compute_previous_value<T2>(
|
||||||
|
&mut self,
|
||||||
|
max_from: I,
|
||||||
|
source: &impl AnyIterableVec<I, T2>,
|
||||||
|
len: usize,
|
||||||
|
exit: &Exit,
|
||||||
|
) -> Result<()>
|
||||||
|
where
|
||||||
|
I: CheckedSub,
|
||||||
|
T2: StoredType + Default,
|
||||||
|
f32: From<T2>,
|
||||||
|
T: From<f32>,
|
||||||
|
{
|
||||||
|
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 source_iter = source.iter();
|
||||||
|
(index.to_usize()?..source.len()).try_for_each(|i| {
|
||||||
|
let i = I::from(i);
|
||||||
|
|
||||||
|
let previous_value = i
|
||||||
|
.checked_sub(I::from(len))
|
||||||
|
.map(|prev_i| f32::from(source_iter.unwrap_get_inner(prev_i)))
|
||||||
|
.unwrap_or(f32::NAN);
|
||||||
|
|
||||||
|
self.forced_push_at(i, T::from(previous_value), exit)
|
||||||
|
})?;
|
||||||
|
|
||||||
|
self.safe_flush(exit)
|
||||||
|
}
|
||||||
|
|
||||||
|
pub fn compute_percentage_change<T2>(
|
||||||
|
&mut self,
|
||||||
|
max_from: I,
|
||||||
|
source: &impl AnyIterableVec<I, T2>,
|
||||||
|
len: usize,
|
||||||
|
exit: &Exit,
|
||||||
|
) -> Result<()>
|
||||||
|
where
|
||||||
|
I: CheckedSub,
|
||||||
|
T2: StoredType + Default,
|
||||||
|
f32: From<T2>,
|
||||||
|
T: From<f32>,
|
||||||
|
{
|
||||||
|
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 source_iter = source.iter();
|
||||||
|
source.iter_at(index).try_for_each(|(i, b)| {
|
||||||
|
let previous_value = f32::from(
|
||||||
|
i.checked_sub(I::from(len))
|
||||||
|
.map(|prev_i| source_iter.unwrap_get_inner(prev_i))
|
||||||
|
.unwrap_or_default(),
|
||||||
|
);
|
||||||
|
|
||||||
|
let last_value = f32::from(b.into_inner());
|
||||||
|
|
||||||
|
let percentage_change = ((last_value / previous_value) - 1.0) * 100.0;
|
||||||
|
|
||||||
|
self.forced_push_at(i, T::from(percentage_change), exit)
|
||||||
|
})?;
|
||||||
|
|
||||||
|
self.safe_flush(exit)
|
||||||
|
}
|
||||||
|
|
||||||
|
pub fn compute_cagr<T2>(
|
||||||
|
&mut self,
|
||||||
|
max_from: I,
|
||||||
|
percentage_returns: &impl AnyIterableVec<I, T2>,
|
||||||
|
days: usize,
|
||||||
|
exit: &Exit,
|
||||||
|
) -> Result<()>
|
||||||
|
where
|
||||||
|
I: CheckedSub,
|
||||||
|
T2: StoredType + Default,
|
||||||
|
f32: From<T2>,
|
||||||
|
T: From<f32>,
|
||||||
|
{
|
||||||
|
self.validate_computed_version_or_reset_file(
|
||||||
|
Version::ZERO + self.inner.version() + percentage_returns.version(),
|
||||||
|
)?;
|
||||||
|
|
||||||
|
if days % 365 != 0 {
|
||||||
|
panic!("bad days");
|
||||||
|
}
|
||||||
|
|
||||||
|
let years = days / 365;
|
||||||
|
let index = max_from.min(I::from(self.len()));
|
||||||
|
percentage_returns
|
||||||
|
.iter_at(index)
|
||||||
|
.try_for_each(|(i, percentage)| {
|
||||||
|
let percentage = percentage.into_inner();
|
||||||
|
|
||||||
|
let cagr = (((f32::from(percentage) / 100.0 + 1.0).powf(1.0 / years as f32)) - 1.0)
|
||||||
|
* 100.0;
|
||||||
|
|
||||||
|
self.forced_push_at(i, T::from(cagr), exit)
|
||||||
|
})?;
|
||||||
|
|
||||||
|
self.safe_flush(exit)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
impl EagerVec<DateIndex, Sats> {
|
||||||
|
pub fn compute_dca_stack(
|
||||||
|
&mut self,
|
||||||
|
max_from: DateIndex,
|
||||||
|
closes: &impl AnyIterableVec<DateIndex, Close<Dollars>>,
|
||||||
|
len: usize,
|
||||||
|
exit: &Exit,
|
||||||
|
) -> Result<()> {
|
||||||
|
self.validate_computed_version_or_reset_file(
|
||||||
|
Version::ZERO + self.inner.version() + closes.version(),
|
||||||
|
)?;
|
||||||
|
|
||||||
|
let mut other_iter = closes.iter();
|
||||||
|
let mut prev = None;
|
||||||
|
|
||||||
|
let index = max_from.min(DateIndex::from(self.len()));
|
||||||
|
closes.iter_at(index).try_for_each(|(i, closes)| {
|
||||||
|
let price = *closes.into_inner();
|
||||||
|
let i_usize = i.unwrap_to_usize();
|
||||||
|
if prev.is_none() {
|
||||||
|
if i_usize == 0 {
|
||||||
|
prev.replace(Sats::ZERO);
|
||||||
|
} else {
|
||||||
|
prev.replace(self.into_iter().unwrap_get_inner_(i_usize - 1));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
let mut stack = Sats::ZERO;
|
||||||
|
|
||||||
|
if price != Dollars::ZERO {
|
||||||
|
stack = prev.unwrap() + Sats::from(Bitcoin::from(DCA_AMOUNT / price));
|
||||||
|
if i_usize >= len {
|
||||||
|
let prev_price = *other_iter.unwrap_get_inner_(i_usize - len);
|
||||||
|
if prev_price != Dollars::ZERO {
|
||||||
|
stack = stack
|
||||||
|
.checked_sub(Sats::from(Bitcoin::from(DCA_AMOUNT / prev_price)))
|
||||||
|
.unwrap();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
prev.replace(stack);
|
||||||
|
|
||||||
|
self.forced_push_at(i, stack, exit)
|
||||||
|
})?;
|
||||||
|
|
||||||
|
self.safe_flush(exit)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
impl EagerVec<DateIndex, Dollars> {
|
||||||
|
pub fn compute_dca_avg_price(
|
||||||
|
&mut self,
|
||||||
|
max_from: DateIndex,
|
||||||
|
stacks: &impl AnyIterableVec<DateIndex, Sats>,
|
||||||
|
len: usize,
|
||||||
|
exit: &Exit,
|
||||||
|
) -> Result<()> {
|
||||||
|
self.validate_computed_version_or_reset_file(
|
||||||
|
Version::ONE + self.inner.version() + stacks.version(),
|
||||||
|
)?;
|
||||||
|
|
||||||
|
let index = max_from.min(DateIndex::from(self.len()));
|
||||||
|
|
||||||
|
stacks.iter_at(index).try_for_each(|(i, stack)| {
|
||||||
|
let stack = stack.into_inner();
|
||||||
|
let avg_price = DCA_AMOUNT * len.min(i.unwrap_to_usize() + 1) / Bitcoin::from(stack);
|
||||||
|
self.forced_push_at(i, avg_price, exit)
|
||||||
|
})?;
|
||||||
|
|
||||||
|
self.safe_flush(exit)
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
impl<I> EagerVec<I, Bitcoin>
|
impl<I> EagerVec<I, Bitcoin>
|
||||||
|
|||||||
@@ -990,12 +990,8 @@
|
|||||||
display: flex;
|
display: flex;
|
||||||
align-items: center;
|
align-items: center;
|
||||||
gap: 1.5rem;
|
gap: 1.5rem;
|
||||||
margin-left: var(--negative-main-padding);
|
margin: -0.5rem var(--negative-main-padding);
|
||||||
margin-right: var(--negative-main-padding);
|
padding: 1rem var(--main-padding);
|
||||||
padding-left: var(--main-padding);
|
|
||||||
padding-right: var(--main-padding);
|
|
||||||
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);
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
// @ts-check
|
// @ts-check
|
||||||
|
|
||||||
/** @import {IChartApi, ISeriesApi, SeriesDefinition, SingleValueData as _SingleValueData, CandlestickData as _CandlestickData, BaselineData, SeriesType, IPaneApi, LineSeriesOptions} from './v5.0.6-treeshaked/types' */
|
/** @import {IChartApi, ISeriesApi, SeriesDefinition, SingleValueData as _SingleValueData, CandlestickData as _CandlestickData, BaselineData, SeriesType, IPaneApi, LineSeriesOptions, BaselineStyleOptions} from './v5.0.6-treeshaked/types' */
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @typedef {[number, number, number, number]} OHLCTuple
|
* @typedef {[number, number, number, number]} OHLCTuple
|
||||||
@@ -485,7 +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]
|
* @param {DeepPartial<BaselineStyleOptions & SeriesOptionsCommon>} [args.options]
|
||||||
*/
|
*/
|
||||||
addBaselineSeries({
|
addBaselineSeries({
|
||||||
vecId,
|
vecId,
|
||||||
@@ -507,18 +507,18 @@ export default import("./v5.0.6-treeshaked/script.js").then((lc) => {
|
|||||||
{
|
{
|
||||||
lineWidth: /** @type {any} */ (1.5),
|
lineWidth: /** @type {any} */ (1.5),
|
||||||
visible: defaultActive !== false,
|
visible: defaultActive !== false,
|
||||||
topLineColor: colors.green(),
|
...options,
|
||||||
bottomLineColor: colors.red(),
|
topLineColor: options?.topLineColor ?? colors.green(),
|
||||||
|
bottomLineColor: options?.bottomLineColor ?? colors.red(),
|
||||||
priceLineVisible: false,
|
priceLineVisible: false,
|
||||||
// bottomFillColor1: "transparent",
|
bottomFillColor1: "transparent",
|
||||||
// bottomFillColor2: "transparent",
|
bottomFillColor2: "transparent",
|
||||||
// topFillColor1: "transparent",
|
topFillColor1: "transparent",
|
||||||
// topFillColor2: "transparent",
|
topFillColor2: "transparent",
|
||||||
baseValue: {
|
baseValue: {
|
||||||
price: 0,
|
price: 0,
|
||||||
},
|
},
|
||||||
lineVisible: true,
|
lineVisible: true,
|
||||||
...options,
|
|
||||||
},
|
},
|
||||||
paneIndex,
|
paneIndex,
|
||||||
);
|
);
|
||||||
@@ -545,7 +545,10 @@ export default import("./v5.0.6-treeshaked/script.js").then((lc) => {
|
|||||||
|
|
||||||
(paneIndex ? legendBottom : legendTop).add({
|
(paneIndex ? legendBottom : legendTop).add({
|
||||||
series,
|
series,
|
||||||
colors: [colors.green, colors.red],
|
colors: [
|
||||||
|
() => options?.topLineColor ?? colors.green(),
|
||||||
|
() => options?.bottomLineColor ?? colors.red(),
|
||||||
|
],
|
||||||
name,
|
name,
|
||||||
defaultActive,
|
defaultActive,
|
||||||
url,
|
url,
|
||||||
|
|||||||
@@ -238,7 +238,11 @@ export function init({
|
|||||||
unit,
|
unit,
|
||||||
defaultActive: blueprint.defaultActive,
|
defaultActive: blueprint.defaultActive,
|
||||||
paneIndex,
|
paneIndex,
|
||||||
options: blueprint.options,
|
options: {
|
||||||
|
...blueprint.options,
|
||||||
|
topLineColor: blueprint.colors?.[0](),
|
||||||
|
bottomLineColor: blueprint.colors?.[1](),
|
||||||
|
},
|
||||||
});
|
});
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -41,7 +41,9 @@
|
|||||||
* "Years" |
|
* "Years" |
|
||||||
* "Locktime" |
|
* "Locktime" |
|
||||||
* "sat/vB" |
|
* "sat/vB" |
|
||||||
* "vB"
|
* "cagr" |
|
||||||
|
* "vB" |
|
||||||
|
* "performance" |
|
||||||
* } Unit
|
* } Unit
|
||||||
*/
|
*/
|
||||||
|
|
||||||
@@ -686,6 +688,10 @@ 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.endsWith("cagr")) {
|
||||||
|
unit = "cagr";
|
||||||
|
} else if (id.endsWith("returns")) {
|
||||||
|
unit = "performance";
|
||||||
} else if (id === "drawdown" || id.endsWith("oscillator")) {
|
} else if (id === "drawdown" || id.endsWith("oscillator")) {
|
||||||
unit = "percentage";
|
unit = "percentage";
|
||||||
} else if (id.endsWith("-as-price")) {
|
} else if (id.endsWith("-as-price")) {
|
||||||
@@ -726,7 +732,8 @@ function createUtils() {
|
|||||||
id.includes("output-value") ||
|
id.includes("output-value") ||
|
||||||
id.includes("fee") ||
|
id.includes("fee") ||
|
||||||
id.includes("coinbase") ||
|
id.includes("coinbase") ||
|
||||||
id.includes("subsidy")
|
id.includes("subsidy") ||
|
||||||
|
id.endsWith("stack")
|
||||||
) {
|
) {
|
||||||
unit = "Sats";
|
unit = "Sats";
|
||||||
} else if (
|
} else if (
|
||||||
@@ -737,7 +744,9 @@ function createUtils() {
|
|||||||
id.includes("ohlc") ||
|
id.includes("ohlc") ||
|
||||||
id.includes("marketcap") ||
|
id.includes("marketcap") ||
|
||||||
id.includes("ath") ||
|
id.includes("ath") ||
|
||||||
id.includes("-sma")
|
id.includes("-sma") ||
|
||||||
|
id.endsWith("-price") ||
|
||||||
|
id.startsWith("price-")
|
||||||
) {
|
) {
|
||||||
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)) {
|
||||||
@@ -1619,6 +1628,20 @@ function createColors(dark, elements) {
|
|||||||
_4y: purple,
|
_4y: purple,
|
||||||
_10y: fuchsia,
|
_10y: fuchsia,
|
||||||
|
|
||||||
|
// r1d: pink,
|
||||||
|
// r1w: red,
|
||||||
|
// r1m: amber,
|
||||||
|
// r3m: yellow,
|
||||||
|
// r6m: lime,
|
||||||
|
// r1y: green,
|
||||||
|
// r2y: emerald,
|
||||||
|
// r3y: teal,
|
||||||
|
// r4y: blue,
|
||||||
|
// r5y: indigo,
|
||||||
|
// r6y: violet,
|
||||||
|
// r8y: purple,
|
||||||
|
// r10y: fuchsia,
|
||||||
|
|
||||||
p2pk: lime,
|
p2pk: lime,
|
||||||
p2pkh: violet,
|
p2pkh: violet,
|
||||||
p2sh: emerald,
|
p2sh: emerald,
|
||||||
|
|||||||
@@ -19,6 +19,7 @@
|
|||||||
* @typedef {Object} BaselineSeriesBlueprintSpecific
|
* @typedef {Object} BaselineSeriesBlueprintSpecific
|
||||||
* @property {"Baseline"} type
|
* @property {"Baseline"} type
|
||||||
* @property {Color} [color]
|
* @property {Color} [color]
|
||||||
|
* @property {[Color, Color]} [colors]
|
||||||
* @property {DeepPartial<BaselineStyleOptions & SeriesOptionsCommon>} [options]
|
* @property {DeepPartial<BaselineStyleOptions & SeriesOptionsCommon>} [options]
|
||||||
* @property {Accessor<BaselineData[]>} [data]
|
* @property {Accessor<BaselineData[]>} [data]
|
||||||
* @typedef {BaseSeriesBlueprint & BaselineSeriesBlueprintSpecific} BaselineSeriesBlueprint
|
* @typedef {BaseSeriesBlueprint & BaselineSeriesBlueprintSpecific} BaselineSeriesBlueprint
|
||||||
@@ -1093,6 +1094,117 @@ function createPartialOptions(colors) {
|
|||||||
})),
|
})),
|
||||||
],
|
],
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
name: "Returns",
|
||||||
|
tree: [
|
||||||
|
{
|
||||||
|
name: "1 Day",
|
||||||
|
title: `1 Day Returns`,
|
||||||
|
top: [
|
||||||
|
createBaseSeries({
|
||||||
|
key: `price-1d-ago`,
|
||||||
|
name: `Price 1d ago`,
|
||||||
|
}),
|
||||||
|
],
|
||||||
|
bottom: [
|
||||||
|
/** @satisfies {FetchedBaselineSeriesBlueprint} */ ({
|
||||||
|
key: `1d-returns`,
|
||||||
|
title: "1d",
|
||||||
|
type: "Baseline",
|
||||||
|
}),
|
||||||
|
],
|
||||||
|
},
|
||||||
|
.../** @type {const} */ ([
|
||||||
|
{ name: "1 Week", key: "1w" },
|
||||||
|
{ name: "1 Month", key: "1m" },
|
||||||
|
{ name: "3 Months", key: "3m" },
|
||||||
|
{ name: "6 Months", key: "6m" },
|
||||||
|
{ name: "1 Year", key: "1y" },
|
||||||
|
]).map(
|
||||||
|
({ name, key }) =>
|
||||||
|
/** @satisfies {PartialChartOption} */ ({
|
||||||
|
name,
|
||||||
|
title: `${name} Returns`,
|
||||||
|
top: [
|
||||||
|
createBaseSeries({
|
||||||
|
key: `price-${key}-ago`,
|
||||||
|
name: `lump sum`,
|
||||||
|
color: colors.cyan,
|
||||||
|
}),
|
||||||
|
createBaseSeries({
|
||||||
|
key: `${key}-dca-avg-price`,
|
||||||
|
name: `dca`,
|
||||||
|
color: colors.orange,
|
||||||
|
}),
|
||||||
|
],
|
||||||
|
bottom: [
|
||||||
|
/** @satisfies {FetchedBaselineSeriesBlueprint} */ ({
|
||||||
|
key: `${key}-returns`,
|
||||||
|
title: "lump sum",
|
||||||
|
type: "Baseline",
|
||||||
|
}),
|
||||||
|
/** @satisfies {FetchedBaselineSeriesBlueprint} */ ({
|
||||||
|
key: `${key}-dca-returns`,
|
||||||
|
title: "dca",
|
||||||
|
type: "Baseline",
|
||||||
|
colors: [colors.yellow, colors.pink],
|
||||||
|
}),
|
||||||
|
],
|
||||||
|
}),
|
||||||
|
),
|
||||||
|
.../** @type {const} */ ([
|
||||||
|
{ name: "2 Year", key: "2y" },
|
||||||
|
{ name: "3 Year", key: "3y" },
|
||||||
|
{ name: "4 Year", key: "4y" },
|
||||||
|
{ name: "5 Year", key: "5y" },
|
||||||
|
{ name: "6 Year", key: "6y" },
|
||||||
|
{ name: "8 Year", key: "8y" },
|
||||||
|
{ name: "10 Year", key: "10y" },
|
||||||
|
]).map(
|
||||||
|
({ name, key }) =>
|
||||||
|
/** @satisfies {PartialChartOption} */ ({
|
||||||
|
name,
|
||||||
|
title: `${name} Returns`,
|
||||||
|
top: [
|
||||||
|
createBaseSeries({
|
||||||
|
key: `price-${key}-ago`,
|
||||||
|
name: `lump sum`,
|
||||||
|
color: colors.cyan,
|
||||||
|
}),
|
||||||
|
createBaseSeries({
|
||||||
|
key: `${key}-dca-avg-price`,
|
||||||
|
name: `dca`,
|
||||||
|
color: colors.orange,
|
||||||
|
}),
|
||||||
|
],
|
||||||
|
bottom: [
|
||||||
|
/** @satisfies {FetchedBaselineSeriesBlueprint} */ ({
|
||||||
|
key: `${key}-returns`,
|
||||||
|
title: "lump sum",
|
||||||
|
type: "Baseline",
|
||||||
|
}),
|
||||||
|
/** @satisfies {FetchedBaselineSeriesBlueprint} */ ({
|
||||||
|
key: `${key}-cagr`,
|
||||||
|
title: "lump sum",
|
||||||
|
type: "Baseline",
|
||||||
|
}),
|
||||||
|
/** @satisfies {FetchedBaselineSeriesBlueprint} */ ({
|
||||||
|
key: `${key}-dca-returns`,
|
||||||
|
title: "dca",
|
||||||
|
type: "Baseline",
|
||||||
|
colors: [colors.yellow, colors.pink],
|
||||||
|
}),
|
||||||
|
/** @satisfies {FetchedBaselineSeriesBlueprint} */ ({
|
||||||
|
key: `${key}-dca-cagr`,
|
||||||
|
title: "dca",
|
||||||
|
type: "Baseline",
|
||||||
|
colors: [colors.yellow, colors.pink],
|
||||||
|
}),
|
||||||
|
],
|
||||||
|
}),
|
||||||
|
),
|
||||||
|
],
|
||||||
|
},
|
||||||
],
|
],
|
||||||
},
|
},
|
||||||
],
|
],
|
||||||
|
|||||||
@@ -832,7 +832,7 @@ export function init({
|
|||||||
owner,
|
owner,
|
||||||
config: [
|
config: [
|
||||||
{
|
{
|
||||||
unit: "%",
|
unit: "percentage",
|
||||||
blueprints: [
|
blueprints: [
|
||||||
{
|
{
|
||||||
title: "Profitable Days Ratio",
|
title: "Profitable Days Ratio",
|
||||||
|
|||||||
@@ -56,6 +56,12 @@ export function createVecIdToIndexes() {
|
|||||||
const YearIndex = /** @satisfies {YearIndex} */ (23);
|
const YearIndex = /** @satisfies {YearIndex} */ (23);
|
||||||
|
|
||||||
return /** @type {const} */ ({
|
return /** @type {const} */ ({
|
||||||
|
"10y-cagr": [DateIndex, DecadeIndex, MonthIndex, QuarterIndex, WeekIndex, YearIndex],
|
||||||
|
"10y-dca-avg-price": [DateIndex, DecadeIndex, MonthIndex, QuarterIndex, WeekIndex, YearIndex],
|
||||||
|
"10y-dca-cagr": [DateIndex, DecadeIndex, MonthIndex, QuarterIndex, WeekIndex, YearIndex],
|
||||||
|
"10y-dca-returns": [DateIndex, DecadeIndex, MonthIndex, QuarterIndex, WeekIndex, YearIndex],
|
||||||
|
"10y-dca-stack": [DateIndex, DecadeIndex, MonthIndex, QuarterIndex, WeekIndex, YearIndex],
|
||||||
|
"10y-returns": [DateIndex, DecadeIndex, MonthIndex, QuarterIndex, WeekIndex, YearIndex],
|
||||||
"13d-sma": [DateIndex, DecadeIndex, MonthIndex, QuarterIndex, WeekIndex, YearIndex],
|
"13d-sma": [DateIndex, DecadeIndex, MonthIndex, QuarterIndex, WeekIndex, YearIndex],
|
||||||
"13d-sma-ratio": [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-1m-sma": [DateIndex, DecadeIndex, MonthIndex, QuarterIndex, WeekIndex, YearIndex],
|
||||||
@@ -120,6 +126,11 @@ export function createVecIdToIndexes() {
|
|||||||
"144d-sma-ratio-p99-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-sma": [DateIndex, DecadeIndex, MonthIndex, QuarterIndex, WeekIndex, YearIndex],
|
||||||
"144d-sma-ratio-standard-deviation": [DateIndex, DecadeIndex, MonthIndex, QuarterIndex, WeekIndex, YearIndex],
|
"144d-sma-ratio-standard-deviation": [DateIndex, DecadeIndex, MonthIndex, QuarterIndex, WeekIndex, YearIndex],
|
||||||
|
"1d-returns": [DateIndex, DecadeIndex, MonthIndex, QuarterIndex, WeekIndex, YearIndex],
|
||||||
|
"1m-dca-avg-price": [DateIndex, DecadeIndex, MonthIndex, QuarterIndex, WeekIndex, YearIndex],
|
||||||
|
"1m-dca-returns": [DateIndex, DecadeIndex, MonthIndex, QuarterIndex, WeekIndex, YearIndex],
|
||||||
|
"1m-dca-stack": [DateIndex, DecadeIndex, MonthIndex, QuarterIndex, WeekIndex, YearIndex],
|
||||||
|
"1m-returns": [DateIndex, DecadeIndex, MonthIndex, QuarterIndex, WeekIndex, YearIndex],
|
||||||
"1m-sma": [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": [DateIndex, DecadeIndex, MonthIndex, QuarterIndex, WeekIndex, YearIndex],
|
||||||
"1m-sma-ratio-1m-sma": [DateIndex, DecadeIndex, MonthIndex, QuarterIndex, WeekIndex, YearIndex],
|
"1m-sma-ratio-1m-sma": [DateIndex, DecadeIndex, MonthIndex, QuarterIndex, WeekIndex, YearIndex],
|
||||||
@@ -152,6 +163,10 @@ export function createVecIdToIndexes() {
|
|||||||
"1m-sma-ratio-p99-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-sma": [DateIndex, DecadeIndex, MonthIndex, QuarterIndex, WeekIndex, YearIndex],
|
||||||
"1m-sma-ratio-standard-deviation": [DateIndex, DecadeIndex, MonthIndex, QuarterIndex, WeekIndex, YearIndex],
|
"1m-sma-ratio-standard-deviation": [DateIndex, DecadeIndex, MonthIndex, QuarterIndex, WeekIndex, YearIndex],
|
||||||
|
"1w-dca-avg-price": [DateIndex, DecadeIndex, MonthIndex, QuarterIndex, WeekIndex, YearIndex],
|
||||||
|
"1w-dca-returns": [DateIndex, DecadeIndex, MonthIndex, QuarterIndex, WeekIndex, YearIndex],
|
||||||
|
"1w-dca-stack": [DateIndex, DecadeIndex, MonthIndex, QuarterIndex, WeekIndex, YearIndex],
|
||||||
|
"1w-returns": [DateIndex, DecadeIndex, MonthIndex, QuarterIndex, WeekIndex, YearIndex],
|
||||||
"1w-sma": [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": [DateIndex, DecadeIndex, MonthIndex, QuarterIndex, WeekIndex, YearIndex],
|
||||||
"1w-sma-ratio-1m-sma": [DateIndex, DecadeIndex, MonthIndex, QuarterIndex, WeekIndex, YearIndex],
|
"1w-sma-ratio-1m-sma": [DateIndex, DecadeIndex, MonthIndex, QuarterIndex, WeekIndex, YearIndex],
|
||||||
@@ -184,6 +199,10 @@ export function createVecIdToIndexes() {
|
|||||||
"1w-sma-ratio-p99-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-sma": [DateIndex, DecadeIndex, MonthIndex, QuarterIndex, WeekIndex, YearIndex],
|
||||||
"1w-sma-ratio-standard-deviation": [DateIndex, DecadeIndex, MonthIndex, QuarterIndex, WeekIndex, YearIndex],
|
"1w-sma-ratio-standard-deviation": [DateIndex, DecadeIndex, MonthIndex, QuarterIndex, WeekIndex, YearIndex],
|
||||||
|
"1y-dca-avg-price": [DateIndex, DecadeIndex, MonthIndex, QuarterIndex, WeekIndex, YearIndex],
|
||||||
|
"1y-dca-returns": [DateIndex, DecadeIndex, MonthIndex, QuarterIndex, WeekIndex, YearIndex],
|
||||||
|
"1y-dca-stack": [DateIndex, DecadeIndex, MonthIndex, QuarterIndex, WeekIndex, YearIndex],
|
||||||
|
"1y-returns": [DateIndex, DecadeIndex, MonthIndex, QuarterIndex, WeekIndex, YearIndex],
|
||||||
"1y-sma": [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": [DateIndex, DecadeIndex, MonthIndex, QuarterIndex, WeekIndex, YearIndex],
|
||||||
"1y-sma-ratio-1m-sma": [DateIndex, DecadeIndex, MonthIndex, QuarterIndex, WeekIndex, YearIndex],
|
"1y-sma-ratio-1m-sma": [DateIndex, DecadeIndex, MonthIndex, QuarterIndex, WeekIndex, YearIndex],
|
||||||
@@ -280,6 +299,12 @@ export function createVecIdToIndexes() {
|
|||||||
"21d-sma-ratio-p99-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-sma": [DateIndex, DecadeIndex, MonthIndex, QuarterIndex, WeekIndex, YearIndex],
|
||||||
"21d-sma-ratio-standard-deviation": [DateIndex, DecadeIndex, MonthIndex, QuarterIndex, WeekIndex, YearIndex],
|
"21d-sma-ratio-standard-deviation": [DateIndex, DecadeIndex, MonthIndex, QuarterIndex, WeekIndex, YearIndex],
|
||||||
|
"2y-cagr": [DateIndex, DecadeIndex, MonthIndex, QuarterIndex, WeekIndex, YearIndex],
|
||||||
|
"2y-dca-avg-price": [DateIndex, DecadeIndex, MonthIndex, QuarterIndex, WeekIndex, YearIndex],
|
||||||
|
"2y-dca-cagr": [DateIndex, DecadeIndex, MonthIndex, QuarterIndex, WeekIndex, YearIndex],
|
||||||
|
"2y-dca-returns": [DateIndex, DecadeIndex, MonthIndex, QuarterIndex, WeekIndex, YearIndex],
|
||||||
|
"2y-dca-stack": [DateIndex, DecadeIndex, MonthIndex, QuarterIndex, WeekIndex, YearIndex],
|
||||||
|
"2y-returns": [DateIndex, DecadeIndex, MonthIndex, QuarterIndex, WeekIndex, YearIndex],
|
||||||
"2y-sma": [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": [DateIndex, DecadeIndex, MonthIndex, QuarterIndex, WeekIndex, YearIndex],
|
||||||
"2y-sma-ratio-1m-sma": [DateIndex, DecadeIndex, MonthIndex, QuarterIndex, WeekIndex, YearIndex],
|
"2y-sma-ratio-1m-sma": [DateIndex, DecadeIndex, MonthIndex, QuarterIndex, WeekIndex, YearIndex],
|
||||||
@@ -344,6 +369,22 @@ export function createVecIdToIndexes() {
|
|||||||
"34d-sma-ratio-p99-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-sma": [DateIndex, DecadeIndex, MonthIndex, QuarterIndex, WeekIndex, YearIndex],
|
||||||
"34d-sma-ratio-standard-deviation": [DateIndex, DecadeIndex, MonthIndex, QuarterIndex, WeekIndex, YearIndex],
|
"34d-sma-ratio-standard-deviation": [DateIndex, DecadeIndex, MonthIndex, QuarterIndex, WeekIndex, YearIndex],
|
||||||
|
"3m-dca-avg-price": [DateIndex, DecadeIndex, MonthIndex, QuarterIndex, WeekIndex, YearIndex],
|
||||||
|
"3m-dca-returns": [DateIndex, DecadeIndex, MonthIndex, QuarterIndex, WeekIndex, YearIndex],
|
||||||
|
"3m-dca-stack": [DateIndex, DecadeIndex, MonthIndex, QuarterIndex, WeekIndex, YearIndex],
|
||||||
|
"3m-returns": [DateIndex, DecadeIndex, MonthIndex, QuarterIndex, WeekIndex, YearIndex],
|
||||||
|
"3y-cagr": [DateIndex, DecadeIndex, MonthIndex, QuarterIndex, WeekIndex, YearIndex],
|
||||||
|
"3y-dca-avg-price": [DateIndex, DecadeIndex, MonthIndex, QuarterIndex, WeekIndex, YearIndex],
|
||||||
|
"3y-dca-cagr": [DateIndex, DecadeIndex, MonthIndex, QuarterIndex, WeekIndex, YearIndex],
|
||||||
|
"3y-dca-returns": [DateIndex, DecadeIndex, MonthIndex, QuarterIndex, WeekIndex, YearIndex],
|
||||||
|
"3y-dca-stack": [DateIndex, DecadeIndex, MonthIndex, QuarterIndex, WeekIndex, YearIndex],
|
||||||
|
"3y-returns": [DateIndex, DecadeIndex, MonthIndex, QuarterIndex, WeekIndex, YearIndex],
|
||||||
|
"4y-cagr": [DateIndex, DecadeIndex, MonthIndex, QuarterIndex, WeekIndex, YearIndex],
|
||||||
|
"4y-dca-avg-price": [DateIndex, DecadeIndex, MonthIndex, QuarterIndex, WeekIndex, YearIndex],
|
||||||
|
"4y-dca-cagr": [DateIndex, DecadeIndex, MonthIndex, QuarterIndex, WeekIndex, YearIndex],
|
||||||
|
"4y-dca-returns": [DateIndex, DecadeIndex, MonthIndex, QuarterIndex, WeekIndex, YearIndex],
|
||||||
|
"4y-dca-stack": [DateIndex, DecadeIndex, MonthIndex, QuarterIndex, WeekIndex, YearIndex],
|
||||||
|
"4y-returns": [DateIndex, DecadeIndex, MonthIndex, QuarterIndex, WeekIndex, YearIndex],
|
||||||
"4y-sma": [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": [DateIndex, DecadeIndex, MonthIndex, QuarterIndex, WeekIndex, YearIndex],
|
||||||
"4y-sma-ratio-1m-sma": [DateIndex, DecadeIndex, MonthIndex, QuarterIndex, WeekIndex, YearIndex],
|
"4y-sma-ratio-1m-sma": [DateIndex, DecadeIndex, MonthIndex, QuarterIndex, WeekIndex, YearIndex],
|
||||||
@@ -408,6 +449,22 @@ export function createVecIdToIndexes() {
|
|||||||
"55d-sma-ratio-p99-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-sma": [DateIndex, DecadeIndex, MonthIndex, QuarterIndex, WeekIndex, YearIndex],
|
||||||
"55d-sma-ratio-standard-deviation": [DateIndex, DecadeIndex, MonthIndex, QuarterIndex, WeekIndex, YearIndex],
|
"55d-sma-ratio-standard-deviation": [DateIndex, DecadeIndex, MonthIndex, QuarterIndex, WeekIndex, YearIndex],
|
||||||
|
"5y-cagr": [DateIndex, DecadeIndex, MonthIndex, QuarterIndex, WeekIndex, YearIndex],
|
||||||
|
"5y-dca-avg-price": [DateIndex, DecadeIndex, MonthIndex, QuarterIndex, WeekIndex, YearIndex],
|
||||||
|
"5y-dca-cagr": [DateIndex, DecadeIndex, MonthIndex, QuarterIndex, WeekIndex, YearIndex],
|
||||||
|
"5y-dca-returns": [DateIndex, DecadeIndex, MonthIndex, QuarterIndex, WeekIndex, YearIndex],
|
||||||
|
"5y-dca-stack": [DateIndex, DecadeIndex, MonthIndex, QuarterIndex, WeekIndex, YearIndex],
|
||||||
|
"5y-returns": [DateIndex, DecadeIndex, MonthIndex, QuarterIndex, WeekIndex, YearIndex],
|
||||||
|
"6m-dca-avg-price": [DateIndex, DecadeIndex, MonthIndex, QuarterIndex, WeekIndex, YearIndex],
|
||||||
|
"6m-dca-returns": [DateIndex, DecadeIndex, MonthIndex, QuarterIndex, WeekIndex, YearIndex],
|
||||||
|
"6m-dca-stack": [DateIndex, DecadeIndex, MonthIndex, QuarterIndex, WeekIndex, YearIndex],
|
||||||
|
"6m-returns": [DateIndex, DecadeIndex, MonthIndex, QuarterIndex, WeekIndex, YearIndex],
|
||||||
|
"6y-cagr": [DateIndex, DecadeIndex, MonthIndex, QuarterIndex, WeekIndex, YearIndex],
|
||||||
|
"6y-dca-avg-price": [DateIndex, DecadeIndex, MonthIndex, QuarterIndex, WeekIndex, YearIndex],
|
||||||
|
"6y-dca-cagr": [DateIndex, DecadeIndex, MonthIndex, QuarterIndex, WeekIndex, YearIndex],
|
||||||
|
"6y-dca-returns": [DateIndex, DecadeIndex, MonthIndex, QuarterIndex, WeekIndex, YearIndex],
|
||||||
|
"6y-dca-stack": [DateIndex, DecadeIndex, MonthIndex, QuarterIndex, WeekIndex, YearIndex],
|
||||||
|
"6y-returns": [DateIndex, DecadeIndex, MonthIndex, QuarterIndex, WeekIndex, YearIndex],
|
||||||
"89d-sma": [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": [DateIndex, DecadeIndex, MonthIndex, QuarterIndex, WeekIndex, YearIndex],
|
||||||
"89d-sma-ratio-1m-sma": [DateIndex, DecadeIndex, MonthIndex, QuarterIndex, WeekIndex, YearIndex],
|
"89d-sma-ratio-1m-sma": [DateIndex, DecadeIndex, MonthIndex, QuarterIndex, WeekIndex, YearIndex],
|
||||||
@@ -472,6 +529,12 @@ export function createVecIdToIndexes() {
|
|||||||
"8d-sma-ratio-p99-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-sma": [DateIndex, DecadeIndex, MonthIndex, QuarterIndex, WeekIndex, YearIndex],
|
||||||
"8d-sma-ratio-standard-deviation": [DateIndex, DecadeIndex, MonthIndex, QuarterIndex, WeekIndex, YearIndex],
|
"8d-sma-ratio-standard-deviation": [DateIndex, DecadeIndex, MonthIndex, QuarterIndex, WeekIndex, YearIndex],
|
||||||
|
"8y-cagr": [DateIndex, DecadeIndex, MonthIndex, QuarterIndex, WeekIndex, YearIndex],
|
||||||
|
"8y-dca-avg-price": [DateIndex, DecadeIndex, MonthIndex, QuarterIndex, WeekIndex, YearIndex],
|
||||||
|
"8y-dca-cagr": [DateIndex, DecadeIndex, MonthIndex, QuarterIndex, WeekIndex, YearIndex],
|
||||||
|
"8y-dca-returns": [DateIndex, DecadeIndex, MonthIndex, QuarterIndex, WeekIndex, YearIndex],
|
||||||
|
"8y-dca-stack": [DateIndex, DecadeIndex, MonthIndex, QuarterIndex, WeekIndex, YearIndex],
|
||||||
|
"8y-returns": [DateIndex, DecadeIndex, MonthIndex, QuarterIndex, WeekIndex, YearIndex],
|
||||||
ath: [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],
|
||||||
@@ -764,6 +827,19 @@ export function createVecIdToIndexes() {
|
|||||||
"p2wsh-count-sum": [DateIndex, DecadeIndex, DifficultyEpoch, MonthIndex, QuarterIndex, WeekIndex, YearIndex],
|
"p2wsh-count-sum": [DateIndex, DecadeIndex, DifficultyEpoch, MonthIndex, QuarterIndex, WeekIndex, YearIndex],
|
||||||
p2wshbytes: [P2WSHIndex],
|
p2wshbytes: [P2WSHIndex],
|
||||||
p2wshindex: [P2WSHIndex],
|
p2wshindex: [P2WSHIndex],
|
||||||
|
"price-10y-ago": [DateIndex, DecadeIndex, MonthIndex, QuarterIndex, WeekIndex, YearIndex],
|
||||||
|
"price-1d-ago": [DateIndex, DecadeIndex, MonthIndex, QuarterIndex, WeekIndex, YearIndex],
|
||||||
|
"price-1m-ago": [DateIndex, DecadeIndex, MonthIndex, QuarterIndex, WeekIndex, YearIndex],
|
||||||
|
"price-1w-ago": [DateIndex, DecadeIndex, MonthIndex, QuarterIndex, WeekIndex, YearIndex],
|
||||||
|
"price-1y-ago": [DateIndex, DecadeIndex, MonthIndex, QuarterIndex, WeekIndex, YearIndex],
|
||||||
|
"price-2y-ago": [DateIndex, DecadeIndex, MonthIndex, QuarterIndex, WeekIndex, YearIndex],
|
||||||
|
"price-3m-ago": [DateIndex, DecadeIndex, MonthIndex, QuarterIndex, WeekIndex, YearIndex],
|
||||||
|
"price-3y-ago": [DateIndex, DecadeIndex, MonthIndex, QuarterIndex, WeekIndex, YearIndex],
|
||||||
|
"price-4y-ago": [DateIndex, DecadeIndex, MonthIndex, QuarterIndex, WeekIndex, YearIndex],
|
||||||
|
"price-5y-ago": [DateIndex, DecadeIndex, MonthIndex, QuarterIndex, WeekIndex, YearIndex],
|
||||||
|
"price-6m-ago": [DateIndex, DecadeIndex, MonthIndex, QuarterIndex, WeekIndex, YearIndex],
|
||||||
|
"price-6y-ago": [DateIndex, DecadeIndex, MonthIndex, QuarterIndex, WeekIndex, YearIndex],
|
||||||
|
"price-8y-ago": [DateIndex, DecadeIndex, MonthIndex, QuarterIndex, WeekIndex, YearIndex],
|
||||||
quarterindex: [MonthIndex, QuarterIndex],
|
quarterindex: [MonthIndex, QuarterIndex],
|
||||||
rawlocktime: [TxIndex],
|
rawlocktime: [TxIndex],
|
||||||
subsidy: [Height],
|
subsidy: [Height],
|
||||||
|
|||||||
Reference in New Issue
Block a user