Skip to content

Commit

Permalink
upd
Browse files Browse the repository at this point in the history
  • Loading branch information
m5l14i11 committed Apr 12, 2024
1 parent 909886a commit f61e184
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 17 deletions.
6 changes: 1 addition & 5 deletions ta_lib/strategies/signal/src/ao_flip.rs
Original file line number Diff line number Diff line change
Expand Up @@ -23,11 +23,7 @@ impl Signal for AOFlipSignal {

fn generate(&self, data: &OHLCVSeries) -> (Series<bool>, Series<bool>) {
let ao = ao(&data.hl2(), self.fast_period, self.slow_period);
let prev_ao = ao.shift(2);

(
ao.cross_over(&ZERO_LINE) & prev_ao.slt(&ZERO_LINE),
ao.cross_under(&ZERO_LINE) & prev_ao.sgt(&ZERO_LINE),
)
(ao.cross_over(&ZERO_LINE), ao.cross_under(&ZERO_LINE))
}
}
7 changes: 1 addition & 6 deletions ta_lib/strategies/signal/src/ce_flip.rs
Original file line number Diff line number Diff line change
Expand Up @@ -33,11 +33,6 @@ impl Signal for CEFlipSignal {
self.factor,
);

let prev_direction = direction.shift(1);

(
direction.seq(&ONE) & prev_direction.seq(&MINUS_ONE),
direction.seq(&MINUS_ONE) & prev_direction.seq(&ONE),
)
(direction.cross_under(&ZERO), direction.cross_over(&ZERO))
}
}
7 changes: 1 addition & 6 deletions ta_lib/strategies/signal/src/supertrend_flip.rs
Original file line number Diff line number Diff line change
Expand Up @@ -29,11 +29,6 @@ impl Signal for SupertrendFlipSignal {
self.factor,
);

let prev_direction = direction.shift(1);

(
direction.seq(&ONE) & prev_direction.seq(&MINUS_ONE),
direction.seq(&MINUS_ONE) & prev_direction.seq(&ONE),
)
(direction.cross_under(&ZERO), direction.cross_over(&ZERO))
}
}

0 comments on commit f61e184

Please sign in to comment.