pub struct OptionScreenerReq {
pub strategy: Option<ScreenStrategy>,
pub strategy_param: Option<StrategyExtraParam>,
pub field_filter: Option<OptionItem>,
pub sort_obj: Option<SortObj>,
pub begin_index: Option<i32>,
pub count: Option<i32>,
pub request_exact_data: Option<i32>,
}Expand description
option optimize_for = LITE_RUNTIME; 举例: 一、request.request_exact_data 为0时:只需要筛选数量,不需要具体筛选结果。此时回包的result不可用
- has_more为1,total_num为9999,表示满足条件的期权数量超过9999个,此时客户端处理为”筛选结果> 9999个期权“;
- has_more为0,total_num为9999,表示满足条件的期权数量刚好为9999个“;
二、request.request_exact_data 为非0时,需要筛选的结果
- has_more 为1时,表示还有更多数据,此时客户端可以继续请求下一页数据
- has_more 为0时,表示没有更多数据,此时客户端可以停止请求
- total_num 为满足条件的期权数量,这是一个具体的结果,即使数量超过了9999个,也会返回具体的数量。
【特别注意】 当数量超过1000个时,result也只返回1000个记录。期权筛选接口:
-
接口功能: a. 指定策略进行筛选 b. 支持排序、分页功能
-
调用场景: a. 【编辑策略场景】策略编辑时,用户编辑策略时,需要根据用户的策略条件,筛选出满足条件的期权列表(查看详细筛选结果) b. 【策略列表场景】策略列表中,用户指定某个已保存的策略,需要根据策略条件,筛选出满足条件的期权列表(查看详细筛选结果) c. 【编辑策略场景】策略编辑时,用户修改筛选条件,此时需要回显当前筛选结果的期权数量(只需要大概的数量,不需要具体的期权列表)
-
其它: a. 筛选结果最多只返回1000条记录(某些策略筛选结果可能超过1000条,但这里返回top 1000条记录), 这是为了提升筛选性能。 b. 在编辑策略场景中,有时候只需要大概的筛选结果数量,此时可以设置request_exact_data字段为0(0也是默认值),这样svr将不会返回具体的期权列表,而是只返回满足条件的期权数量。
-
如果策略涉及到使用选股策略结果、自选分组等标的筛选方式,需要将具体的标的id列表传递给svr(StrategyExtraParam), 以便svr进行筛选。
Fields§
§strategy: Option<ScreenStrategy>筛选策略
strategy_param: Option<StrategyExtraParam>策略附加参数,note: 如果用户既未选择自选股,也未选择选股器策略,该字段不传
field_filter: Option<OptionItem>允许请求方指定需要的期权指标字段(若不传该字段,svr返回默认展示的基础字段:成交量、最新价、涨跌幅、隐含波动率-期权)
sort_obj: Option<SortObj>排序方式(若不传该字段,按成交量降序)
begin_index: Option<i32>分页起始位置
count: Option<i32>分页数量, 最大值为1000. 可以传0(比如仅查询符合条件的期权总数)
request_exact_data: Option<i32>是否需要精确的数据,0:不需要,1:需要。
Implementations§
Source§impl OptionScreenerReq
impl OptionScreenerReq
Sourcepub fn begin_index(&self) -> i32
pub fn begin_index(&self) -> i32
Returns the value of begin_index, or the default value if begin_index is unset.
Sourcepub fn request_exact_data(&self) -> i32
pub fn request_exact_data(&self) -> i32
Returns the value of request_exact_data, or the default value if request_exact_data is unset.
Trait Implementations§
Source§impl Clone for OptionScreenerReq
impl Clone for OptionScreenerReq
Source§fn clone(&self) -> OptionScreenerReq
fn clone(&self) -> OptionScreenerReq
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for OptionScreenerReq
impl Debug for OptionScreenerReq
Source§impl Default for OptionScreenerReq
impl Default for OptionScreenerReq
Source§impl Message for OptionScreenerReq
impl Message for OptionScreenerReq
Source§fn encoded_len(&self) -> usize
fn encoded_len(&self) -> usize
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,
Source§fn encode_to_vec(&self) -> Vec<u8> ⓘwhere
Self: Sized,
fn encode_to_vec(&self) -> Vec<u8> ⓘwhere
Self: Sized,
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,
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,
Source§fn decode(buf: impl Buf) -> Result<Self, DecodeError>where
Self: Default,
fn decode(buf: impl Buf) -> Result<Self, DecodeError>where
Self: Default,
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,
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,
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,
self.