anandanand84 / technicalindicators

A javascript technical indicators written in typescript with pattern recognition right in the browser
MIT License
2.18k stars 566 forks source link

Having issues with CCXT Example and Tensor Flow #171

Closed bugs181 closed 4 years ago

bugs181 commented 5 years ago

Also having issues with tensor flow here. Came from a CCXT example and this particular code:


Code:

const retrieveMACD = (klines) => {
  const closes = klines.map(kline => kline[4])
  var macdInput = {
    values: closes,
    fastPeriod: 12,
    slowPeriod: 26,
    signalPeriod: 9,
    SimpleMAOscillator: false,
    SimpleMASignal: false,
  }

  const macdResults = MACD.calculate(macdInput)
  return macdResults
}

Output:

(node:1308) UnhandledPromiseRejectionWarning: Error: Cannot evaluate flag 'EPSILON': no evaluation function found.
    at Environment.evaluateFlag (/.../node_modules/.registry.npmjs.org/@tensorflow/tfjs-core/1.1.0/node_modules/@tensorflow/tfjs-core/dist/environment.js:75:19)
    at Environment.get (/.../node_modules/.registry.npmjs.org/@tensorflow/tfjs-core/1.1.0/node_modules/@tensorflow/tfjs-core/dist/environment.js:44:37)
    at Object.<anonymous> (/.../node_modules/@tensorflow/tfjs-layers/dist/backend/common.js:4:32)
    at Module._compile (internal/modules/cjs/loader.js:707:30)
    at Object.Module._extensions..js (internal/modules/cjs/loader.js:718:10)
    at Module.load (internal/modules/cjs/loader.js:605:32)
    at tryModuleLoad (internal/modules/cjs/loader.js:544:12)
    at Function.Module._load (internal/modules/cjs/loader.js:536:3)
    at Module.require (internal/modules/cjs/loader.js:643:17)
    at require (internal/modules/cjs/helpers.js:22:18)
(node:1308) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). (rejection id: 1)
(node:1308) [DEP0018] DeprecationWarning: Unhandled promise rejections are deprecated. In the future, promise rejections that are not handled will terminate the Node.js process with a non-zero exit code.
bugs181 commented 5 years ago

Related #157

bugs181 commented 5 years ago

Update: Switched from pnpm to npm and made no difference.

anandanand84 commented 4 years ago

Tensorflow removed in 3.0. It should work now