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

fix data format bug & twap peeking strategy

This commit is contained in:
Young
2021-07-27 14:16:18 +00:00
parent ba1c575aa9
commit 0d41ca26ab
4 changed files with 31 additions and 11 deletions

View File

@@ -63,11 +63,11 @@ class TWAPStrategy(BaseStrategy):
trade_start_time, trade_end_time = self.trade_calendar.get_step_time(trade_step)
order_list = []
for order in self.outer_trade_decision.get_decision():
# if not tradable, continue
if not self.trade_exchange.is_stock_tradable(
stock_id=order.stock_id, start_time=trade_start_time, end_time=trade_end_time
):
continue
# Don't peek the future information
# if not self.trade_exchange.is_stock_tradable(
# stock_id=order.stock_id, start_time=trade_start_time, end_time=trade_end_time
# ):
# continue
_amount_trade_unit = self.trade_exchange.get_amount_of_trade_unit(
stock_id=order.stock_id, start_time=order.start_time, end_time=order.end_time
)