most
MOST, a moving stop: a trailing stop whose distance is a percent of the level on the EMA of the close
most
examples/site_showcase.rs// MOST, a moving stop: a trailing stop whose distance is a percent of the level on the EMA of the close (extras `ema`, `direction`). The direction starts undecided instead of up and nothing is published until it is decided. The distances are a percent of the level, so prices scaled by a factor scale the line by it.
// Defaults of "most" (see the indicator reference)
let params = HashMap::from([
("length".to_string(), 3.0),
("percent".to_string(), 2.0),
]);
let mut indicator = build_checked("most", ¶ms)?;
for bar in &bars {
if let Some(output) = indicator.on_bar(bar) {
// output.value, output.extra[...], indicator.alerts()
}
}