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

NameError: name 'bollinger_mavg' is not defined #4

Closed
jdservice42 opened this issue Nov 30, 2019 · 1 comment
Closed

NameError: name 'bollinger_mavg' is not defined #4

jdservice42 opened this issue Nov 30, 2019 · 1 comment

Comments

@jdservice42
Copy link

My portfolio and watchlist are displayed and then I get this.

----- Scanning portfolio for stocks to sell -----

Traceback (most recent call last):
File "main.py", line 258, in
scan_stocks()
File "main.py", line 240, in scan_stocks
cross = golden_cross(symbol, n1=50, n2=200, days=30, direction="below")
File "main.py", line 170, in golden_cross
sma1 = bollinger_mavg(price, n=int(n1), fillna=False)
NameError: name 'bollinger_mavg' is not defined
jdubb@Latitude-D630:~/RobinhoodBot/robinhoodbot$

What could this be?

@shafcodes
Copy link

shafcodes commented Dec 4, 2019

I am assuming the implementation of Bollinger Moving Averages is missing from the code provided. You can either write your own definition to implement it or wait for the authors to provide the code for it.

Here is a repo i found that might help you understand what Bollinger moving/rolling averages are -
Umesh's Repo

UPDATE:

In case you are still looking for the answer, here is what i did -

your code is unable to detect the bollinger_mavg method from the 'ta' library.

I changed the code to fix this issue -

import ta as ta

and then replace

bollinger_mavg(.......)
with
ta.volatility.bollinger_mavg(.....)

Here is the link.

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

3 participants