pub struct QmtDataDir { /* private fields */ }Expand description
QMT datadir 根目录句柄。
Implementations§
Source§impl QmtDataDir
impl QmtDataDir
Sourcepub fn tick_path(
&self,
market: Market,
symbol: &str,
date: &str,
) -> Result<PathBuf, DataDirError>
pub fn tick_path( &self, market: Market, symbol: &str, date: &str, ) -> Result<PathBuf, DataDirError>
定位 tick 文件路径。
Sourcepub fn min_path(
&self,
market: Market,
symbol: &str,
) -> Result<PathBuf, DataDirError>
pub fn min_path( &self, market: Market, symbol: &str, ) -> Result<PathBuf, DataDirError>
定位 1 分钟线文件路径。
Sourcepub fn day_path(
&self,
market: Market,
symbol: &str,
) -> Result<PathBuf, DataDirError>
pub fn day_path( &self, market: Market, symbol: &str, ) -> Result<PathBuf, DataDirError>
定位日线文件路径。
Sourcepub fn finance_path(
&self,
symbol: &str,
file_type: FileType,
) -> Result<PathBuf, DataDirError>
pub fn finance_path( &self, symbol: &str, file_type: FileType, ) -> Result<PathBuf, DataDirError>
定位财务文件路径。
Sourcepub fn dividend_db_path(&self) -> Result<PathBuf, DataDirError>
pub fn dividend_db_path(&self) -> Result<PathBuf, DataDirError>
定位分红 LevelDB 目录。
Sourcepub fn parse_ticks_to_structs(
&self,
market: Market,
symbol: &str,
date: &str,
) -> Result<Vec<TickData>, DataDirError>
pub fn parse_ticks_to_structs( &self, market: Market, symbol: &str, date: &str, ) -> Result<Vec<TickData>, DataDirError>
从 datadir 发现并解析 tick 文件为结构体。
Sourcepub fn parse_ticks_to_dataframe(
&self,
market: Market,
symbol: &str,
date: &str,
) -> Result<DataFrame, DataDirError>
pub fn parse_ticks_to_dataframe( &self, market: Market, symbol: &str, date: &str, ) -> Result<DataFrame, DataDirError>
从 datadir 发现并解析 tick 文件为 DataFrame。
Sourcepub fn parse_min_to_structs(
&self,
market: Market,
symbol: &str,
) -> Result<Vec<MinKlineData>, DataDirError>
pub fn parse_min_to_structs( &self, market: Market, symbol: &str, ) -> Result<Vec<MinKlineData>, DataDirError>
从 datadir 发现并解析 1 分钟线文件为结构体。
Sourcepub fn parse_min_to_dataframe(
&self,
market: Market,
symbol: &str,
) -> Result<DataFrame, DataDirError>
pub fn parse_min_to_dataframe( &self, market: Market, symbol: &str, ) -> Result<DataFrame, DataDirError>
从 datadir 发现并解析 1 分钟线文件为 DataFrame。
Sourcepub fn parse_daily_file_to_structs(
&self,
market: Market,
symbol: &str,
) -> Result<Vec<DailyKlineData>, DataDirError>
pub fn parse_daily_file_to_structs( &self, market: Market, symbol: &str, ) -> Result<Vec<DailyKlineData>, DataDirError>
从 datadir 发现并解析整个日线文件为结构体。
Sourcepub fn parse_daily_to_structs(
&self,
market: Market,
symbol: &str,
start: &str,
end: &str,
) -> Result<Vec<DailyKlineData>, DataDirError>
pub fn parse_daily_to_structs( &self, market: Market, symbol: &str, start: &str, end: &str, ) -> Result<Vec<DailyKlineData>, DataDirError>
从 datadir 发现并按字符串日期范围解析日线为结构体。
Sourcepub fn parse_daily_to_structs_in_range(
&self,
market: Market,
symbol: &str,
start: Option<NaiveDate>,
end: Option<NaiveDate>,
) -> Result<Vec<DailyKlineData>, DataDirError>
pub fn parse_daily_to_structs_in_range( &self, market: Market, symbol: &str, start: Option<NaiveDate>, end: Option<NaiveDate>, ) -> Result<Vec<DailyKlineData>, DataDirError>
从 datadir 发现并按 typed 日期范围解析日线为结构体。
Sourcepub fn parse_daily_file_to_dataframe(
&self,
market: Market,
symbol: &str,
) -> Result<DataFrame, DataDirError>
pub fn parse_daily_file_to_dataframe( &self, market: Market, symbol: &str, ) -> Result<DataFrame, DataDirError>
从 datadir 发现并解析整个日线文件为 DataFrame。
Sourcepub fn parse_daily_to_dataframe(
&self,
market: Market,
symbol: &str,
start: &str,
end: &str,
) -> Result<DataFrame, DataDirError>
pub fn parse_daily_to_dataframe( &self, market: Market, symbol: &str, start: &str, end: &str, ) -> Result<DataFrame, DataDirError>
从 datadir 发现并按字符串日期范围解析日线为 DataFrame。
Sourcepub fn parse_daily_to_dataframe_in_range(
&self,
market: Market,
symbol: &str,
start: Option<NaiveDate>,
end: Option<NaiveDate>,
) -> Result<DataFrame, DataDirError>
pub fn parse_daily_to_dataframe_in_range( &self, market: Market, symbol: &str, start: Option<NaiveDate>, end: Option<NaiveDate>, ) -> Result<DataFrame, DataDirError>
从 datadir 发现并按 typed 日期范围解析日线为 DataFrame。
Sourcepub fn read_finance(
&self,
symbol: &str,
file_type: FileType,
) -> Result<Vec<FinanceRecord>, DataDirError>
pub fn read_finance( &self, symbol: &str, file_type: FileType, ) -> Result<Vec<FinanceRecord>, DataDirError>
从 datadir 发现并读取财务文件。
Sourcepub fn open_dividend_db(&self) -> Result<DividendDb, DataDirError>
pub fn open_dividend_db(&self) -> Result<DividendDb, DataDirError>
从 datadir 发现并打开分红数据库。
Sourcepub fn load_holidays(&self) -> Result<Vec<i64>, DataDirError>
pub fn load_holidays(&self) -> Result<Vec<i64>, DataDirError>
从 datadir 发现并加载节假日列表。
Sourcepub fn load_sector_names(&self) -> Result<Vec<String>, DataDirError>
pub fn load_sector_names(&self) -> Result<Vec<String>, DataDirError>
从 datadir 发现并加载 sector 名称。
Sourcepub fn load_sectorlist(&self) -> Result<Vec<String>, DataDirError>
pub fn load_sectorlist(&self) -> Result<Vec<String>, DataDirError>
从 datadir 发现并加载 sectorlist.DAT。
Sourcepub fn load_sector_weight_members(
&self,
) -> Result<BTreeMap<String, Vec<String>>, DataDirError>
pub fn load_sector_weight_members( &self, ) -> Result<BTreeMap<String, Vec<String>>, DataDirError>
从 datadir 发现并加载全部 sector 成员映射。
Sourcepub fn load_sector_weight_index(
&self,
index_code: &str,
) -> Result<BTreeMap<String, f64>, DataDirError>
pub fn load_sector_weight_index( &self, index_code: &str, ) -> Result<BTreeMap<String, f64>, DataDirError>
从 datadir 发现并加载指定 sector/index 的权重映射。
Sourcepub fn load_industry(
&self,
) -> Result<BTreeMap<String, Vec<String>>, DataDirError>
pub fn load_industry( &self, ) -> Result<BTreeMap<String, Vec<String>>, DataDirError>
从 datadir 发现并加载行业成员映射。
Trait Implementations§
Source§impl Clone for QmtDataDir
impl Clone for QmtDataDir
Source§fn clone(&self) -> QmtDataDir
fn clone(&self) -> QmtDataDir
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreAuto Trait Implementations§
impl Freeze for QmtDataDir
impl RefUnwindSafe for QmtDataDir
impl Send for QmtDataDir
impl Sync for QmtDataDir
impl Unpin for QmtDataDir
impl UnsafeUnpin for QmtDataDir
impl UnwindSafe for QmtDataDir
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more