From b8647c13c78842d8ceb20ffb3788cc034cba6041 Mon Sep 17 00:00:00 2001 From: Charles Young Date: Mon, 22 Feb 2021 10:20:51 +0800 Subject: [PATCH] Reformat code to follow PEP 8. --- qlib/contrib/strategy/strategy.py | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/qlib/contrib/strategy/strategy.py b/qlib/contrib/strategy/strategy.py index 74df39f3e..550ff649d 100644 --- a/qlib/contrib/strategy/strategy.py +++ b/qlib/contrib/strategy/strategy.py @@ -7,7 +7,6 @@ import numpy as np import pandas as pd from ..backtest.order import Order -from ...utils import get_pre_trading_date from .order_generator import OrderGenWInteract @@ -390,11 +389,11 @@ class TopkDropoutStrategy(BaseStrategy, ListAdjustTimer): current_stock_list = current_temp.get_stock_list() value = cash * self.risk_degree / len(buy) if len(buy) > 0 else 0 - # open_cost should be considered in the real trading environment, while the backtest in evaluate.py does not consider it - # as the aim of demo is to accomplish same strategy as evaluate.py, so comment out this line + # open_cost should be considered in the real trading environment, while the backtest in evaluate.py does not + # consider it as the aim of demo is to accomplish same strategy as evaluate.py, so comment out this line # value = value / (1+trade_exchange.open_cost) # set open_cost limit for code in buy: - # check is stock supended + # check is stock suspended if not trade_exchange.is_stock_tradable(stock_id=code, trade_date=trade_date): continue # buy order