Skip to main content

RithmicAdvancedBracketOrder

Struct RithmicAdvancedBracketOrder 

Source
#[non_exhaustive]
pub struct RithmicAdvancedBracketOrder {
Show 31 fields pub action: TransactionType, pub duration: Duration, pub exchange: String, pub localid: String, pub price_type: PriceType, pub price: Option<f64>, pub trigger_price: Option<f64>, pub quantity: i32, pub symbol: String, pub bracket_type: BracketType, pub target_quantity: Vec<i32>, pub target_ticks: Vec<i32>, pub stop_quantity: Vec<i32>, pub stop_ticks: Vec<i32>, pub if_touched: Option<RithmicIfTouchedTrigger>, pub break_even_ticks: Option<i32>, pub break_even_trigger_ticks: Option<i32>, pub trailing_stop_trigger_ticks: Option<i32>, pub trailing_stop_by_last_trade_price: Option<bool>, pub target_market_order_if_touched: Option<bool>, pub stop_market_on_reject: Option<bool>, pub target_market_at_ssboe: Option<i32>, pub target_market_at_usecs: Option<i32>, pub stop_market_at_ssboe: Option<i32>, pub stop_market_at_usecs: Option<i32>, pub target_market_order_after_secs: Option<i32>, pub release_at_ssboe: Option<i32>, pub release_at_usecs: Option<i32>, pub cancel_at_ssboe: Option<i32>, pub cancel_at_usecs: Option<i32>, pub cancel_after_secs: Option<i32>,
}
Expand description

Richer bracket order request that maps directly to RequestBracketOrder.

This type exposes the full raw venue-native request surface currently available through the protobuf schema, including triggered entry, break-even, trailing-stop, timed release/cancel fields, and if-touched entry conditions.

Callers are responsible for providing a coherent combination of bracket_type, target_*, and stop_* fields for the shape they want Rithmic to create.

§Example

use rithmic_rs::{
    BracketCondition, BracketDuration, BracketPriceField, BracketPriceType,
    BracketTransactionType, BracketType, RithmicAdvancedBracketOrder,
    RithmicIfTouchedTrigger,
};

let order = RithmicAdvancedBracketOrder {
    action: BracketTransactionType::Buy,
    duration: BracketDuration::Gtc,
    exchange: "CME".to_string(),
    localid: "advanced-bracket-1".to_string(),
    price_type: BracketPriceType::StopLimit,
    price: Some(5000.25),
    trigger_price: Some(4999.75),
    quantity: 3,
    symbol: "ESM6".to_string(),
    bracket_type: BracketType::TargetAndStop,
    target_quantity: vec![2, 1],
    target_ticks: vec![16, 24],
    stop_quantity: vec![3],
    stop_ticks: vec![8],
    if_touched: Some(RithmicIfTouchedTrigger {
        symbol: "NQM6".to_string(),
        exchange: "CME".to_string(),
        condition: BracketCondition::GreaterThanEqualTo,
        price_field: BracketPriceField::TradePrice,
        price: 18250.5,
    }),
    break_even_ticks: Some(2),
    break_even_trigger_ticks: Some(10),
    trailing_stop_trigger_ticks: Some(12),
    target_market_order_if_touched: Some(true),
    stop_market_on_reject: Some(true),
    release_at_ssboe: Some(35900),
    cancel_after_secs: Some(120),
    ..Default::default()
};

Fields (Non-exhaustive)§

This struct is marked as non-exhaustive
Non-exhaustive structs could have additional fields added in future. Therefore, non-exhaustive structs cannot be constructed in external crates using the traditional Struct { .. } syntax; cannot be matched against without a wildcard ..; and struct update syntax will not work.
§action: TransactionType

Buy or Sell.

§duration: Duration

Order duration.

§exchange: String

Exchange code (e.g., “CME”).

§localid: String

Your identifier for tracking this order.

§price_type: PriceType

Order type.

§price: Option<f64>

Entry price when required by the price type.

§trigger_price: Option<f64>

Trigger price for stop and if-touched entry types.

§quantity: i32

Entry order size (number of contracts).

For a coherent bracket, this should equal the sum of target_quantity across all target legs. The crate does not validate this invariant; Rithmic rejects inconsistent combinations.

§symbol: String

Trading symbol (e.g., “ESH6”).

§bracket_type: BracketType

Rithmic bracket shape.

§target_quantity: Vec<i32>

Exit target quantities, one value per target leg.

§target_ticks: Vec<i32>

Exit target distances in ticks.

§stop_quantity: Vec<i32>

Exit stop quantities.

§stop_ticks: Vec<i32>

Exit stop distances in ticks.

§if_touched: Option<RithmicIfTouchedTrigger>

Optional if-touched trigger settings.

§break_even_ticks: Option<i32>

Move stop to break-even by this many ticks.

§break_even_trigger_ticks: Option<i32>

Trigger break-even once the position reaches this many ticks.

§trailing_stop_trigger_ticks: Option<i32>

Enable a trailing stop after this many ticks.

§trailing_stop_by_last_trade_price: Option<bool>

Use last trade instead of bid/offer for trailing stop tracking.

§target_market_order_if_touched: Option<bool>

Convert target to MIT once touched.

§stop_market_on_reject: Option<bool>

Convert stop to market if the current stop order is rejected.

§target_market_at_ssboe: Option<i32>

Convert target to market at this second-since-beginning-of-epoch value.

§target_market_at_usecs: Option<i32>

Microsecond component for target_market_at_ssboe.

§stop_market_at_ssboe: Option<i32>

Convert stop to market at this second-since-beginning-of-epoch value.

§stop_market_at_usecs: Option<i32>

Microsecond component for stop_market_at_ssboe.

§target_market_order_after_secs: Option<i32>

Convert target to market after this many seconds.

§release_at_ssboe: Option<i32>

Release order at this second-since-beginning-of-epoch value.

§release_at_usecs: Option<i32>

Microsecond component for release_at_ssboe.

§cancel_at_ssboe: Option<i32>

Cancel order at this second-since-beginning-of-epoch value.

§cancel_at_usecs: Option<i32>

Microsecond component for cancel_at_ssboe.

§cancel_after_secs: Option<i32>

Cancel order after this many seconds.

Trait Implementations§

Source§

impl Clone for RithmicAdvancedBracketOrder

Source§

fn clone(&self) -> RithmicAdvancedBracketOrder

Returns a duplicate of the value. Read more
1.0.0 · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for RithmicAdvancedBracketOrder

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Default for RithmicAdvancedBracketOrder

Source§

fn default() -> Self

Returns the “default value” for a type. Read more
Source§

impl From<RithmicBracketOrder> for RithmicAdvancedBracketOrder

Source§

fn from(value: RithmicBracketOrder) -> Self

Converts to this type from the input type.

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T> Instrument for T

Source§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
Source§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

Source§

fn vzip(self) -> V

Source§

impl<T> WithSubscriber for T

Source§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more