Skip to content
New issue

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

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

Already on GitHub? # to your account

MAMA indicator ValueError #5

Open
iamcos opened this issue Jun 3, 2020 · 2 comments
Open

MAMA indicator ValueError #5

iamcos opened this issue Jun 3, 2020 · 2 comments

Comments

@iamcos
Copy link

iamcos commented Jun 3, 2020

Traceback (most recent call last):
File "/Users/cosmos/GitHub/haasomeapitools/.env/lib/python3.7/site-packages/pandas/core/series.py", line 1014, in setitem
self._set_with_engine(key, value)
File "/Users/cosmos/GitHub/haasomeapitools/.env/lib/python3.7/site-packages/pandas/core/series.py", line 1054, in _set_with_engine
self.index._engine.set_value(values, key, value)
File "pandas/_libs/index.pyx", line 96, in pandas._libs.index.IndexEngine.set_value
File "pandas/_libs/index.pyx", line 106, in pandas._libs.index.IndexEngine.set_value
File "pandas/_libs/index.pyx", line 116, in pandas._libs.index.IndexEngine.get_loc
TypeError: 'slice(11, None, None)' is an invalid key

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File "/Users/cosmos/GitHub/haasomeapitools/btalibtest.py", line 23, in
mama, fama = btalib.mama(data.High,data.Low,fastlimit=10,slowlimit=5)
File "/Users/cosmos/GitHub/haasomeapitools/.env/lib/python3.7/site-packages/btalib/indicator.py", line 152, in call
b_init(self, *args, **kwargs)
File "/Users/cosmos/GitHub/haasomeapitools/.env/lib/python3.7/site-packages/btalib/indicators/mama.py", line 79, in init
_mama = p0._ewm(alpha=alpha, span=1, _seed=SEED_ZERO)._mean()
File "/Users/cosmos/GitHub/haasomeapitools/.env/lib/python3.7/site-packages/btalib/meta/lines.py", line 357, in _mean
return self._apply(_dynalpha) # triggers getattr for _apply
File "/Users/cosmos/GitHub/haasomeapitools/.env/lib/python3.7/site-packages/btalib/meta/lines.py", line 379, in call_op
result[self._minidx:] = r = op(*sargs, **kwargs) # run/store
File "/Users/cosmos/GitHub/haasomeapitools/.env/lib/python3.7/site-packages/pandas/core/series.py", line 1042, in setitem
self._set_with(key, value)
File "/Users/cosmos/GitHub/haasomeapitools/.env/lib/python3.7/site-packages/pandas/core/series.py", line 1064, in _set_with
return self._set_values(indexer, value)
File "/Users/cosmos/GitHub/haasomeapitools/.env/lib/python3.7/site-packages/pandas/core/series.py", line 1111, in _set_values
self._data = self._data.setitem(indexer=key, value=value)
File "/Users/cosmos/GitHub/haasomeapitools/.env/lib/python3.7/site-packages/pandas/core/internals/managers.py", line 561, in setitem
return self.apply("setitem", **kwargs)
File "/Users/cosmos/GitHub/haasomeapitools/.env/lib/python3.7/site-packages/pandas/core/internals/managers.py", line 442, in apply
applied = getattr(b, f)(**kwargs)
File "/Users/cosmos/GitHub/haasomeapitools/.env/lib/python3.7/site-packages/pandas/core/internals/blocks.py", line 877, in setitem
check_setitem_lengths(indexer, value, values)
File "/Users/cosmos/GitHub/haasomeapitools/.env/lib/python3.7/site-packages/pandas/core/indexers.py", line 124, in check_setitem_lengths
"cannot set using a slice indexer with a "

@nickjohnson22
Copy link

What package version are you using?

I'm currently using mama in production without issue. The only question I have is whether or not the calculations are done correctly, and unfortunately, I am having a hard time figuring that out.

@nickjohnson22
Copy link

Also, you're going to get a false positive almost every tick with those parameters. You may already know this, but the default for fast is 0.5. The default for slow is 0.05, and those parameters work pretty darn well.

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

No branches or pull requests

2 participants