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 'ma1' is not defined #9

Closed
x829901 opened this issue Mar 20, 2020 · 1 comment
Closed

NameError: name 'ma1' is not defined #9

x829901 opened this issue Mar 20, 2020 · 1 comment

Comments

@x829901
Copy link

x829901 commented Mar 20, 2020

When I run MACD Oscillator backtest.py for Apple Inc. (AAPL), I get a NameError.

ma1:11
ma2:29
start date in format yyyy-mm-dd:2019-03-18
end date in format yyyy-mm-dd:2020-03-18
ticker:AAPL
slicing:10
[*********************100%***********************]  1 of 1 completed
Traceback (most recent call last):
  File "C:/Users/25del/PycharmProjects/KrakenBot/MACD.py", line 134, in <module>
    main()
  File "C:/Users/25del/PycharmProjects/KrakenBot/MACD.py", line 124, in main
    new = signal_generation(df, macd)
  File "C:/Users/25del/PycharmProjects/KrakenBot/MACD.py", line 37, in signal_generation
    signals = method(df)
  File "C:/Users/25del/PycharmProjects/KrakenBot/MACD.py", line 21, in macd
    signals['ma1'] = signals['Close'].rolling(window=ma1, min_periods=1, center=False).mean()
NameError: name 'ma1' is not defined
@je-suis-tm
Copy link
Owner

Thx for pointing out, I have set them as global variables.

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

2 participants