Skip to content

Commit

Permalink
marubozu
Browse files Browse the repository at this point in the history
  • Loading branch information
m5l14i11 committed Jul 27, 2023
1 parent 67ae7e7 commit 7d2ac38
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions ta_lib/patterns/src/marubozu.rs
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,8 @@ pub fn bullish(open: &[f64], high: &[f64], low: &[f64], close: &[f64]) -> Vec<bo

(close.shift(1).gt_series(&open.shift(1))
& high.shift(1).eq_series(&close.shift(1))
& low.shift(1).eq_series(&open.shift(1))).into()
& low.shift(1).eq_series(&open.shift(1)))
.into()
}

pub fn bearish(open: &[f64], high: &[f64], low: &[f64], close: &[f64]) -> Vec<bool> {
Expand All @@ -19,7 +20,8 @@ pub fn bearish(open: &[f64], high: &[f64], low: &[f64], close: &[f64]) -> Vec<bo

(close.shift(1).lt_series(&open.shift(1))
& high.shift(1).eq_series(&open.shift(1))
& low.shift(1).eq_series(&close.shift(1))).into()
& low.shift(1).eq_series(&close.shift(1)))
.into()
}

#[cfg(test)]
Expand Down

0 comments on commit 7d2ac38

Please sign in to comment.