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

Method init

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

Source from the content-addressed store, hash-verified

724 def test_preview(self):
725 class Strategy(SmaCross):
726 def init(self):
727 super().init()
728
729 def ok(x):
730 return x
731
732 self.a = self.I(SMA, self.data.Open, 5, overlay=False, name='ok')
733 self.b = self.I(ok, np.random.random(len(self.data.Open)))
734
735 bt = Backtest(GOOG, Strategy)
736 bt.run()

Callers

nothing calls this directly

Calls 2

IMethod · 0.95
initMethod · 0.45

Tested by

no test coverage detected