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

Can't get it to work - am I doing something wrong? #6

Closed
aomega opened this issue May 8, 2013 · 2 comments
Closed

Can't get it to work - am I doing something wrong? #6

aomega opened this issue May 8, 2013 · 2 comments

Comments

@aomega
Copy link
Contributor

aomega commented May 8, 2013

Hi,

This is on v0.2.9 of node-talib on 64bit Ubuntu 13.04. Node v0.10.5

The library seemed to build correctly from npm.

> talib@0.2.9 preinstall /home/jr/workspace/tasar/node_modules/talib
> cd ./src/lib && node build.js && cd ../../ && node-gyp configure && node-gyp build

building talib functions...
make: Entering directory `/home/jr/workspace/tasar/node_modules/talib/build'
  CXX(target) Release/obj.target/talib/src/talib.o
  SOLINK_MODULE(target) Release/obj.target/talib.node
  SOLINK_MODULE(target) Release/obj.target/talib.node: Finished
  COPY Release/talib.node
make: Leaving directory `/home/jr/workspace/tasar/node_modules/talib/build'

The following test seemingly produces garbage in the result array:-

var talib = require('talib');
talib.execute({
                name: "SMA",
                startIdx: 0,
                endIdx: 4,
                inReal: [1.0, 1.0, 1.0, 1.0, 1.0],
                optInTimePeriod: 2
            }, function (result) {
                console.log(JSON.stringify(result));

            })

Results vary. For example, this is 3 runs:

{"begIndex":1,"nbElement":4,"result":{"outReal":[9.121659968796e-311,2.1334585e-    317,2.133458e-317,3.4766123620452e-310,0]}}
jr@jr-13-04:~/workspace/tasar$ node test.js
{"begIndex":1,"nbElement":4,"result":{"outReal":[null,null,null,null,0]}}
jr@jr-13-04:~/workspace/tasar$ node test.js
{"begIndex":1,"nbElement":4,"result":{"outReal":[1.5086519287736e-311,2.1334585e-    317,2.133458e-317,3.47666280419233e-310,0]}}

Kind regards,

  • Alfred
@aomega
Copy link
Contributor Author

aomega commented May 9, 2013

This was down to the inReal parameter passing being incorrect. I've fixed it and submitted a pull request.

@oransel
Copy link
Owner

oransel commented May 9, 2013

I apologize for the delay and thank you for quick fix. I'll review and pull the changes.

@oransel oransel closed this as completed May 9, 2013
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