pub struct S2c {
pub code: String,
pub name: String,
pub option_strategy: i32,
pub bid1: Option<f64>,
pub ask1: Option<f64>,
pub max_profit: Option<f64>,
pub max_loss: Option<f64>,
pub breakeven_points: Vec<f64>,
pub prob_of_profit: Option<f64>,
pub delta: Option<f64>,
pub theta: Option<f64>,
}Fields§
§code: String组合策略代码
name: String组合策略名称
option_strategy: i32Qot_GetOptionStrategy.OptionStrategyType,组合策略类型
bid1: Option<f64>买一价
ask1: Option<f64>卖一价
max_profit: Option<f64>最大盈利,无上限时为 9999999
max_loss: Option<f64>最大亏损,无下限时为 9999999
breakeven_points: Vec<f64>盈亏平衡点列表,可能有多个
prob_of_profit: Option<f64>盈利概率
delta: Option<f64>组合 Delta
theta: Option<f64>组合 Theta(每日时间价值损耗)
Implementations§
Source§impl S2c
impl S2c
Sourcepub fn max_profit(&self) -> f64
pub fn max_profit(&self) -> f64
Returns the value of max_profit, or the default value if max_profit is unset.
Sourcepub fn max_loss(&self) -> f64
pub fn max_loss(&self) -> f64
Returns the value of max_loss, or the default value if max_loss is unset.
Sourcepub fn prob_of_profit(&self) -> f64
pub fn prob_of_profit(&self) -> f64
Returns the value of prob_of_profit, or the default value if prob_of_profit is unset.
Trait Implementations§
Source§impl<'de> Deserialize<'de> for S2c
impl<'de> Deserialize<'de> for S2c
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Source§impl Message for S2c
impl Message for S2c
Source§fn encoded_len(&self) -> usize
fn encoded_len(&self) -> usize
Returns the encoded length of the message without a length delimiter.
Source§fn encode(&self, buf: &mut impl BufMut) -> Result<(), EncodeError>where
Self: Sized,
fn encode(&self, buf: &mut impl BufMut) -> Result<(), EncodeError>where
Self: Sized,
Encodes the message to a buffer. Read more
Source§fn encode_to_vec(&self) -> Vec<u8> ⓘwhere
Self: Sized,
fn encode_to_vec(&self) -> Vec<u8> ⓘwhere
Self: Sized,
Encodes the message to a newly allocated buffer.
Source§fn encode_length_delimited(
&self,
buf: &mut impl BufMut,
) -> Result<(), EncodeError>where
Self: Sized,
fn encode_length_delimited(
&self,
buf: &mut impl BufMut,
) -> Result<(), EncodeError>where
Self: Sized,
Encodes the message with a length-delimiter to a buffer. Read more
Source§fn encode_length_delimited_to_vec(&self) -> Vec<u8> ⓘwhere
Self: Sized,
fn encode_length_delimited_to_vec(&self) -> Vec<u8> ⓘwhere
Self: Sized,
Encodes the message with a length-delimiter to a newly allocated buffer.
Source§fn decode(buf: impl Buf) -> Result<Self, DecodeError>where
Self: Default,
fn decode(buf: impl Buf) -> Result<Self, DecodeError>where
Self: Default,
Decodes an instance of the message from a buffer. Read more
Source§fn decode_length_delimited(buf: impl Buf) -> Result<Self, DecodeError>where
Self: Default,
fn decode_length_delimited(buf: impl Buf) -> Result<Self, DecodeError>where
Self: Default,
Decodes a length-delimited instance of the message from the buffer.
Source§fn merge(&mut self, buf: impl Buf) -> Result<(), DecodeError>where
Self: Sized,
fn merge(&mut self, buf: impl Buf) -> Result<(), DecodeError>where
Self: Sized,
Decodes an instance of the message from a buffer, and merges it into
self. Read moreSource§fn merge_length_delimited(&mut self, buf: impl Buf) -> Result<(), DecodeError>where
Self: Sized,
fn merge_length_delimited(&mut self, buf: impl Buf) -> Result<(), DecodeError>where
Self: Sized,
Decodes a length-delimited instance of the message from buffer, and
merges it into
self.impl StructuralPartialEq for S2c
Auto Trait Implementations§
impl Freeze for S2c
impl RefUnwindSafe for S2c
impl Send for S2c
impl Sync for S2c
impl Unpin for S2c
impl UnsafeUnpin for S2c
impl UnwindSafe for S2c
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