remove openIndex and closeIndex from backtest-report
This commit is contained in:
@@ -429,8 +429,6 @@ class Edge:
|
||||
'profit_abs': '',
|
||||
'open_date': date_column[open_trade_index],
|
||||
'close_date': date_column[exit_index],
|
||||
'open_index': start_point + open_trade_index,
|
||||
'close_index': start_point + exit_index,
|
||||
'trade_duration': '',
|
||||
'open_rate': round(open_price, 15),
|
||||
'close_rate': round(exit_price, 15),
|
||||
|
@@ -41,8 +41,6 @@ class BacktestResult(NamedTuple):
|
||||
profit_abs: float
|
||||
open_date: datetime
|
||||
close_date: datetime
|
||||
open_index: int
|
||||
close_index: int
|
||||
trade_duration: float
|
||||
open_at_end: bool
|
||||
open_rate: float
|
||||
@@ -251,8 +249,6 @@ class Backtesting:
|
||||
open_date=buy_row.date,
|
||||
close_date=sell_row.date,
|
||||
trade_duration=trade_dur,
|
||||
open_index=buy_row.Index,
|
||||
close_index=sell_row.Index,
|
||||
open_at_end=False,
|
||||
open_rate=buy_row.open,
|
||||
close_rate=closerate,
|
||||
@@ -268,8 +264,6 @@ class Backtesting:
|
||||
close_date=sell_row.date,
|
||||
trade_duration=int((
|
||||
sell_row.date - buy_row.date).total_seconds() // 60),
|
||||
open_index=buy_row.Index,
|
||||
close_index=sell_row.Index,
|
||||
open_at_end=True,
|
||||
open_rate=buy_row.open,
|
||||
close_rate=sell_row.open,
|
||||
|
@@ -52,8 +52,10 @@ def backtest_result_to_list(results: DataFrame) -> List[List]:
|
||||
:param results: Dataframe containing results for one strategy
|
||||
:return: List of Lists containing the trades
|
||||
"""
|
||||
# Return 0 as "index" for compatibility reasons (for now)
|
||||
# TODO: Evaluate if we can remove this
|
||||
return [[t.pair, t.profit_percent, t.open_date.timestamp(),
|
||||
t.open_date.timestamp(), t.open_index - 1, t.trade_duration,
|
||||
t.open_date.timestamp(), 0, t.trade_duration,
|
||||
t.open_rate, t.close_rate, t.open_at_end, t.sell_reason.value]
|
||||
for index, t in results.iterrows()]
|
||||
|
||||
|
Reference in New Issue
Block a user