pub struct RithmicOrder {
pub symbol: String,
pub exchange: String,
pub quantity: i32,
pub price: f64,
pub transaction_type: TransactionType,
pub price_type: PriceType,
pub user_tag: String,
pub duration: Option<Duration>,
pub trigger_price: Option<f64>,
pub trailing_stop: Option<TrailingStop>,
}Expand description
A standalone order (not a bracket order).
Use this struct with RithmicOrderPlantHandle::place_order() to submit
orders with advanced features like trigger prices and trailing stops.
For orders with automatic profit targets and stop losses, use
RithmicBracketOrder instead.
§Example: Simple Limit Order
ⓘ
use rithmic_rs::{RithmicOrder, NewOrderTransactionType, NewOrderPriceType};
let order = RithmicOrder {
symbol: "ESH6".to_string(),
exchange: "CME".to_string(),
quantity: 1,
price: 5000.0,
transaction_type: NewOrderTransactionType::Buy,
price_type: NewOrderPriceType::Limit,
user_tag: "my-order-1".to_string(),
..Default::default()
};
handle.place_order(order).await?;§Example: Stop-Limit Order with Trigger Price
ⓘ
use rithmic_rs::{RithmicOrder, NewOrderTransactionType, NewOrderPriceType};
let order = RithmicOrder {
symbol: "ESH6".to_string(),
exchange: "CME".to_string(),
quantity: 1,
price: 4980.0, // Limit price after trigger
trigger_price: Some(4985.0), // Stop triggers at this price
transaction_type: NewOrderTransactionType::Sell,
price_type: NewOrderPriceType::StopLimit,
user_tag: "stop-order".to_string(),
..Default::default()
};§Example: Trailing Stop Order
ⓘ
use rithmic_rs::{RithmicOrder, NewOrderTransactionType, NewOrderPriceType, TrailingStop};
let order = RithmicOrder {
symbol: "ESH6".to_string(),
exchange: "CME".to_string(),
quantity: 1,
price: 0.0, // Not used for trailing stops
transaction_type: NewOrderTransactionType::Sell,
price_type: NewOrderPriceType::StopMarket,
trailing_stop: Some(TrailingStop { trail_by_ticks: 20 }),
user_tag: "trailing-stop".to_string(),
..Default::default()
};Fields§
§symbol: StringTrading symbol (e.g., “ESH6”)
exchange: StringExchange code (e.g., “CME”)
quantity: i32Number of contracts
price: f64Order price (ignored for market orders)
transaction_type: TransactionTypeBuy or Sell
price_type: PriceTypeOrder type (Limit, Market, StopLimit, StopMarket, etc.)
user_tag: StringYour identifier for tracking this order
duration: Option<Duration>Order duration (defaults to Day if None)
trigger_price: Option<f64>Trigger price for stop orders (StopLimit, StopMarket, etc.)
Required for stop orders; ignored for limit/market orders.
trailing_stop: Option<TrailingStop>Trailing stop configuration
Trait Implementations§
Source§impl Clone for RithmicOrder
impl Clone for RithmicOrder
Source§fn clone(&self) -> RithmicOrder
fn clone(&self) -> RithmicOrder
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 moreSource§impl Debug for RithmicOrder
impl Debug for RithmicOrder
Auto Trait Implementations§
impl Freeze for RithmicOrder
impl RefUnwindSafe for RithmicOrder
impl Send for RithmicOrder
impl Sync for RithmicOrder
impl Unpin for RithmicOrder
impl UnwindSafe for RithmicOrder
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