Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

bollinger_band calculation method #13

Open
Wolfslayer opened this issue Nov 24, 2020 · 0 comments
Open

bollinger_band calculation method #13

Wolfslayer opened this issue Nov 24, 2020 · 0 comments

Comments

@Wolfslayer
Copy link

Thanks for this project Alex! Awesome stuff.

Working on building a robot for tracking trades vs indicator readings and I noticed something looked funny with the bollinger_band indicator. Don't have much of a background in finance so it could be I'm misunderstanding something. You calculate the upper band as

self._frame['band_upper'] = 4 * (self._frame['moving_std'] / self._frame['moving_avg'])

which makes sense to me as 4 times the normalized standard dev, but then the lower band is calculated as

self._frame['band_lower'] = (
             (self._frame['close'] - self._frame['moving_avg']) +
              (2 * self._frame['moving_std']) /
              (4 * self._frame['moving_std'])
          )

Where that third term I believe just simplies to 1/2. I would've guessed based on how upper band is given that lower band would just be its negated version? Again, I'm a novice in finance so my thinking may just be incorrect here.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant