pub struct KlineReq {
pub security_id: Option<u64>,
pub kline_type: Option<u32>,
pub exright_type: Option<u32>,
pub data_set_type: Option<u32>,
pub data_range_type: Option<u32>,
pub begin_time: Option<u64>,
pub end_time: Option<u64>,
pub item_count: Option<u32>,
pub end_time_offset: Option<i32>,
pub kline_type_prob: Option<u32>,
pub broker_id: Option<i32>,
}Expand description
K线拉取 - 请求
三种范围请求方式: 1、begin_time + end_time + [end_time_offset] 给定起始时间、结束时间,从旧往新取K线点 end_time为-1时,表示返回至当前有效时间点。end_time_offset表示相对end_time偏移多少个时间点。
例如请求1分K:begin_time:0 end_time:-1 end_time_offset:10,当前最新1分K是14:25,返回的数据点最大将会
是14:35(偏离14:25 10个时间点)2、begin_time + item_count 给定起始时间、K线点个数,从旧往新取K线点 返回的数据点第一个点的时间一定大于等于begin_time,并且数据点个数一定等于item_count,即使是未来的点。
3、end_time + item_count + [end_time_offset] 给定结束时间、K线点个数,从新往旧取K线点 end_time为-1时,表示返回至当前有效时间点。end_time_offset表示相对end_time偏移多少个时间点。
例如请求1分K:end_time:-1 item_count:100 end_time_offset:10,当前最新1分K是14:25,返回的数据点最大将会
是14:35(偏离14:25 10个时间点)Fields§
§security_id: Option<u64>股票ID
kline_type: Option<u32>K线类型,见KlineType枚举
exright_type: Option<u32>复权类型,见ExrightType枚举
data_set_type: Option<u32>数据类型,见DataSetType枚举
data_range_type: Option<u32>数据范围组合类型,见DataRangeType枚举
begin_time: Option<u64>开始时间戳。0:表示所有数据的起点
end_time: Option<u64>结束时间戳。-1:最新有效数据时间
item_count: Option<u32>数据点个数。
end_time_offset: Option<i32>结束时间偏移offset,与end_time配合使用,一般不填或填0。目前需0<=end_time_offset<=1000,且当end_time为-1时才有效。 通过此参数,可以达到预取未来K线点的效果
kline_type_prob: Option<u32>参考KlineTypeProb。带一些额外的属性,如请求美股分K时可以指定包含盘前盘后分K
broker_id: Option<i32>v1.4.110 broker-aware K-line: GetKL / RequestHistoryKL write broker_id for crypto multi-broker active-pull requests.
券商id,未指定则默认为查询全球行情【目前只有数字货币】
Implementations§
Source§impl KlineReq
impl KlineReq
Sourcepub fn security_id(&self) -> u64
pub fn security_id(&self) -> u64
Returns the value of security_id, or the default value if security_id is unset.
Sourcepub fn kline_type(&self) -> u32
pub fn kline_type(&self) -> u32
Returns the value of kline_type, or the default value if kline_type is unset.
Sourcepub fn exright_type(&self) -> u32
pub fn exright_type(&self) -> u32
Returns the value of exright_type, or the default value if exright_type is unset.
Sourcepub fn data_set_type(&self) -> u32
pub fn data_set_type(&self) -> u32
Returns the value of data_set_type, or the default value if data_set_type is unset.
Sourcepub fn data_range_type(&self) -> u32
pub fn data_range_type(&self) -> u32
Returns the value of data_range_type, or the default value if data_range_type is unset.
Sourcepub fn begin_time(&self) -> u64
pub fn begin_time(&self) -> u64
Returns the value of begin_time, or the default value if begin_time is unset.
Sourcepub fn end_time(&self) -> u64
pub fn end_time(&self) -> u64
Returns the value of end_time, or the default value if end_time is unset.
Sourcepub fn item_count(&self) -> u32
pub fn item_count(&self) -> u32
Returns the value of item_count, or the default value if item_count is unset.
Sourcepub fn end_time_offset(&self) -> i32
pub fn end_time_offset(&self) -> i32
Returns the value of end_time_offset, or the default value if end_time_offset is unset.
Sourcepub fn kline_type_prob(&self) -> u32
pub fn kline_type_prob(&self) -> u32
Returns the value of kline_type_prob, or the default value if kline_type_prob is unset.
Trait Implementations§
Source§impl Message for KlineReq
impl Message for KlineReq
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.impl Copy for KlineReq
impl Eq for KlineReq
impl StructuralPartialEq for KlineReq
Auto Trait Implementations§
impl Freeze for KlineReq
impl RefUnwindSafe for KlineReq
impl Send for KlineReq
impl Sync for KlineReq
impl Unpin for KlineReq
impl UnsafeUnpin for KlineReq
impl UnwindSafe for KlineReq
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key and return true if they are equal.