kernc/backtesting.py

SQN calculation not using expectancy?

Open

#558 aberto em 23 de dez. de 2021

Ver no GitHub
 (1 comment) (0 reactions) (0 assignees)Python (863 forks)batch import
help wanted

Métricas do repositório

Stars
 (4.387 stars)
Métricas de merge de PR
 (Nenhuma PRs mesclada em 30d)

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:

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!

Guia do colaborador