mirror of
https://github.com/bitcoinresearchkit/brk.git
synced 2026-07-21 16:08:10 -07:00
global: snapshot
This commit is contained in:
@@ -14,7 +14,7 @@ impl Vecs {
|
||||
) -> Result<()> {
|
||||
self.price_ath.usd.height.compute_all_time_high(
|
||||
starting_indexes.height,
|
||||
&prices.price.usd,
|
||||
&prices.price.usd.height,
|
||||
exit,
|
||||
)?;
|
||||
|
||||
@@ -22,7 +22,7 @@ impl Vecs {
|
||||
self.days_since_price_ath.height.compute_transform2(
|
||||
starting_indexes.height,
|
||||
&self.price_ath.usd.height,
|
||||
&prices.price.usd,
|
||||
&prices.price.usd.height,
|
||||
|(i, ath, price, slf)| {
|
||||
if prev.is_none() {
|
||||
let i = i.to_usize();
|
||||
|
||||
@@ -97,7 +97,7 @@ impl Vecs {
|
||||
{
|
||||
returns.compute_binary::<Dollars, Dollars, PercentageDiffDollars>(
|
||||
starting_indexes.height,
|
||||
&prices.price.usd,
|
||||
&prices.price.usd.height,
|
||||
&average_price.usd.height,
|
||||
exit,
|
||||
)?;
|
||||
@@ -165,7 +165,7 @@ impl Vecs {
|
||||
{
|
||||
returns.compute_binary::<Dollars, Dollars, PercentageDiffDollars>(
|
||||
starting_indexes.height,
|
||||
&prices.price.usd,
|
||||
&prices.price.usd.height,
|
||||
&lookback_price.usd.height,
|
||||
exit,
|
||||
)?;
|
||||
@@ -268,7 +268,7 @@ impl Vecs {
|
||||
|
||||
returns.compute_binary::<Dollars, Dollars, PercentageDiffDollars>(
|
||||
starting_indexes.height,
|
||||
&prices.price.usd,
|
||||
&prices.price.usd.height,
|
||||
&average_price.usd.height,
|
||||
exit,
|
||||
)?;
|
||||
|
||||
@@ -34,7 +34,7 @@ impl Vecs {
|
||||
|
||||
// Stochastic Oscillator: K = (close - low_2w) / (high_2w - low_2w) * 100
|
||||
{
|
||||
let price = &prices.price.usd;
|
||||
let price = &prices.price.usd.height;
|
||||
self.stoch_k.height.compute_transform3(
|
||||
starting_indexes.height,
|
||||
price,
|
||||
|
||||
@@ -15,7 +15,7 @@ pub(super) fn compute(
|
||||
starting_indexes: &ComputeIndexes,
|
||||
exit: &Exit,
|
||||
) -> Result<()> {
|
||||
let source_version = prices.price.usd.version();
|
||||
let source_version = prices.price.usd.height.version();
|
||||
|
||||
chain
|
||||
.line
|
||||
|
||||
@@ -13,7 +13,7 @@ impl Vecs {
|
||||
starting_indexes: &ComputeIndexes,
|
||||
exit: &Exit,
|
||||
) -> Result<()> {
|
||||
let close_data: Vec<Dollars> = prices.price.usd.collect();
|
||||
let close_data: Vec<Dollars> = prices.price.usd.height.collect();
|
||||
|
||||
for (price_ago, days) in self.price_ago.iter_mut_with_days() {
|
||||
let window_starts = blocks.count.start_vec(days as usize);
|
||||
|
||||
@@ -14,7 +14,7 @@ impl Vecs {
|
||||
starting_indexes: &ComputeIndexes,
|
||||
exit: &Exit,
|
||||
) -> Result<()> {
|
||||
let close = &prices.price.usd;
|
||||
let close = &prices.price.usd.height;
|
||||
|
||||
for (sma, period) in [
|
||||
(&mut self.price_1w_sma, 7),
|
||||
|
||||
@@ -16,7 +16,7 @@ impl Vecs {
|
||||
starting_indexes: &ComputeIndexes,
|
||||
exit: &Exit,
|
||||
) -> Result<()> {
|
||||
let price = &prices.price.usd;
|
||||
let price = &prices.price.usd.height;
|
||||
|
||||
self.price_1w_min.usd.height.compute_rolling_min_from_starts(
|
||||
starting_indexes.height,
|
||||
|
||||
@@ -23,7 +23,7 @@ impl Vecs {
|
||||
{
|
||||
returns.compute_binary::<Dollars, Dollars, PercentageDiffDollars>(
|
||||
starting_indexes.height,
|
||||
&prices.price.usd,
|
||||
&prices.price.usd.height,
|
||||
&lookback_price.usd.height,
|
||||
exit,
|
||||
)?;
|
||||
|
||||
Reference in New Issue
Block a user