trendlines
Trendlines through confirmed zigzag_advanced nodes: a support line through the lows and a resistance line t…
trendlines
examples/site_showcase.rs// Trendlines through confirmed zigzag_advanced nodes: a support line through the lows and a resistance line through the highs (oldest anchor no node in between pierces by more than tolerance_atr ATR, newest node), each with its channel parallel, node and bar touches and its break on a close beyond it; value = lines in the output; extra: atr, tolerance, support_*/resistance_* (value, start_price, start_bars_back, end_price, end_bars_back, nodes, node_touches, touches, touch, formed, break, channel_value, channel_width); alerts bear_support_line_break, bull_resistance_line_break
// Defaults of "trendlines" (see the indicator reference)
let params = HashMap::from([
("atr_len".to_string(), 14.0),
("backstep".to_string(), 2.0),
("depth".to_string(), 3.0),
("deviation_mode".to_string(), 0.0),
("deviation_pct".to_string(), 1.0),
("tolerance_atr".to_string(), 0.25),
]);
let mut indicator = build_checked("trendlines", ¶ms)?;
for bar in &bars {
if let Some(output) = indicator.on_bar(bar) {
// output.value, output.extra[...], indicator.alerts()
}
}