pub struct KlingerVolumeForceEngine { /* private fields */ }Expand description
Klinger Volume Oscillator (KVO) over the volume force.
Per bar, with dm = high - low:
trend = +1 if high + low + close rose against the previous bar, -1 if it fell,
the previous trend if unchanged, +1 on the first bar
cm = dm on the first bar; cm + dm while the trend holds; prev_dm + dm when it flips
vf = volume * |2 * dm / cm - 1| * trend * 100 (the ratio is 0 for cm ~ 0)
KVO = Ema(fast_len)(vf) - Ema(slow_len)(vf)Both averages are the shared Ema with its first-sample seed and run from the first bar;
the line is published from the slow_len-th bar on. extra["signal"] is an
Ema(signal_len) over the published KVO values, seeded with the first of them;
extra["hist"] is KVO - signal and extra["volume_force"] this bar’s vf. Defaults
34/55/13.
First output: with the slow_len-th bar. Indicator::reset clears all state.
Implementations§
Trait Implementations§
Source§impl Clone for KlingerVolumeForceEngine
impl Clone for KlingerVolumeForceEngine
Source§fn clone(&self) -> KlingerVolumeForceEngine
fn clone(&self) -> KlingerVolumeForceEngine
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for KlingerVolumeForceEngine
impl Debug for KlingerVolumeForceEngine
Source§impl Indicator for KlingerVolumeForceEngine
impl Indicator for KlingerVolumeForceEngine
fn name(&self) -> &str
fn warmup_period(&self) -> usize
fn reset(&mut self)
fn on_bar(&mut self, bar: &Bar) -> Option<IndicatorOutput>
fn alerts(&self) -> Vec<IndicatorAlert>
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>
Validates a bar before forwarding it to
Indicator::on_bar.Auto Trait Implementations§
impl Freeze for KlingerVolumeForceEngine
impl RefUnwindSafe for KlingerVolumeForceEngine
impl Send for KlingerVolumeForceEngine
impl Sync for KlingerVolumeForceEngine
impl Unpin for KlingerVolumeForceEngine
impl UnsafeUnpin for KlingerVolumeForceEngine
impl UnwindSafe for KlingerVolumeForceEngine
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more