Skip to content

Instantly share code, notes, and snippets.

@samuelhei
Created August 25, 2015 17:13
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save samuelhei/eac5c905390c999a28e1 to your computer and use it in GitHub Desktop.
Save samuelhei/eac5c905390c999a28e1 to your computer and use it in GitHub Desktop.
var talib = require("talib");
module.exports = function(name, inReal, optInTimePeriod, callback) {
talib.execute({
name: name,
startIdx: 0,
endIdx: inReal.length - 1,
inReal: inReal,
optInTimePeriod: optInTimePeriod
}, function(result) {
if(typeof(result.result) == 'undefined') {
callback([]);
}
else{
callback(result.result.outReal);
}
});
};
@samuelhei
Copy link
Author

            var gerasma1 = function() {
                var d = Q.defer();
                ta('SMA', dados, 200, function(result) {
                    sma1 = result;
                    d.resolve();
                });
                return d.promise;
            };

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment