Skip to main content

PlaceOrderArgs

Struct PlaceOrderArgs 

Source
pub struct PlaceOrderArgs {
Show 15 fields pub(crate) market: String, pub(crate) acc_id: Option<u64>, pub(crate) card_num: Option<String>, pub(crate) env: String, pub(crate) side: String, pub(crate) order_type: String, pub(crate) code: String, pub(crate) qty: f64, pub(crate) price: Option<f64>, pub(crate) confirm: bool, pub(crate) idempotency_key: Option<String>, pub(crate) stop_price: Option<f64>, pub(crate) trail_type: Option<i32>, pub(crate) trail_value: Option<f64>, pub(crate) trail_spread: Option<f64>,
}

Fields§

§market: String§acc_id: Option<u64>§card_num: Option<String>

App 显示卡号:4 位末尾或 16 位完整卡号

§env: String

交易环境(默认 simulate 防实盘误触)

§side: String

买卖方向: BUY | SELL | SELL_SHORT | BUY_BACK

§order_type: String

订单类型: NORMAL | MARKET | ABSOLUTE_LIMIT | AUCTION | AUCTION_LIMIT | SPECIAL_LIMIT

§code: String

股票代码(不含 market 前缀,如 00700 / AAPL)

§qty: f64

数量

§price: Option<f64>

价格(NORMAL 限价单必填,MARKET 可省)

§confirm: bool

real env 必须显式加此 flag 才能下单

§idempotency_key: Option<String>

v1.4.39:可选幂等键。设置后,同一键在 90s 内重试返 cached 响应不 重复下单(对齐 REST Idempotency-Key header 语义)。不设置则每次调 用都真实下单。例:--idempotency-key my-order-2026-04-20-a

§stop_price: Option<f64>

v1.4.53 条件单:止损/止盈触发价(仅对 STOP / STOP_LIMIT / MIT / LIT / TRAILING_STOP / TRAILING_STOP_LIMIT 生效)。对齐 FTAPI auxPrice

§trail_type: Option<i32>

v1.4.53 条件单:跟踪类型 1=Ratio(比例)/ 2=Amount(金额)

§trail_value: Option<f64>

v1.4.53 条件单:跟踪金额 / 百分比(TrailType=1 时为百分比)

§trail_spread: Option<f64>

v1.4.53 条件单:指定价差(跟踪限价单用)

Trait Implementations§

Source§

impl Args for PlaceOrderArgs

Source§

fn group_id() -> Option<Id>

Report the [ArgGroup::id][crate::ArgGroup::id] for this set of arguments
Source§

fn augment_args<'b>(__clap_app: Command) -> Command

Append to [Command] so it can instantiate Self via [FromArgMatches::from_arg_matches_mut] Read more
Source§

fn augment_args_for_update<'b>(__clap_app: Command) -> Command

Append to [Command] so it can instantiate self via [FromArgMatches::update_from_arg_matches_mut] Read more
Source§

impl FromArgMatches for PlaceOrderArgs

Source§

fn from_arg_matches(__clap_arg_matches: &ArgMatches) -> Result<Self, Error>

Instantiate Self from [ArgMatches], parsing the arguments as needed. Read more
Source§

fn from_arg_matches_mut( __clap_arg_matches: &mut ArgMatches, ) -> Result<Self, Error>

Instantiate Self from [ArgMatches], parsing the arguments as needed. Read more
Source§

fn update_from_arg_matches( &mut self, __clap_arg_matches: &ArgMatches, ) -> Result<(), Error>

Assign values from ArgMatches to self.
Source§

fn update_from_arg_matches_mut( &mut self, __clap_arg_matches: &mut ArgMatches, ) -> Result<(), Error>

Assign values from ArgMatches to self.

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> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

§

impl<T> Instrument for T

§

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

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

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.

§

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

§

fn and<P, B, E>(self, other: P) -> And<T, P>
where T: Policy<B, E>, P: Policy<B, E>,

Create a new Policy that returns [Action::Follow] only if self and other return Action::Follow. Read more
§

fn or<P, B, E>(self, other: P) -> Or<T, P>
where T: Policy<B, E>, P: Policy<B, E>,

Create a new Policy that returns [Action::Follow] if either self or other returns Action::Follow. Read more
Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
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.
§

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

§

fn vzip(self) -> V

§

impl<T> WithSubscriber for T

§

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
§

fn with_current_subscriber(self) -> WithDispatch<Self>

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