You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The reason for this bug is in line 906 of backtesting/backtesting.py
s.loc['Buy & Hold Return [%]'] = abs(c[-1] - c[0]) / c[0] * 100 # long OR short
returns the absolute value. It loses very important information. Anyone who needs the absolute value can always take the absolute value of the returned value. But now the information is lost if 'Buy & Hold Return [%]' is positive or negative. This makes it useless to compare in both long and short strategies.
The text was updated successfully, but these errors were encountered:
Mind the comment. In this case, Buy&Hold is a hypernym for Buy&Hold and Sell&Hold, namely any long-term position, taken along the assumed foreseen general direction of the underlying market.
Otherwise, even a blank strategy that does no trading whatsoever would fare better than B&H with negative return.
This makes it useless to compare in both long and short strategies.
Expected Behavior
bt.run() should produce statistics where 'Buy & Hold Return [%]' returns a negative value.
Actual Behavior
'Buy & Hold Return [%]' always returns a positive value
Steps to Reproduce
Additional info
The reason for this bug is in line 906 of backtesting/backtesting.py
s.loc['Buy & Hold Return [%]'] = abs(c[-1] - c[0]) / c[0] * 100 # long OR short
returns the absolute value. It loses very important information. Anyone who needs the absolute value can always take the absolute value of the returned value. But now the information is lost if 'Buy & Hold Return [%]' is positive or negative. This makes it useless to compare in both long and short strategies.
The text was updated successfully, but these errors were encountered: