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

run example cdlhammer.js produces undefined #42

Closed
robomotic opened this issue May 2, 2017 · 6 comments
Closed

run example cdlhammer.js produces undefined #42

robomotic opened this issue May 2, 2017 · 6 comments

Comments

@robomotic
Copy link

Hello there,
I have just installed the TA lib from npm with:
TALib Version: 1.0.2
I then run the cdlhammer.js on the input example json and I get undefined.
However if I do:
console.log(err)
I can see a time series which looks like the result e.g. a list with 0s and some 100s .
I am wondering if somehow the call back has swapped results with error?

@robomotic
Copy link
Author

So basically this works:

// execute CDLHAMMER indicator function
talib.execute({
    name: "CDLHAMMER",
    startIdx: 0,
    endIdx: marketData.close.length - 1,
    open: marketData.open,
    high: marketData.high,
    low: marketData.low,
    close: marketData.close
}, function (err, result) {
	// Show the result array
    console.log("CDLHAMMER Function Results:");
    //console.log(err)
    console.log(err.result.outInteger.splice(0,50));

});

@inanisvitae
Copy link

it's all undefined

@oransel
Copy link
Owner

oransel commented May 30, 2017

good catch. latest version was not published to npm. try v1.0.3.

@oransel oransel closed this as completed May 30, 2017
@inanisvitae
Copy link

It's fine lol. It turns out that the err in callback is actually the result

@oransel
Copy link
Owner

oransel commented May 30, 2017

yep, the repo was updated but the latest version was not pushed to npm to reflect the change. it was an update for another request.

@inanisvitae
Copy link

It's good work

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