mirror of
https://github.com/microsoft/qlib.git
synced 2026-07-18 01:44:34 +08:00
black
This commit is contained in:
@@ -105,7 +105,11 @@ def return_date_list(source_dir, date_field_name: str, file_path: Path):
|
|||||||
|
|
||||||
|
|
||||||
def get_calendar_list_by_ratio(
|
def get_calendar_list_by_ratio(
|
||||||
source_dir: [str, Path], date_field_name: str = "date", threshold: float = 0.5, minimum_count: int = 10, max_workers: int = 16
|
source_dir: [str, Path],
|
||||||
|
date_field_name: str = "date",
|
||||||
|
threshold: float = 0.5,
|
||||||
|
minimum_count: int = 10,
|
||||||
|
max_workers: int = 16,
|
||||||
) -> list:
|
) -> list:
|
||||||
"""get calendar list by selecting the date when few funds trade in this day
|
"""get calendar list by selecting the date when few funds trade in this day
|
||||||
|
|
||||||
@@ -157,7 +161,11 @@ def get_calendar_list_by_ratio(
|
|||||||
if date < oldest_date:
|
if date < oldest_date:
|
||||||
_dict_count_founding[date] -= 1
|
_dict_count_founding[date] -= 1
|
||||||
|
|
||||||
calendar = [date for date in _dict_count_trade if _dict_count_trade[date] >= max(int(_dict_count_founding[date] * threshold), minimum_count)]
|
calendar = [
|
||||||
|
date
|
||||||
|
for date in _dict_count_trade
|
||||||
|
if _dict_count_trade[date] >= max(int(_dict_count_founding[date] * threshold), minimum_count)
|
||||||
|
]
|
||||||
|
|
||||||
return calendar
|
return calendar
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user