Skip to content

Commit

Permalink
fix: ChandeKrollStop #2 signal
Browse files Browse the repository at this point in the history
  • Loading branch information
amv-dev committed Jun 4, 2021
1 parent 682206c commit ac68a81
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions src/indicators/chande_kroll_stop.rs
Original file line number Diff line number Diff line change
Expand Up @@ -187,6 +187,9 @@ impl IndicatorInstance for ChandeKrollStopInstance {
let cross: i8 = self.cross_above.next((stop_long, stop_short)).into(); // also s2 should appear only when `STOP LONG` actually crossing `STOP SHORT` upwards
let s2 = cross * is_s2 * signi(s2_diff);

self.prev_stop_short = stop_short;
self.prev_stop_long = stop_long;

IndicatorResult::new(
&[stop_long, src, stop_short],
&[Action::from(value), Action::from(s2)],
Expand Down

0 comments on commit ac68a81

Please sign in to comment.