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
I previously used version 0.3.3 and recently updated to 0.6.4. Even with identical code, the backtest results differ between the two versions – including for simple strategies like buy-and-hold. The code is as follows:
from backtesting import Backtest, Strategy
from backtesting.lib import crossover
from backtesting.test import SMA, GOOG
class BuyAndHold (Strategy):
def init(self):
pass
def next(self):
if (not self.position.is_long
):
self.buy()
bt = Backtest(GOOG, BuyAndHold,
cash=10000, commission=.002,
exclusive_orders=True)
output = bt.run()
bt.plot()
print(output)
Results from 0.3.3:
Results from 0.6.4:
When testing other strategies, the trades, outcomes, and charts also show discrepancies between versions. I want to understand if there are configuration changes, and which version’s results should be considered more reliable for actual reference? Personally, I prefer the 0.3.3 results as I’ve consistently used them for trading signals. I’m concerned future updates might make it impossible to continue relying on the 0.3.3 outcomes.
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
Uh oh!
There was an error while loading. Please reload this page.
-
I previously used version 0.3.3 and recently updated to 0.6.4. Even with identical code, the backtest results differ between the two versions – including for simple strategies like buy-and-hold. The code is as follows:
Results from 0.3.3:


Results from 0.6.4:


When testing other strategies, the trades, outcomes, and charts also show discrepancies between versions. I want to understand if there are configuration changes, and which version’s results should be considered more reliable for actual reference? Personally, I prefer the 0.3.3 results as I’ve consistently used them for trading signals. I’m concerned future updates might make it impossible to continue relying on the 0.3.3 outcomes.
Beta Was this translation helpful? Give feedback.
All reactions