changes testcase
This commit is contained in:
@@ -18,7 +18,7 @@ class BTrade(NamedTuple):
|
||||
sell_reason: SellType
|
||||
open_tick: int
|
||||
close_tick: int
|
||||
buy_tag: Optional[str] = ''
|
||||
buy_tag: Optional[str] = None
|
||||
|
||||
|
||||
class BTContainer(NamedTuple):
|
||||
@@ -44,7 +44,9 @@ def _get_frame_time_from_offset(offset):
|
||||
|
||||
|
||||
def _build_backtest_dataframe(data):
|
||||
columns = ['date', 'open', 'high', 'low', 'close', 'volume', 'buy', 'sell', 'buy_tag']
|
||||
|
||||
columns = ['date', 'open', 'high', 'low', 'close', 'volume', 'buy', 'sell']
|
||||
columns = columns + ['buy_tag'] if len(data[0]) == 9 else columns
|
||||
|
||||
frame = DataFrame.from_records(data, columns=columns)
|
||||
frame['date'] = frame['date'].apply(_get_frame_time_from_offset)
|
||||
|
||||
Reference in New Issue
Block a user