pub struct ExportOpenDeviationBarProcessor { /* private fields */ }Expand description
Export-oriented open deviation bar processor for streaming use cases
This implementation uses the proven fixed-point arithmetic algorithm that achieves 100% breach consistency compliance in multi-year processing.
Implementations§
Source§impl ExportOpenDeviationBarProcessor
impl ExportOpenDeviationBarProcessor
Sourcepub fn new(
threshold_decimal_bps: u32,
) -> Result<ExportOpenDeviationBarProcessor, ProcessingError>
pub fn new( threshold_decimal_bps: u32, ) -> Result<ExportOpenDeviationBarProcessor, ProcessingError>
Create new export processor with given threshold
Uses default behavior: prevent_same_timestamp_close = true (Issue #36)
§Arguments
threshold_decimal_bps- Threshold in decimal basis points- Example:
250-> 25bps = 0.25% - Example:
10-> 1bps = 0.01% - Minimum:
1-> 0.1bps = 0.001%
- Example:
§Breaking Change (v3.0.0)
Prior to v3.0.0, threshold_decimal_bps was in 1bps units.
Migration: Multiply all threshold values by 10.
Sourcepub fn with_options(
threshold_decimal_bps: u32,
prevent_same_timestamp_close: bool,
) -> Result<ExportOpenDeviationBarProcessor, ProcessingError>
pub fn with_options( threshold_decimal_bps: u32, prevent_same_timestamp_close: bool, ) -> Result<ExportOpenDeviationBarProcessor, ProcessingError>
Create new export processor with explicit timestamp gating control
Sourcepub fn process_trades_continuously(&mut self, trades: &[AggTrade])
pub fn process_trades_continuously(&mut self, trades: &[AggTrade])
Process trades continuously using proven fixed-point algorithm This method maintains 100% breach consistency by using precise integer arithmetic
Sourcepub fn get_all_completed_bars(&mut self) -> Vec<OpenDeviationBar>
pub fn get_all_completed_bars(&mut self) -> Vec<OpenDeviationBar>
Get all completed bars accumulated so far This drains the internal buffer to avoid memory leaks
Sourcepub fn get_incomplete_bar(&mut self) -> Option<OpenDeviationBar>
pub fn get_incomplete_bar(&mut self) -> Option<OpenDeviationBar>
Get incomplete bar if exists (for final bar processing)
Auto Trait Implementations§
impl Freeze for ExportOpenDeviationBarProcessor
impl RefUnwindSafe for ExportOpenDeviationBarProcessor
impl Send for ExportOpenDeviationBarProcessor
impl Sync for ExportOpenDeviationBarProcessor
impl Unpin for ExportOpenDeviationBarProcessor
impl UnsafeUnpin for ExportOpenDeviationBarProcessor
impl UnwindSafe for ExportOpenDeviationBarProcessor
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> 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