1
0
mirror of https://github.com/microsoft/qlib.git synced 2026-07-14 16:26:55 +08:00

Reformat code with black.

This commit is contained in:
Charles Young
2021-02-22 10:29:29 +08:00
parent b8647c13c7
commit 2f9d45e03a
56 changed files with 218 additions and 713 deletions

View File

@@ -20,10 +20,7 @@ class HighFreqHandler(DataHandlerLP):
new_l = []
for p in proc_l:
p["kwargs"].update(
{
"fit_start_time": fit_start_time,
"fit_end_time": fit_end_time,
}
{"fit_start_time": fit_start_time, "fit_end_time": fit_end_time,}
)
new_l.append(p)
return new_l
@@ -33,11 +30,7 @@ class HighFreqHandler(DataHandlerLP):
data_loader = {
"class": "QlibDataLoader",
"kwargs": {
"config": self.get_feature_config(),
"swap_level": False,
"freq": "1min",
},
"kwargs": {"config": self.get_feature_config(), "swap_level": False, "freq": "1min",},
}
super().__init__(
instruments=instruments,
@@ -68,8 +61,7 @@ class HighFreqHandler(DataHandlerLP):
feature_ops = template_norm.format(
template_if.format(
template_fillnan.format(template_paused.format("$close")),
template_paused.format(price_field),
template_fillnan.format(template_paused.format("$close")), template_paused.format(price_field),
),
template_fillnan.format(template_paused.format("$close")),
)
@@ -119,24 +111,14 @@ class HighFreqHandler(DataHandlerLP):
class HighFreqBacktestHandler(DataHandler):
def __init__(
self,
instruments="csi300",
start_time=None,
end_time=None,
self, instruments="csi300", start_time=None, end_time=None,
):
data_loader = {
"class": "QlibDataLoader",
"kwargs": {
"config": self.get_feature_config(),
"swap_level": False,
"freq": "1min",
},
"kwargs": {"config": self.get_feature_config(), "swap_level": False, "freq": "1min",},
}
super().__init__(
instruments=instruments,
start_time=start_time,
end_time=end_time,
data_loader=data_loader,
instruments=instruments, start_time=start_time, end_time=end_time, data_loader=data_loader,
)
def get_feature_config(self):
@@ -155,8 +137,7 @@ class HighFreqBacktestHandler(DataHandler):
fields += [
"Cut({0}, 240, None)".format(
template_if.format(
template_fillnan.format(template_paused.format("$close")),
template_paused.format(simpson_vwap),
template_fillnan.format(template_paused.format("$close")), template_paused.format(simpson_vwap),
)
)
]