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

Method init

doc/examples/Quick Start User Guide.py:100–103  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

98 n2 = 20
99
100 def init(self):
101 # Precompute the two moving averages
102 self.sma1 = self.I(SMA, self.data.Close, self.n1)
103 self.sma2 = self.I(SMA, self.data.Close, self.n2)
104
105 def next(self):
106 # If sma1 crosses above sma2, close any existing

Callers

nothing calls this directly

Calls 1

IMethod · 0.80

Tested by

no test coverage detected