Add RQData factor helper APIs
This commit is contained in:
@@ -654,6 +654,90 @@ impl StrategyContext<'_> {
|
||||
self.data.get_securities_margin(symbol, start, end, field)
|
||||
}
|
||||
|
||||
pub fn get_shares(
|
||||
&self,
|
||||
symbol: &str,
|
||||
start: NaiveDate,
|
||||
end: NaiveDate,
|
||||
share_type: &str,
|
||||
) -> Vec<FactorValue> {
|
||||
self.data.get_shares(symbol, start, end, share_type)
|
||||
}
|
||||
|
||||
pub fn get_turnover_rate(
|
||||
&self,
|
||||
symbol: &str,
|
||||
start: NaiveDate,
|
||||
end: NaiveDate,
|
||||
field: &str,
|
||||
) -> Vec<FactorValue> {
|
||||
self.data.get_turnover_rate(symbol, start, end, field)
|
||||
}
|
||||
|
||||
pub fn get_price_change_rate(
|
||||
&self,
|
||||
symbol: &str,
|
||||
start: NaiveDate,
|
||||
end: NaiveDate,
|
||||
) -> Vec<FactorValue> {
|
||||
self.data.get_price_change_rate(symbol, start, end)
|
||||
}
|
||||
|
||||
pub fn get_stock_connect(
|
||||
&self,
|
||||
symbol: &str,
|
||||
start: NaiveDate,
|
||||
end: NaiveDate,
|
||||
field: &str,
|
||||
) -> Vec<FactorValue> {
|
||||
self.data.get_stock_connect(symbol, start, end, field)
|
||||
}
|
||||
|
||||
pub fn current_performance(
|
||||
&self,
|
||||
symbol: &str,
|
||||
start: NaiveDate,
|
||||
end: NaiveDate,
|
||||
field: &str,
|
||||
) -> Vec<FactorValue> {
|
||||
self.data.current_performance(symbol, start, end, field)
|
||||
}
|
||||
|
||||
pub fn get_fundamentals(
|
||||
&self,
|
||||
symbol: &str,
|
||||
start: NaiveDate,
|
||||
end: NaiveDate,
|
||||
field: &str,
|
||||
) -> Vec<FactorValue> {
|
||||
self.data.get_fundamentals(symbol, start, end, field)
|
||||
}
|
||||
|
||||
pub fn get_financials(
|
||||
&self,
|
||||
symbol: &str,
|
||||
start: NaiveDate,
|
||||
end: NaiveDate,
|
||||
field: &str,
|
||||
) -> Vec<FactorValue> {
|
||||
self.data.get_financials(symbol, start, end, field)
|
||||
}
|
||||
|
||||
pub fn get_pit_financials(
|
||||
&self,
|
||||
symbol: &str,
|
||||
start: NaiveDate,
|
||||
end: NaiveDate,
|
||||
field: &str,
|
||||
) -> Vec<FactorValue> {
|
||||
self.data.get_pit_financials(symbol, start, end, field)
|
||||
}
|
||||
|
||||
pub fn get_industry(&self, symbol: &str, source: &str, level: usize) -> Option<FactorValue> {
|
||||
self.data
|
||||
.get_industry(symbol, self.execution_date, source, level)
|
||||
}
|
||||
|
||||
pub fn get_dominant_future(&self, underlying_symbol: &str) -> Option<String> {
|
||||
self.data
|
||||
.get_dominant_future(underlying_symbol, self.execution_date)
|
||||
|
||||
Reference in New Issue
Block a user