File tree Expand file tree Collapse file tree 2 files changed +2
-2
lines changed Expand file tree Collapse file tree 2 files changed +2
-2
lines changed Original file line number Diff line number Diff line change @@ -1443,7 +1443,7 @@ def geometric_mean(returns):
14431443 s .loc ['Max. Trade Duration' ] = _round_timedelta (durations .max ())
14441444 s .loc ['Avg. Trade Duration' ] = _round_timedelta (durations .mean ())
14451445 s .loc ['Profit Factor' ] = returns [returns > 0 ].sum () / (abs (returns [returns < 0 ].sum ()) or np .nan ) # noqa: E501
1446- s .loc ['Expectancy [%]' ] = ((returns [returns > 0 ].mean () * win_rate -
1446+ s .loc ['Expectancy [%]' ] = ((returns [returns > 0 ].mean () * win_rate +
14471447 returns [returns < 0 ].mean () * (100 - win_rate )))
14481448 s .loc ['SQN' ] = np .sqrt (n_trades ) * pl .mean () / (pl .std () or np .nan )
14491449
Original file line number Diff line number Diff line change @@ -266,7 +266,7 @@ def test_compute_stats(self):
266266 'End' : pd .Timestamp ('2013-03-01 00:00:00' ),
267267 'Equity Final [$]' : 51959.94999999997 ,
268268 'Equity Peak [$]' : 75787.44 ,
269- 'Expectancy [%]' : 8.791710931051735 ,
269+ 'Expectancy [%]' : 3.097629974370269 ,
270270 'Exposure Time [%]' : 93.99441340782123 ,
271271 'Max. Drawdown Duration' : pd .Timedelta ('584 days 00:00:00' ),
272272 'Max. Drawdown [%]' : - 47.98012705007589 ,
You canβt perform that action at this time.
0 commit comments