{"action":"created","issue":{"url":"https://api.github.com/repos/askmike/gekko/issues/1130","repository_url":"https://api.github.com/repos/askmike/gekko","labels_url":"https://api.github.com/repos/askmike/gekko/issues/1130/labels{/name}","comments_url":"https://api.github.com/repos/askmike/gekko/issues/1130/comments","events_url":"https://api.github.com/repos/askmike/gekko/issues/1130/events","html_url":"https://github.com/askmike/gekko/issues/1130","id":258662719,"number":1130,"title":"TALib RSI will not calculate value for 5 hours.","user":{"login":"score1more4me","id":11411320,"avatar_url":"https://avatars2.githubusercontent.com/u/11411320?v=4","gravatar_id":"","url":"https://api.github.com/users/score1more4me","html_url":"https://github.com/score1more4me","followers_url":"https://api.github.com/users/score1more4me/followers","following_url":"https://api.github.com/users/score1more4me/following{/other_user}","gists_url":"https://api.github.com/users/score1more4me/gists{/gist_id}","starred_url":"https://api.github.com/users/score1more4me/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/score1more4me/subscriptions","organizations_url":"https://api.github.com/users/score1more4me/orgs","repos_url":"https://api.github.com/users/score1more4me/repos","events_url":"https://api.github.com/users/score1more4me/events{/privacy}","received_events_url":"https://api.github.com/users/score1more4me/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":4,"created_at":"2017-09-19T00:49:52Z","updated_at":"2017-09-19T14:31:47Z","closed_at":null,"author_association":"NONE","body":"**Note: for support questions, please join our [Discord server](https://discord.gg/26wMygt)**\r\n\r\n* **I'm submitting a ...**\r\n[x ] bug report\r\n[ ] feature request\r\n[ ] question about the decisions made in the repository\r\n\r\n* **Action taken** (what you did)\r\n\r\nI rolled a TALib RSI\r\n\r\n* **Expected result** (what you hoped would happen)\r\nGekko would be able to calculate RSI from stored data.  It seems to take ~5 hours for RSI to calculate using 60 minute candles.\r\n\r\n* **Actual result** (unexpected outcome)\r\nundefined.\r\n\r\n* **Other information** (e.g. detailed explanation, stacktraces, related issues, suggestions how to fix, links for us to have context, eg. stackoverflow, etc)\r\n\r\n**startup**\r\n\r\n    ______   ________  __    __  __    __   ______\r\n   /      \\ /        |/  |  /  |/  |  /  | /      \\\r\n  /$$$$$$  |$$$$$$$$/ $$ | /$$/ $$ | /$$/ /$$$$$$  |\r\n  $$ | _$$/ $$ |__    $$ |/$$/  $$ |/$$/  $$ |  $$ |\r\n  $$ |/    |$$    |   $$  $$<   $$  $$<   $$ |  $$ |\r\n  $$ |$$$$ |$$$$$/    $$$$$  \\  $$$$$  \\  $$ |  $$ |\r\n  $$ \\__$$ |$$ |_____ $$ |$$  \\ $$ |$$  \\ $$ \\__$$ |\r\n  $$    $$/ $$       |$$ | $$  |$$ | $$  |$$    $$/\r\n   $$$$$$/  $$$$$$$$/ $$/   $$/ $$/   $$/  $$$$$$/\r\n\r\n        Gekko v0.4.10\r\n        I'm gonna make you rich, Bud Fox.\r\n\r\n\r\n2017-09-18 17:37:15 (INFO):     Setting up Gekko in realtime mode\r\n2017-09-18 17:37:15 (INFO):\r\n2017-09-18 17:37:15 (INFO):     Setting up:\r\n2017-09-18 17:37:15 (INFO):              Candle writer\r\n2017-09-18 17:37:15 (INFO):              Store candles in a database\r\n2017-09-18 17:37:15 (INFO):\r\n\r\n2017-09-18 17:37:15 (INFO):     Setting up:\r\n2017-09-18 17:37:15 (INFO):              Trading Advisor\r\n2017-09-18 17:37:15 (INFO):              Calculate trading advice\r\n2017-09-18 17:37:15 (INFO):              Using the strategy: talib-rsi\r\n2017-09-18 17:37:15 (INFO):             The trading method requests 600 minutes of historic data. Checking availablity..\r\n2017-09-18 17:37:15 (INFO):\r\n\r\n2017-09-18 17:37:15 (DEBUG):            Available local data:\r\n2017-09-18 17:37:15 (DEBUG):                    from: 600 minutes ago\r\n2017-09-18 17:37:15 (DEBUG):                    to: 2 minutes ago\r\n2017-09-18 17:37:15 (INFO):             Usable local data available, trying to match with exchange data..\r\n2017-09-18 17:37:15 (DEBUG):            Fetching exchange data since 17 minutes ago\r\n2017-09-18 17:37:15 (DEBUG):    Scanning back in the history needed...\r\n2017-09-18 17:37:15 (DEBUG):    2017-09-19T00:20:00+00:00\r\n2017-09-18 17:37:16 (DEBUG):    Scanning backwards...2017-09-19T00:36:40.789Z\r\n2017-09-18 17:37:16 (DEBUG):    Scanning backwards...2017-09-19T00:33:30.653Z\r\n2017-09-18 17:37:16 (DEBUG):    Scanning backwards...2017-09-19T00:26:41.134Z\r\n2017-09-18 17:37:17 (DEBUG):    Backwards: 2017-09-19T00:18:31.744Z (21086564) to 2017-09-19T00:23:00.709Z (21086663)\r\n2017-09-18 17:37:17 (DEBUG):    Backwards: 2017-09-19T00:23:02.336Z (21086664) to 2017-09-19T00:24:43.471Z (21086763)\r\n2017-09-18 17:37:17 (DEBUG):    Backwards: 2017-09-19T00:24:43.471Z (21086764) to 2017-09-19T00:26:32.57Z (21086863)\r\n2017-09-18 17:37:17 (DEBUG):    Backwards: 2017-09-19T00:26:41.134Z (21086864) to 2017-09-19T00:30:14.848Z (21086963)\r\n2017-09-18 17:37:18 (DEBUG):    Backwards: 2017-09-19T00:30:14.848Z (21086964) to 2017-09-19T00:33:22.841Z (21087063)\r\n2017-09-18 17:37:18 (DEBUG):    Backwards: 2017-09-19T00:33:30.653Z (21087064) to 2017-09-19T00:36:40.672Z (21087163)\r\n2017-09-18 17:37:18 (DEBUG):    Backwards: 2017-09-19T00:36:40.789Z (21087164) to 2017-09-19T00:37:14.68Z (21087263)\r\n2017-09-18 17:37:19 (DEBUG):    Backwards: 2017-09-19T00:36:41.539Z (21087165) to 2017-09-19T00:37:18.987Z (21087264)\r\n2017-09-18 17:37:19 (DEBUG):    Backwards: 2017-09-19T00:36:41.539Z (21087165) to 2017-09-19T00:37:18.987Z (21087264)\r\n2017-09-18 17:37:19 (DEBUG):    Scan finished: data found:900\r\n2017-09-18 17:37:19 (DEBUG):    Backwards: 2017-09-19T00:36:41.539Z (21087165) to 2017-09-19T00:37:18.987Z (21087264)\r\n2017-09-18 17:37:19 (DEBUG):    Scan finished: data found:900\r\n2017-09-18 17:37:19 (DEBUG):            Available exchange data:\r\n2017-09-18 17:37:19 (DEBUG):                    from: 18 minutes ago\r\n2017-09-18 17:37:19 (DEBUG):                    to: 0 minutes ago\r\n2017-09-18 17:37:19 (DEBUG):            Stitching datasets\r\n2017-09-18 17:37:19 (INFO):             Full history locally available. Seeding the trading method with all required historical candles.\r\n2017-09-18 17:37:19 (DEBUG):            Seeding with:\r\n2017-09-18 17:37:19 (DEBUG):                    from: 600 minutes ago\r\n2017-09-18 17:37:19 (DEBUG):                    to: 20 minutes ago\r\nundefined\r\nundefined\r\nundefined\r\nundefined\r\nundefined\r\nundefined\r\nundefined\r\nundefined\r\nundefined\r\n2017-09-18 17:37:19 (INFO):     Setting up:\r\n2017-09-18 17:37:19 (INFO):              IRC bot\r\n2017-09-18 17:37:19 (INFO):              IRC module lets you communicate with Gekko on IRC.\r\n2017-09-18 17:37:19 (INFO):\r\n\r\n2017-09-18 17:37:19 (INFO):     Setting up:\r\n2017-09-18 17:37:19 (INFO):              Trader\r\n2017-09-18 17:37:19 (INFO):              Follows the advice and create real orders.\r\n2017-09-18 17:37:19 (DEBUG):    getting balance & fee from GDAX\r\n2017-09-18 17:37:19 (INFO):\r\n\r\n2017-09-18 17:37:20 (INFO):     trading at GDAX ACTIVE\r\n2017-09-18 17:37:20 (INFO):     GDAX trading fee will be: 0.25%\r\n2017-09-18 17:37:20 (INFO):     GDAX portfolio:\r\n2017-09-18 17:37:20 (INFO):              USD: 200.032639102435\r\n2017-09-18 17:37:20 (INFO):              BTC: 0.100000000000\r\n2017-09-18 17:37:20 (INFO):     Setting up:\r\n2017-09-18 17:37:20 (INFO):              Advice logger\r\n2017-09-18 17:37:20 (INFO):\r\n2017-09-18 17:37:20 (INFO):     Starting to watch the market: GDAX BTC/USD\r\n2017-09-18 17:37:20 (DEBUG):    scheduling ticks\r\n2017-09-18 17:37:20 (DEBUG):    Requested BTC/USD trade data from GDAX ...\r\n2017-09-18 17:37:20 (DEBUG):    Scanning back in the history needed...\r\n2017-09-18 17:37:20 (DEBUG):    2017-09-19T00:20:00+00:00\r\n2017-09-18 17:37:20 (DEBUG):    Scanning backwards...2017-09-19T00:36:41.641Z\r\n2017-09-18 17:37:20 (DEBUG):    Scanning backwards...2017-09-19T00:33:32.261Z\r\n2017-09-18 17:37:20 (DEBUG):    Scanning backwards...2017-09-19T00:26:44.811Z\r\n2017-09-18 17:37:20 (DEBUG):    Backwards: 2017-09-19T00:18:41.815Z (21086566) to 2017-09-19T00:23:03.704Z (21086665)\r\n2017-09-18 17:37:21 (DEBUG):    Backwards: 2017-09-19T00:23:03.704Z (21086666) to 2017-09-19T00:24:43.471Z (21086765)\r\n2017-09-18 17:37:21 (DEBUG):    Backwards: 2017-09-19T00:24:43.471Z (21086766) to 2017-09-19T00:26:42.113Z (21086865)\r\n2017-09-18 17:37:21 (DEBUG):    Backwards: 2017-09-19T00:23:03.704Z (21086666) to 2017-09-19T00:24:43.471Z (21086765)\r\n2017-09-18 17:37:21 (DEBUG):    Backwards: 2017-09-19T00:24:43.471Z (21086766) to 2017-09-19T00:26:42.113Z (21086865)\r\n2017-09-18 17:37:21 (DEBUG):    Backwards: 2017-09-19T00:26:44.811Z (21086866) to 2017-09-19T00:30:14.848Z (21086965)\r\n2017-09-18 17:37:21 (DEBUG):    Backwards: 2017-09-19T00:30:14.848Z (21086966) to 2017-09-19T00:33:32.07Z (21087065)\r\n2017-09-18 17:37:21 (DEBUG):    Backwards: 2017-09-19T00:33:32.261Z (21087066) to 2017-09-19T00:36:41.539Z (21087165)\r\n2017-09-18 17:37:22 (DEBUG):    Backwards: 2017-09-19T00:36:41.641Z (21087166) to 2017-09-19T00:37:19.302Z (21087265)\r\n2017-09-18 17:37:22 (DEBUG):    Backwards: 2017-09-19T00:36:41.709Z (21087169) to 2017-09-19T00:37:21.887Z (21087268)\r\n2017-09-18 17:37:22 (DEBUG):    Backwards: 2017-09-19T00:36:42.139Z (21087171) to 2017-09-19T00:37:22.305Z (21087270)\r\n2017-09-18 17:37:22 (DEBUG):    Backwards: 2017-09-19T00:36:42.139Z (21087171) to 2017-09-19T00:37:22.305Z (21087270)\r\n2017-09-18 17:37:22 (DEBUG):    Scan finished: data found:1000\r\n2017-09-18 17:37:22 (DEBUG):    Processing 1000 new trades. From 2017-09-19 00:18:41 UTC to 2017-09-19 00:37:22 UTC. (19 minutes)\r\nundefined\r\n2017-09-18 17:37:40 (DEBUG):    Requested BTC/USD trade data from GDAX ...\r\n2017-09-18 17:37:40 (DEBUG):    Processing 8 new trades. From 2017-09-19 00:37:26 UTC to 2017-09-19 00:37:39 UTC. (a few seconds)\r\n2017-09-18 17:38:00 (DEBUG):    Requested BTC/USD trade data from GDAX ...\r\n2017-09-18 17:38:00 (DEBUG):    Processing 6 new trades. From 2017-09-19 00:37:42 UTC to 2017-09-19 00:37:59 UTC. (a few seconds)\r\n2017-09-18 17:38:20 (DEBUG):    Requested BTC/USD trade data from GDAX ...\r\n2017-09-18 17:38:20 (DEBUG):    Processing 19 new trades. From 2017-09-19 00:38:00 UTC to 2017-09-19 00:38:18 UTC. (a few seconds)\r\n2017-09-18 17:38:40 (DEBUG):    Requested BTC/USD trade data from GDAX ...\r\n2017-09-18 17:38:40 (DEBUG):    Processing 28 new trades. From 2017-09-19 00:38:21 UTC to 2017-09-19 00:38:37 UTC. (a few seconds)\r\n2017-09-18 17:39:00 (DEBUG):    Requested BTC/USD trade data from GDAX ...\r\n2017-09-18 17:39:00 (DEBUG):    Processing 24 new trades. From 2017-09-19 00:38:41 UTC to 2017-09-19 00:38:58 UTC. (a few seconds)\r\n2017-09-18 17:39:20 (DEBUG):    Requested BTC/USD trade data from GDAX ...\r\n2017-09-18 17:39:20 (DEBUG):    Processing 37 new trades. From 2017-09-19 00:39:00 UTC to 2017-09-19 00:39:19 UTC. (a few seconds)\r\n2017-09-18 17:39:40 (DEBUG):    Requested BTC/USD trade data from GDAX ...\r\n2017-09-18 17:39:40 (DEBUG):    Processing 16 new trades. From 2017-09-19 00:39:22 UTC to 2017-09-19 00:39:38 UTC. (a few seconds)\r\n\r\n**end**\r\n\r\nYou can see, it's not pretty.  But anywhere it says undefined, it's trying to emit the RSI to console.\r\n\r\nAnd ~/gekko/strategies/talib-rsi.js\r\n\r\n```\r\n// If you want to use your own trading methods you can\r\n// write them here. For more information on everything you\r\n// can use please refer to this document:\r\n//\r\n// https://github.com/askmike/gekko/blob/stable/docs/trading_methods.md\r\n\r\nvar config = require('../core/util.js').getConfig();\r\nvar settings = config['talib-rsi'];\r\nvar log = require('../core/log.js');\r\n\r\n// Let's create our own method\r\nvar method = {};\r\n\r\n\r\n// prepare everything our method needs\r\nmethod.init = function() {\r\n  this.name = 'talib-rsi';\r\n\r\n  this.trend = {\r\n    direction: 'none',\r\n    duration: 0,\r\n    persisted: false,\r\n    adviced: false\r\n  };\r\n\r\n  this.requiredHistory = config.tradingAdvisor.historySize;\r\n\r\nvar customRSISettings = settings.parameters;\r\n\r\n  // define the indicators we need\r\n  this.addTalibIndicator('myrsi', 'rsi', customRSISettings);\r\n}\r\n\r\n// What happens on every new candle?\r\nmethod.update = function(candle) {\r\n  var rsi =  this.talibIndicators.myrsi.result.outReal;\r\n  console.log(rsi);\r\n\r\n}\r\n\r\nmethod.log = function(candle) {\r\n  var rsi =  this.talibIndicators.myrsi.result.outReal;\r\n\r\n}\r\n\r\nmethod.check = function() {\r\n  var rsi = this.talibIndicators.myrsi.result.outReal;\r\n  var rsiVal = this.talibIndicators.myrsi.result.outReal;\r\n  var rsi = this.talibIndicators.myrsi.result.outReal;\r\n  var rsiVal = this.talibIndicators.myrsi.result.outReal;\r\n  var digits = 8;\r\n  console.log(rsi);\r\n\r\n  if(rsiVal > settings.thresholds.high) {\r\n\r\n    // new trend detected\r\n    if(this.trend.direction !== 'high')\r\n      this.trend = {\r\n        duration: 0,\r\n        persisted: false,\r\n        direction: 'high',\r\n        adviced: false\r\n      };\r\n\r\n    this.trend.duration++;\r\n\r\n    log.debug('In high since', this.trend.duration, 'candle(s)');\r\n\r\n    if(this.trend.duration >= settings.thresholds.persistence)\r\n      this.trend.persisted = true;\r\n\r\n    if(this.trend.persisted && !this.trend.adviced) {\r\n      this.trend.adviced = true;\r\n      this.advice('short');\r\n    } else\r\n      this.advice();\r\n\r\n  } else if(rsiVal < settings.thresholds.low) {\r\n\r\n    // new trend detected\r\n    if(this.trend.direction !== 'low')\r\n      this.trend = {\r\n        duration: 0,\r\n        persisted: false,\r\n        direction: 'low',\r\n        adviced: false\r\n      };\r\n\r\n    this.trend.duration++;\r\n\r\n    log.debug('In low since', this.trend.duration, 'candle(s)');\r\n\r\n    if(this.trend.duration >= settings.thresholds.persistence)\r\n      this.trend.persisted = true;\r\n    if(this.trend.persisted && !this.trend.adviced) {\r\n      this.trend.adviced = true;\r\n    if(this.trend.persisted && !this.trend.adviced) {\r\n      this.trend.adviced = true;\r\n      this.advice('long');\r\n    } else\r\n      this.advice();\r\n\r\n  } else {\r\n\r\n    log.debug('In no trend');\r\n\r\n    this.advice();\r\n  }\r\n}\r\n\r\n\r\nmodule.exports = method;\r\n\r\n```\r\n---------------\r\n"},"comment":{"url":"https://api.github.com/repos/askmike/gekko/issues/comments/330558734","html_url":"https://github.com/askmike/gekko/issues/1130#issuecomment-330558734","issue_url":"https://api.github.com/repos/askmike/gekko/issues/1130","id":330558734,"user":{"login":"askmike","id":969743,"avatar_url":"https://avatars0.githubusercontent.com/u/969743?v=4","gravatar_id":"","url":"https://api.github.com/users/askmike","html_url":"https://github.com/askmike","followers_url":"https://api.github.com/users/askmike/followers","following_url":"https://api.github.com/users/askmike/following{/other_user}","gists_url":"https://api.github.com/users/askmike/gists{/gist_id}","starred_url":"https://api.github.com/users/askmike/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/askmike/subscriptions","organizations_url":"https://api.github.com/users/askmike/orgs","repos_url":"https://api.github.com/users/askmike/repos","events_url":"https://api.github.com/users/askmike/events{/privacy}","received_events_url":"https://api.github.com/users/askmike/received_events","type":"User","site_admin":false},"created_at":"2017-09-19T14:31:47Z","updated_at":"2017-09-19T14:31:47Z","author_association":"OWNER","body":"> I updated to current release; I see the bug with too many decimals on GDAX in August... \r\n\r\nThat's a completely different issue, please open a new one for it and I'll ping some people more familar with GDAX."}}
{"actor":{"display_login":"askmike"}}