#[non_exhaustive]pub struct RithmicExitPosition {
pub symbol: Option<String>,
pub exchange: Option<String>,
pub manual_or_auto: ManualOrAutoEntry,
pub window_name: Option<String>,
pub trading_algorithm: Option<String>,
}Expand description
Flatten the position in one instrument, or every position on the account.
The symbol and exchange come as a pair: set both to flatten one instrument, set neither to flatten the whole account.
§Example
use rithmic_rs::RithmicExitPosition;
let one = RithmicExitPosition::new()
.symbol("ESM6")
.exchange("CME")
.build()?;
let all = RithmicExitPosition::new().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.symbol: Option<String>Trading symbol (e.g., “ESM6”). Unset together with exchange, the
exit flattens every position on the account.
exchange: Option<String>Exchange code (e.g., “CME”). Comes as a pair with symbol.
manual_or_auto: ManualOrAutoEntryWhether the exit was made by a human or automatically.
window_name: Option<String>Originating window name reported to Rithmic.
trading_algorithm: Option<String>Name of the trading algorithm credited with the exit.
Implementations§
Source§impl RithmicExitPosition
impl RithmicExitPosition
Sourcepub fn symbol(self, symbol: impl Into<String>) -> Self
pub fn symbol(self, symbol: impl Into<String>) -> Self
Instrument symbol of the position to exit.
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 exit under.
Sourcepub fn trading_algorithm(self, trading_algorithm: impl Into<String>) -> Self
pub fn trading_algorithm(self, trading_algorithm: impl Into<String>) -> Self
Trading algorithm to credit with this exit.
Sourcepub fn validate(&self) -> Result<(), RithmicError>
pub fn validate(&self) -> Result<(), RithmicError>
Requires the symbol and exchange together, or neither.
Sourcepub fn build(self) -> Result<Self, RithmicError>
pub fn build(self) -> Result<Self, RithmicError>
Requires the symbol and exchange together, or neither.
Trait Implementations§
Source§impl Clone for RithmicExitPosition
impl Clone for RithmicExitPosition
Source§fn clone(&self) -> RithmicExitPosition
fn clone(&self) -> RithmicExitPosition
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more