-
-
Notifications
You must be signed in to change notification settings - Fork 1.3k
Open
@souresia
Description
Hi,
It's good to see the stats include SQN. According to https://evilspeculator.com/tools-section/concepts/:
SQN = root(n) * expectancy / stdev(R)
but I suspect it's not correctly calculated:
backtesting.py/backtesting/_stats.py
Line 139 in 77f4c46
s.loc['SQN'] = np.sqrt(n_trades) * pl.mean() / (pl.std() or np.nan)
as it's not using the result of expectancy:
backtesting.py/backtesting/_stats.py
Line 138 in 77f4c46
s.loc['Expectancy [%]'] = returns.mean() * 100
Unless I am missing something?
Thanks!