MCPcopy Create free account
hub / github.com/alpha2phi/python-apps / bb

Function bb

copilot-labs/bollinger_bands.py:64–68  ·  view source on GitHub ↗
(data, sma, window)

Source from the content-addressed store, hash-verified

62plt.show()
63
64def bb(data, sma, window):
65 std = data.rolling(window = window).std()
66 upper_bb = sma + std * 2
67 lower_bb = sma - std * 2
68 return upper_bb, lower_bb
69
70tsla['upper_bb'], tsla['lower_bb'] = bb(tsla['close'], tsla['sma_20'], 20)
71print(tsla.tail())

Callers 1

bollinger_bands.pyFile · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected