Skip to content

Commit 3e31891

Browse files
committed
BRK: Rename stats._trades key 'Commissions' -> 'Commission'
The word is long enough as it is. I tried to monkey-wrap it with a deprecation warning, but couldn't figure it out pandas-wise.
1 parent 72e56f3 commit 3e31891

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

backtesting/_stats.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,7 @@ def compute_stats(
6767
'SL': [t.sl for t in trades],
6868
'TP': [t.tp for t in trades],
6969
'PnL': [t.pl for t in trades],
70-
'Commissions': [t._commissions for t in trades],
70+
'Commission': [t._commissions for t in trades],
7171
'ReturnPct': [t.pl_pct for t in trades],
7272
'EntryTime': [t.entry_time for t in trades],
7373
'ExitTime': [t.exit_time for t in trades],

backtesting/test/_test.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -347,7 +347,7 @@ def almost_equal(a, b):
347347
sorted(stats['_trades'].columns),
348348
sorted(['Size', 'EntryBar', 'ExitBar', 'EntryPrice', 'ExitPrice',
349349
'SL', 'TP', 'PnL', 'ReturnPct', 'EntryTime', 'ExitTime',
350-
'Duration', 'Tag', 'Commissions',
350+
'Duration', 'Tag', 'Commission',
351351
*indicator_columns]))
352352

353353
def test_compute_stats_bordercase(self):

0 commit comments

Comments
 (0)