MCPcopy Index your code
hub / github.com/kernc/backtesting.py / test_dont_overwrite_data

Method test_dont_overwrite_data

backtesting/test/_test.py:284–290  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

282 CASH + (PRICE_EXIT - PRICE_ENTRY) * SIZE - EXPECTED_PAID_COMMISSION)
283
284 def test_dont_overwrite_data(self):
285 df = EURUSD.copy()
286 bt = Backtest(df, SmaCross)
287 bt.run()
288 bt.optimize(fast=4, slow=[6, 8])
289 bt.plot(plot_drawdown=True, open_browser=False)
290 self.assertTrue(df.equals(EURUSD))
291
292 def test_strategy_abstract(self):
293 class MyStrategy(Strategy):

Callers

nothing calls this directly

Calls 4

runMethod · 0.95
optimizeMethod · 0.95
plotMethod · 0.95
BacktestClass · 0.90

Tested by

no test coverage detected