cks

Function cks 

Source
pub fn cks<'a, T: ToPrimitive>(
    high: &'a [T],
    low: &'a [T],
    close: &'a [T],
    win1: usize,
    win2: usize,
    multiplier: Option<f64>,
) -> impl Iterator<Item = (f64, f64)> + 'a
Expand description

Chande Kroll Stop

Calculated using a combination of the highest high and lowest low prices over a specific lookback period and the instrument’s ATR. Produces two stop-loss levels.

§Usage

Buy signal when price crosses above the long and short lines.

§Sources

[1]

§Examples

use traquer::trend;

trend::cks(
    &[1.0,2.0,3.0,4.0,5.0,6.0,4.0,5.0],
    &[1.0,2.0,3.0,4.0,5.0,6.0,4.0,5.0],
    &[1.0,2.0,3.0,4.0,5.0,6.0,4.0,5.0],
    5, 3, Some(1.0)).collect::<Vec<(f64, f64)>>();