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

BBANDS and MACD examples #9

Closed
pergamonster opened this issue Jul 10, 2013 · 1 comment
Closed

BBANDS and MACD examples #9

pergamonster opened this issue Jul 10, 2013 · 1 comment

Comments

@pergamonster
Copy link

Could someone please post some working examples of MACD and/or BBANDS.
I am getting an unexpected:

TALib Version: 0.2.9
BBANDS Function Results:
{ error: 'First argument must contain '%s' field' }

when i run

var talib = require("../build/Release/talib");
var fs = require("fs");

// Display module version
console.log();
console.log("TALib Version: " + talib.version);

// Load market data
var marketContents = fs.readFileSync('examples/marketdata.json','utf8');
var marketData = JSON.parse(marketContents);

// execute ADX indicator function with time period 9
talib.execute({
name: "BBANDS",
startIdx: 0,
endIdx: marketData.close.length - 1,
inReal: marketData.close,
optInTimePeriod: 180
}, function (result) {

// Show the result array
console.log("BBANDS Function Results:");
console.log(result);

});

@oransel
Copy link
Owner

oransel commented Jul 11, 2013

Thank you for pointing out the bug with the error string generation. Please try with the latest version. It should tell you the missing parameter.

@oransel oransel closed this as completed Jul 18, 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