kernc/backtesting.py

SQN calculation not using expectancy?

Open

#558 建立於 2021年12月23日

在 GitHub 查看
 (1 留言) (0 反應) (0 負責人)Python (863 fork)batch import
help wanted

倉庫指標

Star
 (4,387 star)
PR 合併指標
 (30 天內沒有已合併 PR)

描述

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:

https://github.com/kernc/backtesting.py/blob/77f4c46b82169c2689e1c4ad5994765556179eb2/backtesting/_stats.py#L139

as it's not using the result of expectancy:

https://github.com/kernc/backtesting.py/blob/77f4c46b82169c2689e1c4ad5994765556179eb2/backtesting/_stats.py#L138

Unless I am missing something?

Thanks!

貢獻者指南