pub enum EnsembleMode {
Unanimous,
WeightedMajority,
AnySignal,
StrongestSignal,
}Expand description
Voting mode that determines how sub-strategy signals are combined.
Variants§
Unanimous
All active sub-strategies must agree on the same direction (“no-dissent” semantics).
Strategies that return Hold abstain from the vote and do not block a consensus.
If any two active strategies disagree, the ensemble returns Hold.
The resulting signal strength is the average of all active strengths.
Note: if you require all strategies (including abstainers) to explicitly
vote for the same direction, check active_count == strategies.len() yourself
and wrap this in a custom Strategy impl.
WeightedMajority
Conviction-weighted vote: each vote is weight × signal_strength.
All five directions (Long, Short, Exit, ScaleIn, ScaleOut) are
tallied independently; the highest score wins.
Strength denominator: the output signal_strength is
winner_score / Σ(all_weights), not winner_score / Σ(active_scores).
Dividing by total potential prevents a lone weak voter from being
artificially amplified when the majority of sub-strategies abstain.
Scale fraction: when ScaleIn or ScaleOut wins, the emitted
scale_fraction is the conviction-weighted average of all same-direction
voters’ fractions, not the single highest-score contributor’s fraction.
Position guard: Exit, ScaleIn, and ScaleOut are only tallied
when a position is currently open. While flat they are discarded so they
cannot suppress entry signal strength. Their weights still count toward
the total-potential denominator.
Note on vote splitting: Exit and Short are counted as independent
factions — if their combined intent would dominate but each falls below
Long individually, the ensemble may maintain a long position despite the
majority wanting to exit. Document your ensemble weights accordingly.
AnySignal
First non-Hold signal wins (strategies are evaluated in insertion order).
Note: this gives a permanent priority advantage to strategies added
first via add. Use StrongestSignal
if you want insertion-order independence.
StrongestSignal
The non-Hold signal with the highest signal_strength value wins.
Trait Implementations§
Source§impl Clone for EnsembleMode
impl Clone for EnsembleMode
Source§fn clone(&self) -> EnsembleMode
fn clone(&self) -> EnsembleMode
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for EnsembleMode
impl Debug for EnsembleMode
Source§impl Default for EnsembleMode
impl Default for EnsembleMode
Source§fn default() -> EnsembleMode
fn default() -> EnsembleMode
Source§impl PartialEq for EnsembleMode
impl PartialEq for EnsembleMode
impl Copy for EnsembleMode
impl Eq for EnsembleMode
impl StructuralPartialEq for EnsembleMode
Auto Trait Implementations§
impl Freeze for EnsembleMode
impl RefUnwindSafe for EnsembleMode
impl Send for EnsembleMode
impl Sync for EnsembleMode
impl Unpin for EnsembleMode
impl UnsafeUnpin for EnsembleMode
impl UnwindSafe for EnsembleMode
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key and return true if they are equal.Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more