pub struct ConditionBuilder<C: Condition> { /* private fields */ }Expand description
Builder for creating complex multi-condition combinations.
§Example
ⓘ
use finance_query::backtesting::condition::*;
use finance_query::backtesting::refs::*;
let conditions = ConditionBuilder::new()
.with_condition(rsi(14).below(30.0))
.with_condition(price().above_ref(sma(200)))
.with_condition(adx(14).above(25.0))
.all(); // All conditions must be true
// Or use any() for OR logic
let exit = ConditionBuilder::new()
.with_condition(rsi(14).above(70.0))
.with_condition(stop_loss(0.05))
.any(); // Any condition can be trueImplementations§
Source§impl<C: Condition> ConditionBuilder<C>
impl<C: Condition> ConditionBuilder<C>
Sourcepub fn with_condition(self, condition: C) -> Self
pub fn with_condition(self, condition: C) -> Self
Add a condition to the builder.
Trait Implementations§
Source§impl<C: Clone + Condition> Clone for ConditionBuilder<C>
impl<C: Clone + Condition> Clone for ConditionBuilder<C>
Source§fn clone(&self) -> ConditionBuilder<C>
fn clone(&self) -> ConditionBuilder<C>
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreAuto Trait Implementations§
impl<C> Freeze for ConditionBuilder<C>
impl<C> RefUnwindSafe for ConditionBuilder<C>where
C: RefUnwindSafe,
impl<C> Send for ConditionBuilder<C>
impl<C> Sync for ConditionBuilder<C>
impl<C> Unpin for ConditionBuilder<C>where
C: Unpin,
impl<C> UnsafeUnpin for ConditionBuilder<C>
impl<C> UnwindSafe for ConditionBuilder<C>where
C: UnwindSafe,
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
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> ⓘ
Converts
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> ⓘ
Converts
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