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

Most indicators are working but mama. #25

Open
murthybhatt opened this issue Nov 21, 2023 · 0 comments
Open

Most indicators are working but mama. #25

murthybhatt opened this issue Nov 21, 2023 · 0 comments

Comments

@murthybhatt
Copy link

I am getting bunch of errors :
result[minidx:] = r = binop(other, *args, **kwargs) # exec / store
Traceback (most recent call last):
File "C:\IB\pyGame\ALGO_AMD.py", line 30, in
mama(amdDF).df
^^^^^^^^^^^
File "C:\IB\pyGame\venv\Lib\site-packages\btalib\indicator.py", line 152, in call
b_init(self, *args, **kwargs)
File "C:\IB\pyGame\venv\Lib\site-packages\btalib\indicators\mama.py", line 79, in init
_mama = p0._ewm(alpha=alpha, span=1, _seed=SEED_ZERO)._mean()
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\IB\pyGame\venv\Lib\site-packages\btalib\meta\lines.py", line 357, in _mean
return self._apply(_dynalpha) # triggers getattr for _apply
^^^^^^^^^^^^^^^^^^^^^^
File "C:\IB\pyGame\venv\Lib\site-packages\btalib\meta\lines.py", line 379, in call_op
result[self._minidx:] = r = op(*sargs, **kwargs) # run/store
^^^^^^^^^^^^^^^^^^^^
TypeError: BaseWindow._apply() missing 1 required positional argument: 'name'

My code:
from ib_insync import *
import btalib
import pandas
from btalib import *
from btalib import bbands

ib = IB()
ib.connect('127.0.0.1', 7497, clientId=0)

amd_contract = Stock('AMD', 'SMART', 'USD')

ib.qualifyContracts(amd_contract)
data = ib.reqMktData(amd_contract)
ib.sleep(1)
print(data.marketPrice())

historical_data_amd = ib.reqHistoricalData(
amd_contract,
'',
barSizeSetting='3 mins',
durationStr='2 D',
whatToShow='TRADES',
useRTH=True
)
amdDF = util.df(historical_data_amd)
#amdH = amdDF.filter(['high','low'])
#amdL = amdDF.fi
#print(amdDF.high)
#print (bbands(amdDF).df)
mama(amdDF).df

I Apricate your help .

Thanks

Murthy

# 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

1 participant