pub struct TrendQualityScoreEngine { /* private fields */ }Expand description
Trend Quality Score: a signed product of four trend factors, -100..=100.
All four inputs run on every bar with the same period:
direction:+1if the EMA(period) of the close (first-sample seeded, seeEmaEngine) rose against the previous bar’s,ema > prev; otherwise-1. A flat EMA counts as-1, and so does the first output, which has no previous value to compare with.efficiency: the Kaufman Efficiency Ratio overperiod(LegEfficiencyEngine),0..=1.strength:clamp(ADX / 50, 0, 1), the ADX fromAdx::with_period(period): Wilder DI and ADX smoothing both overperiod.participation:clamp(RVOL / 2, 0.2, 1)withRvolEngine(period).
value = clamp(direction · efficiency · strength · participation · 100, -100, 100), the four
factors in extra under their names. There is no separate persistence factor.
First output once all four inputs have one, which the ADX sets: with bar 2 · period.
Implementations§
Source§impl TrendQualityScoreEngine
impl TrendQualityScoreEngine
pub fn new(period: usize) -> Self
pub fn with_defaults() -> Self
Trait Implementations§
Source§impl Clone for TrendQualityScoreEngine
impl Clone for TrendQualityScoreEngine
Source§fn clone(&self) -> TrendQualityScoreEngine
fn clone(&self) -> TrendQualityScoreEngine
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 TrendQualityScoreEngine
impl Debug for TrendQualityScoreEngine
Source§impl Indicator for TrendQualityScoreEngine
impl Indicator for TrendQualityScoreEngine
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 TrendQualityScoreEngine
impl RefUnwindSafe for TrendQualityScoreEngine
impl Send for TrendQualityScoreEngine
impl Sync for TrendQualityScoreEngine
impl Unpin for TrendQualityScoreEngine
impl UnsafeUnpin for TrendQualityScoreEngine
impl UnwindSafe for TrendQualityScoreEngine
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