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

update exchange

This commit is contained in:
wangwenxi.handsome
2021-08-15 12:45:29 +00:00
committed by you-n-g
parent 2da6a8c770
commit f67b99a30e
4 changed files with 150 additions and 13 deletions

View File

@@ -29,13 +29,13 @@ class FileStrTest(TestAutoData):
# test cash limit for buying
["20200103", self.TEST_INST, "1000", "buy"],
# test min_cost for buying
["20200103", self.TEST_INST, "1", "buy"],
["20200106", self.TEST_INST, "1", "buy"],
# test held stock limit for selling
["20200106", self.TEST_INST, "1000", "sell"],
["20200107", self.TEST_INST, "1000", "sell"],
# test cash limit for buying
["20200107", self.TEST_INST, "1000", "buy"],
["20200108", self.TEST_INST, "1000", "buy"],
# test min_cost for selling
["20200108", self.TEST_INST, "1", "sell"],
["20200109", self.TEST_INST, "1", "sell"],
# test selling all stocks
["20200110", self.TEST_INST, str(self.DEAL_NUM_FOR_1000), "sell"],
]
@@ -94,10 +94,11 @@ class FileStrTest(TestAutoData):
# ffr valid
ffr_dict = indicator_dict["1day"]["ffr"].to_dict()
ffr_dict = {str(date).split()[0]: ffr_dict[date] for date in ffr_dict}
assert ffr_dict["2020-01-03"] == 0
assert ffr_dict["2020-01-06"] == self.DEAL_NUM_FOR_1000 / 1000
assert ffr_dict["2020-01-03"] == self.DEAL_NUM_FOR_1000 / 1000
assert ffr_dict["2020-01-06"] == 0
assert ffr_dict["2020-01-07"] == self.DEAL_NUM_FOR_1000 / 1000
assert ffr_dict["2020-01-08"] == 0
assert ffr_dict["2020-01-08"] == self.DEAL_NUM_FOR_1000 / 1000
assert ffr_dict["2020-01-09"] == 0
assert ffr_dict["2020-01-10"] == 1
self.EXAMPLE_FILE.unlink()