#[non_exhaustive]pub struct RithmicModifyOrder {
pub id: String,
pub exchange: String,
pub symbol: String,
pub quantity: i32,
pub price: Option<f64>,
pub price_type: OrderType,
pub trigger_price: Option<f64>,
pub manual_or_auto: ManualOrAutoEntry,
pub window_name: Option<String>,
pub trail_by_ticks: Option<i32>,
pub if_touched: Option<RithmicIfTouchedTrigger>,
}Expand description
Modify an existing order’s price, quantity, or type.
§Example
use rithmic_rs::{OrderType, RithmicModifyOrder};
// "123456" is the basket_id from the order notification.
let modification = RithmicModifyOrder::new()
.id("123456")
.symbol("ESH6")
.exchange("CME")
.quantity(2)
.price(5005.0)
.price_type(OrderType::Limit)
.build()?;Fields (Non-exhaustive)§
This struct is marked as non-exhaustive
Struct { .. } syntax; cannot be matched against without a wildcard ..; and struct update syntax will not work.id: StringThe basket_id from the order notification
exchange: StringExchange code
symbol: StringTrading symbol
quantity: i32New quantity
price: Option<f64>New price, omitted from the request when unset. A modify restates the order, so set this to the order’s current price when only the quantity is changing.
price_type: OrderTypeOrder type
trigger_price: Option<f64>Trigger price. Left unset, the four triggering price types — the stop and
if-touched pairs — send price in its place.
manual_or_auto: ManualOrAutoEntryWhether the modification was made by a human or automatically.
window_name: Option<String>Originating window name reported to Rithmic.
trail_by_ticks: Option<i32>Ticks to trail behind the market price.
A bare distance, not a TrailingStop — a modify
takes no price-id.
if_touched: Option<RithmicIfTouchedTrigger>Conditional trigger on the resulting order.
Implementations§
Source§impl RithmicModifyOrder
impl RithmicModifyOrder
Sourcepub fn new() -> Self
pub fn new() -> Self
Start from the defaults.
A modify restates the order rather than patching it, so every field that describes the resulting order has to be set.
Sourcepub fn price_type(self, price_type: OrderType) -> Self
pub fn price_type(self, price_type: OrderType) -> Self
The order’s type after the modification.
Sourcepub fn trigger_price(self, trigger_price: f64) -> Self
pub fn trigger_price(self, trigger_price: f64) -> Self
Trigger price distinct from the limit price. Left unset, the triggering
price types send price in its place.
Sourcepub fn manual_or_auto(self, manual_or_auto: ManualOrAutoEntry) -> Self
pub fn manual_or_auto(self, manual_or_auto: ManualOrAutoEntry) -> Self
Whether this was done by a human or automatically.
Sourcepub fn window_name(self, window_name: impl Into<String>) -> Self
pub fn window_name(self, window_name: impl Into<String>) -> Self
Window name to report this modification under.
Sourcepub fn trail_by_ticks(self, trail_by_ticks: i32) -> Self
pub fn trail_by_ticks(self, trail_by_ticks: i32) -> Self
Trail the resulting order this many ticks behind the market price.
Sourcepub fn if_touched(self, if_touched: RithmicIfTouchedTrigger) -> Self
pub fn if_touched(self, if_touched: RithmicIfTouchedTrigger) -> Self
Attach a conditional trigger to the resulting order.
Sourcepub fn validate(&self) -> Result<(), RithmicError>
pub fn validate(&self) -> Result<(), RithmicError>
Check the modification carries the prices its Self::price_type
requires: Limit, StopLimit and LimitIfTouched need Self::price;
StopMarket, StopLimit, MarketIfTouched and LimitIfTouched need a
trigger, which is Self::trigger_price or the Self::price that
stands in for it. Market needs neither.
Sourcepub fn build(self) -> Result<Self, RithmicError>
pub fn build(self) -> Result<Self, RithmicError>
Requires the basket_id, the instrument, and the prices the price type needs.
Trait Implementations§
Source§impl Clone for RithmicModifyOrder
impl Clone for RithmicModifyOrder
Source§fn clone(&self) -> RithmicModifyOrder
fn clone(&self) -> RithmicModifyOrder
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more