Skip to content

Commit

Permalink
FeelsDirtyMan | Removed @fomobro/talib-fomo usage from modules/fomobot
Browse files Browse the repository at this point in the history
  • Loading branch information
schwindy committed Apr 21, 2020
1 parent 11e3804 commit 4291591
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 22 deletions.
4 changes: 1 addition & 3 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -63,9 +63,7 @@ jobs:
shell: bash.exe
name: NPM Install (fomo-native)
- run:
command: mkdir modules/talib-fomo/build
&& mkdir modules/talib-fomo/build/Release
&& cp -a apps/fomo-native/bin/talib.node modules/talib-fomo/build/Release
command: cp -a apps/fomo-native/bin/talib.node modules/talib-fomo/build/Release
shell: bash.exe
name: Copy Precompiled talib.node to modules/talib-fomo
- run:
Expand Down
38 changes: 19 additions & 19 deletions modules/fomobot/lib/ta_ultosc.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
var talib = require('@fomobro/talib-fomo')
// var talib = require('@fomobro/talib-fomo')

module.exports = function ultosc(s, min_periods, timeperiod1, timeperiod2, timeperiod3) {
return new Promise(function(resolve, reject) {
Expand Down Expand Up @@ -29,24 +29,24 @@ module.exports = function ultosc(s, min_periods, timeperiod1, timeperiod2, timep
let tmpClose = s.marketData.close.slice()
tmpClose.push(s.period.close)

talib.execute({
name: 'ULTOSC',
startIdx: 0,
endIdx: tmpHigh.length -1,
high: tmpHigh,
low: tmpLow,
close: tmpClose,
optInTimePeriod1: timeperiod1,
optInTimePeriod2: timeperiod2,
optInTimePeriod3: timeperiod3,
}, function (err, result) {
if (err) {
reject(err, result)
return
}

resolve(result.result.outReal[(result.nbElement - 1)])
})
// talib.execute({
// name: 'ULTOSC',
// startIdx: 0,
// endIdx: tmpHigh.length -1,
// high: tmpHigh,
// low: tmpLow,
// close: tmpClose,
// optInTimePeriod1: timeperiod1,
// optInTimePeriod2: timeperiod2,
// optInTimePeriod3: timeperiod3,
// }, function (err, result) {
// if (err) {
// reject(err, result)
// return
// }
//
// resolve(result.result.outReal[(result.nbElement - 1)])
// })
})
}

0 comments on commit 4291591

Please sign in to comment.