Skip to content

Instantly share code, notes, and snippets.

@SajidLhessani
Created November 14, 2020 22:36
Show Gist options
  • Save SajidLhessani/f82db2b8a8803cf910ae605a50f46766 to your computer and use it in GitHub Desktop.
Save SajidLhessani/f82db2b8a8803cf910ae605a50f46766 to your computer and use it in GitHub Desktop.
#Draw the middle band, higher band, lowest band
data['Middle Band'] = data['Close'].rolling(window=21).mean()
data['Upper Band'] = data['Middle Band'] + 1.96*data['Close'].rolling(window=21).std()
data['Lower Band'] = data['Middle Band'] - 1.96*data['Close'].rolling(window=21).std()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment