1
0
mirror of https://github.com/microsoft/qlib.git synced 2026-07-12 23:36:54 +08:00
This commit is contained in:
bxdd
2021-04-30 22:56:21 +08:00
parent a109df3f46
commit d297a493b8
5 changed files with 102 additions and 70 deletions

View File

@@ -7,8 +7,7 @@ from pathlib import Path
import qlib
import pandas as pd
from qlib.config import REG_CN
from qlib.contrib.strategy import TopkDropoutStrategy
from qlib.contrib.backtest import backtest
from qlib.utils import exists_qlib_data, init_instance_by_config, flatten_dict
from qlib.workflow import R
from qlib.workflow.record_temp import PortAnaRecord
@@ -130,20 +129,9 @@ if __name__ == "__main__":
"min_cost": 5,
},
}
#report_dict = backtest(
# start_time=trade_start_time,
# end_time=trade_end_time,
# **backtest_config,
# account=1e8,
# benchmark=benchmark,
# deal_price="$close",
# verbose=False,
#)
with R.start(experiment_name="highfreq_backtest"):
# backtest. If users want to use backtest based on their own prediction,
# please refer to https://qlib.readthedocs.io/en/latest/component/recorder.html#record-template.
recorder = R.get_recorder()
par = PortAnaRecord(recorder, port_analysis_config, 1)
par.generate()
par = PortAnaRecord(recorder, port_analysis_config, "day")
par.generate()