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

Functions not returning all results (ex. MA) #2

Closed
bkelemen56 opened this issue Jun 19, 2012 · 1 comment
Closed

Functions not returning all results (ex. MA) #2

bkelemen56 opened this issue Jun 19, 2012 · 1 comment

Comments

@bkelemen56
Copy link

Hi,

Thanks for putting this Python wrapper together.

I tried to install on Windows, but unfortunately I was not able to get it working. Switched into my Linux VM and was able to install easily.

I notice in the example.py script that the TA functions are not returning the indicated results. For example:

i, odata = talib.MA(idata)

only returns an array so it has to be changed to

odata = talib.MA(idata)

Was this change done by design or was there something wrong in the build. I noticed in talib.pxy that this MA function is only returning one value so that seems to be the cause.

def MA( np.ndarray[np.double_t, ndim=1] real , timeperiod=-2**31 , matype=0 ):
"""MA(real[, timeperiod=?, matype=?])
....
return outreal

Thanks
Bill

@mrjbq7
Copy link
Collaborator

mrjbq7 commented Jun 19, 2012

You're right - the example was using the old API that returns a tuple of a lookback index and the data array. The new API has a single array with the lookback filled with NaNs. This is fixed in 3e785ca.

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