1
0
mirror of https://github.com/microsoft/qlib.git synced 2026-07-10 06:20:57 +08:00

add Handler Storage

This commit is contained in:
bxdd
2021-06-28 20:06:15 +00:00
parent 27f0db669f
commit e1b6f310c9
7 changed files with 115 additions and 22 deletions

View File

@@ -164,10 +164,6 @@ class Exchange:
assert set(self.extra_quote.columns) == set(quote_df.columns) - {"$change"}
quote_df = pd.concat([quote_df, self.extra_quote], sort=False, axis=0)
# update quote: pd.DataFrame to dict, for search use
if get_level_index(quote_df, level="datetime") == 1:
quote_df = quote_df.swaplevel().sort_index()
quote_dict = {}
for stock_id, stock_val in quote_df.groupby(level="instrument"):
quote_dict[stock_id] = stock_val

View File

@@ -408,7 +408,7 @@ class InfPosition(BasePosition):
"""
def skip_update(self) -> bool:
""" Updating state is meaningless for InfPosition """
"""Updating state is meaningless for InfPosition"""
return True
def check_stock(self, stock_id: str) -> bool: