Negative PnL Strategy's Sharpe, Sortino and Calmar ratios are zero #472
Answered
by
kernc
atakanokan
asked this question in
Q&A
-
|
Is there any way for Backtest.run() to return values (instead of 0) for strategies with negative PnL? From what I can see, they all return 0. |
Beta Was this translation helpful? Give feedback.
Answered by
kernc
Sep 21, 2021
Replies: 1 comment 5 replies
-
|
You could remove backtesting.py/backtesting/_stats.py Line 120 in 7671f04 backtesting.py/backtesting/_stats.py Line 122 in 7671f04 backtesting.py/backtesting/_stats.py Line 124 in 7671f04 Do negative Sharpe, Sortino, Calmar ratios make any sense? |
Beta Was this translation helpful? Give feedback.
5 replies
Answer selected by
atakanokan
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
You could remove
np.clip()wrapping in these places:backtesting.py/backtesting/_stats.py
Line 120 in 7671f04
backtesting.py/backtesting/_stats.py
Line 122 in 7671f04
backtesting.py/backtesting/_stats.py
Line 124 in 7671f04
Do nega…