MCPcopy Create free account
hub / github.com/kernc/backtesting.py / test_optimize_speed

Method test_optimize_speed

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

Source from the content-addressed store, hash-verified

648 self.assertTrue(stats.isnull().any())
649
650 def test_optimize_speed(self):
651 bt = Backtest(GOOG.iloc[:100], SmaCross)
652 start = time.process_time()
653 bt.optimize(fast=range(2, 20, 2), slow=range(10, 40, 2))
654 end = time.process_time()
655 print(end - start)
656 handicap = 5 if 'win' in sys.platform else .1
657 self.assertLess(end - start, .3 + handicap)
658
659
660class TestPlot(TestCase):

Callers

nothing calls this directly

Calls 2

optimizeMethod · 0.95
BacktestClass · 0.90

Tested by

no test coverage detected