pub struct MidasCurveEngine { /* private fields */ }Expand description
MIDAS curve with a Topfinder or Bottomfinder projection.
curve = cum(price * volume) / cum(volume) since the first bar, price taken from source.
A new extreme is a high above the running one (Topfinder) or a low below it (Bottomfinder);
the first bar sets the first. From the first bar after the latest extreme on, the projection
is extreme - (extreme - curve_at_extreme) * sqrt(cum_volume_at_extreme / cum_volume); a new
extreme restarts it. After maturity_bars bars without a new extreme the state is exhausted.
value: the curve; secondary: the projection, or the curve while there is none;
extra["projection"] only while it exists; state: launch, projecting or exhausted.
First output: with the first bar that carries volume. Indicator::reset clears the
accumulation and the extreme.
Implementations§
Trait Implementations§
Source§impl Indicator for MidasCurveEngine
impl Indicator for MidasCurveEngine
fn name(&self) -> &str
fn reset(&mut self)
fn on_bar(&mut self, bar: &Bar) -> Option<IndicatorOutput>
fn alerts(&self) -> Vec<IndicatorAlert>
fn warmup_period(&self) -> usize
Source§fn on_checked_bar(
&mut self,
bar: &Bar,
) -> Result<Option<IndicatorOutput>, BarValidationError>
fn on_checked_bar( &mut self, bar: &Bar, ) -> Result<Option<IndicatorOutput>, BarValidationError>
Indicator::on_bar.