pub struct PctVolTimeBuilder { /* private fields */ }Expand description
Builder for Time Variant Percentage of Volume (PctVolTm) algorithmic orders.
Participation rate varies linearly from start_pct_vol to end_pct_vol
over the active time window.
§Example
use ibapi::orders::builder::pct_vol_time;
let algo = pct_vol_time()
.start_pct_vol(0.1)
.end_pct_vol(0.4)
.start_time("09:30:00 US/Eastern")
.end_time("16:00:00 US/Eastern")
.build()?;Implementations§
Source§impl PctVolTimeBuilder
impl PctVolTimeBuilder
Sourcepub fn start_pct_vol(self, pct: f64) -> Self
pub fn start_pct_vol(self, pct: f64) -> Self
Set the participation rate at the start (must be 10-50%).
Sourcepub fn end_pct_vol(self, pct: f64) -> Self
pub fn end_pct_vol(self, pct: f64) -> Self
Set the participation rate at the end (must be 10-50%).
Sourcepub fn start_time(self, time: impl Into<String>) -> Self
pub fn start_time(self, time: impl Into<String>) -> Self
Set start time (format: “HH:MM:SS TZ”, e.g., “09:30:00 US/Eastern”).
Sourcepub fn end_time(self, time: impl Into<String>) -> Self
pub fn end_time(self, time: impl Into<String>) -> Self
Set end time (format: “HH:MM:SS TZ”, e.g., “16:00:00 US/Eastern”).
Sourcepub fn no_take_liq(self, no_take: bool) -> Self
pub fn no_take_liq(self, no_take: bool) -> Self
Passive only - do not take liquidity.
Sourcepub fn build(self) -> Result<AlgoParams, ValidationError>
pub fn build(self) -> Result<AlgoParams, ValidationError>
Build the algo parameters.
Returns an error if start_pct_vol or end_pct_vol is set but
outside the 10-50% range.
Trait Implementations§
Source§impl Clone for PctVolTimeBuilder
impl Clone for PctVolTimeBuilder
Source§fn clone(&self) -> PctVolTimeBuilder
fn clone(&self) -> PctVolTimeBuilder
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 PctVolTimeBuilder
impl Debug for PctVolTimeBuilder
Source§impl Default for PctVolTimeBuilder
impl Default for PctVolTimeBuilder
Source§fn default() -> PctVolTimeBuilder
fn default() -> PctVolTimeBuilder
Returns the “default value” for a type. Read more
Auto Trait Implementations§
impl Freeze for PctVolTimeBuilder
impl RefUnwindSafe for PctVolTimeBuilder
impl Send for PctVolTimeBuilder
impl Sync for PctVolTimeBuilder
impl Unpin for PctVolTimeBuilder
impl UnsafeUnpin for PctVolTimeBuilder
impl UnwindSafe for PctVolTimeBuilder
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