I'm submitting a ...
[X ] bug report
[ ] question about the decisions made in the repository
Action taken (what you did)
Running trader (NEO strategy) via CLI (Gekko 6.2); app reaches setting up market watcher
Expected result (what you hoped would happen)
Running Strategy
Actual result (unexpected outcome)
App crashes:
TypeError: cb is not a function
at afterWrite (_stream_writable.js:464:3)
at _combinedTickCallback (internal/process/next_tick.js:144:20)
at process._tickDomainCallback (internal/process/next_tick.js:218:9)
Can you post more logs? With debug turned on.
That's it - after that Gekko crashes. Debug set to true also doesn't provide any more info. Binance market btw. Other strategy seems to work fine.
Are there no other logs? Like the gekko logo? Having this means we can see
exactly where gekko crashes.
On Wed, 18 Jul 2018, 17:54 moodyswing, notifications@github.com wrote:
That's it - after that Gekko crashes. Debug set to true also doesn't
provide any more info. Binance market btw. Other strategy seems to work
fine.—
You are receiving this because you commented.
Reply to this email directly, view it on GitHub
https://github.com/askmike/gekko/issues/2329#issuecomment-405877362, or mute
the thread
https://github.com/notifications/unsubscribe-auth/AA7MD1IIzQyVwYgcIi4jhJKUk7CSdZlxks5uHwXxgaJpZM4VTgwE
.
Well, ok. I'll post the whole log later on today.
Thanks! Because if it happens during initialisation we can see if it
happens during plugin load, or if not which plugins are loaded.
On Wed, Jul 18, 2018 at 7:47 PM, moodyswing notifications@github.com
wrote:
Well, ok. I'll post whole log later on today.
—
You are receiving this because you commented.
Reply to this email directly, view it on GitHub
https://github.com/askmike/gekko/issues/2329#issuecomment-405903259, or mute
the thread
https://github.com/notifications/unsubscribe-auth/AA7MD5inxAJggYxtYfnv-9C9e2qXlNSGks5uHyA7gaJpZM4VTgwE
.
--
PGP key at keybase.io/mikevanrossum
https://keybase.io/mikevanrossum/key.asc
If your history has empty data this error occurs. For example, a new coin has 1 hour of market data on binance but you imported 1 day. ( gekko needs at least one day import)
try to remove history db and restart strategy..
@salihcirgan Thx, will try it out.
Here's the log, debug is set to true:
______ ________ __ __ __ __ ______
/ \ / |/ | / |/ | / | / \
/$$$$$$ |$$$$$$$$/ $$ | /$$/ $$ | /$$/ /$$$$$$ |
$$ | _$$/ $$ |__ $$ |/$$/ $$ |/$$/ $$ | $$ |
$$ |/ |$$ | $$ $$< $$ $$< $$ | $$ |
$$ |$$$$ |$$$$$/ $$$$$ \ $$$$$ \ $$ | $$ |
$$ __$$ |$$ |_____ $$ |$$ \ $$ |$$ \ $$ __$$ |
$$ $$/ $$ |$$ | $$ |$$ | $$ |$$ $$/
$$$$$$/ $$$$$$$$/ $$/ $$/ $$/ $$/ $$$$$$/
Gekko v0.6.2
I'm gonna make you rich, Bud Fox.
2018-07-17 22:19:14 (INFO): Setting up Gekko in realtime mode
2018-07-17 22:19:14 (INFO):
2018-07-17 22:19:14 (INFO): Setting up:
2018-07-17 22:19:14 (INFO): Candle writer
2018-07-17 22:19:14 (INFO): Store candles in a database
2018-07-17 22:19:14 (INFO):
2018-07-17 22:19:14 (INFO): Setting up:
2018-07-17 22:19:14 (INFO): Trading Advisor
2018-07-17 22:19:14 (INFO): Calculate trading advice
2018-07-17 22:19:14 (INFO): Using the strategy: NEO
2018-07-17 22:19:14 (ERROR): Failed to load indicator Alligator
2018-07-17 22:19:14 (ERROR): Failed to load indicator HEIKEN
2018-07-17 22:19:15 (ERROR): Failed to load indicator RSI-beta
2018-07-17 22:19:17 (INFO): The trading method requests 150 minutes of historic data. Checking availablity..
2018-07-17 22:19:17 (INFO):
2018-07-17 22:19:17 (INFO): Usable local data available, trying to match with exchange data..
2018-07-17 22:19:18 (INFO): Full history locally available. Seeding the trading method with all required historical candles.
2018-07-17 22:19:18 (INFO): Setting up:
2018-07-17 22:19:18 (INFO): Trader
2018-07-17 22:19:18 (INFO): Follows the advice and create real orders.
2018-07-17 22:19:18 (INFO):
2018-07-17 22:19:24 (INFO): Portfolio:
2018-07-17 22:19:24 (INFO): xxx BNB
2018-07-17 22:19:24 (INFO): xxx ADX
2018-07-17 22:19:24 (INFO): Balance:
2018-07-17 22:19:24 (INFO): xxx BNB
2018-07-17 22:19:24 (INFO): Exposed:
2018-07-17 22:19:24 (INFO): yes (65.43%)
2018-07-17 22:19:24 (INFO): Setting up:
2018-07-17 22:19:24 (INFO): Performance Analyzer
2018-07-17 22:19:24 (INFO): Analyzes performances of trades
2018-07-17 22:19:24 (INFO):
2018-07-17 22:19:24 (INFO): Starting to watch the market: Binance ADX/BNB
TypeError: cb is not a function
at afterWrite (_stream_writable.js:464:3)
at _combinedTickCallback (internal/process/next_tick.js:144:20)
at process._tickDomainCallback (internal/process/next_tick.js:218:9)
I see this exact problem if DB has null data. Every time DB deletion or if full history is available problem gone. maybe, you have something different.
did you backup and delete all history DB files under "history" directory?
@salihcirgan I've just finished importing and running simple test :) It seems to work now. Strange, as I'm pretty sure that db wasn't empty...
Interesting, I'll have a look at that. Thanks @salihcirgan.
Another funny thing - thing seemed to be working, but after yet enother crash (logs below) TypeError: cb is not a functionis back again...
______ ________ __ __ __ __ ______
/ \ / |/ | / |/ | / | / \
/$$$$$$ |$$$$$$$$/ $$ | /$$/ $$ | /$$/ /$$$$$$ |
$$ | _$$/ $$ |__ $$ |/$$/ $$ |/$$/ $$ | $$ |
$$ |/ |$$ | $$ $$< $$ $$< $$ | $$ |
$$ |$$$$ |$$$$$/ $$$$$ \ $$$$$ \ $$ | $$ |
$$ __$$ |$$ |_____ $$ |$$ \ $$ |$$ \ $$ __$$ |
$$ $$/ $$ |$$ | $$ |$$ | $$ |$$ $$/
$$$$$$/ $$$$$$$$/ $$/ $$/ $$/ $$/ $$$$$$/
Gekko v0.6.2
I'm gonna make you rich, Bud Fox.
2018-07-18 17:57:17 (INFO): Setting up Gekko in realtime mode
2018-07-18 17:57:17 (INFO):
2018-07-18 17:57:17 (INFO): Setting up:
2018-07-18 17:57:17 (INFO): Candle writer
2018-07-18 17:57:17 (INFO): Store candles in a database
2018-07-18 17:57:17 (INFO):
2018-07-18 17:57:17 (INFO): Setting up:
2018-07-18 17:57:17 (INFO): Trading Advisor
2018-07-18 17:57:17 (INFO): Calculate trading advice
2018-07-18 17:57:17 (INFO): Using the strategy: NEO
2018-07-18 17:57:17 (ERROR): Failed to load indicator Alligator
2018-07-18 17:57:18 (ERROR): Failed to load indicator HEIKEN
2018-07-18 17:57:18 (ERROR): Failed to load indicator RSI-beta
2018-07-18 17:57:20 (INFO): The trading method requests 150 minutes of historic data. Checking availablity..
2018-07-18 17:57:20 (INFO):
2018-07-18 17:57:20 (INFO): Usable local data available, trying to match with exchange data..
2018-07-18 17:57:20 (INFO): Not seeding locally available data to the trading method.
2018-07-18 17:57:20 (INFO): The exchange does not return enough data. 0 minutes are still missing.
2018-07-18 17:57:20 (INFO): Setting up:
2018-07-18 17:57:20 (INFO): Trader
2018-07-18 17:57:20 (INFO): Follows the advice and create real orders.
2018-07-18 17:57:20 (INFO):
2018-07-18 17:57:26 (INFO): Portfolio:
2018-07-18 17:57:26 (INFO): xxxBNB
2018-07-18 17:57:26 (INFO): xxxADX
2018-07-18 17:57:26 (INFO): Balance:
2018-07-18 17:57:26 (INFO): xxxBNB
2018-07-18 17:57:26 (INFO): Exposed:
2018-07-18 17:57:26 (INFO): yes (67.20%)
2018-07-18 17:57:26 (INFO): Setting up:
2018-07-18 17:57:26 (INFO): Performance Analyzer
2018-07-18 17:57:26 (INFO): Analyzes performances of trades
2018-07-18 17:57:26 (INFO):
2018-07-18 17:57:26 (INFO): Starting to watch the market: Binance ADX/BNB
2018-07-18 20:35:48 (INFO): Trader Received advice to go short. Selling ADX
Error: Lot size is too small
at StickyOrder.submit (/home/pi/gekko/exchange/orders/order.js:69:13)
at StickyOrder.createOrder (/home/pi/gekko/exchange/orders/sticky.js:121:10)
at StickyOrder.create (/home/pi/gekko/exchange/orders/sticky.js:68:10)
at syncPrivateData (/home/pi/gekko/exchange/gekkoBroker.js:141:13)
at /home/pi/gekko/exchange/node_modules/async/dist/async.js:3874:9
at /home/pi/gekko/exchange/node_modules/async/dist/async.js:473:16
at replenish (/home/pi/gekko/exchange/node_modules/async/dist/async.js:993:25)
at iterateeCallback (/home/pi/gekko/exchange/node_modules/async/dist/async.js:983:17)
at /home/pi/gekko/exchange/node_modules/async/dist/async.js:958:16
at Timeout._onTimeout (/home/pi/gekko/exchange/node_modules/async/dist/async.js:3871:13)
I had the same "cb is not a function" error.
Tried deleting node_module and npm install -- same error.
Restored a backup db -- works.
I'm using sqllite as db.
I get this error anytime I have done an import of data and then try to run a strategy after that requires history. When the DataSticher has to piece together both local and exchange data, it when this is happening 100% for me. I have been trying to dig out the unique functionality that is ran in this scenario to find the issue.
I'm having the same issue. In the config file, I set candleWriter to false for now to get around this bug.
Got the same issue, I have deleted the "node_modules" folder then run npm i --only-production in both root and "exchange" folders to solve it.
Same problem here but the @crypto49er's solution doesn't work for me :/
Once import was done, I ran the paper trader config and the error occurs only it's not needed to import the remaining data if i'm right.
@nicolasbonnici, npm i --only-production will create new "node_modules" folder in both root and exchange ?
@GuysmoB Nope only in the current folder that's why you need to it twice, once at the root folder and a second time in the exchange folder.
@nicolasbonnici, your method doesn't work for me. You didn't do something else ?
@GuysmoB Nope just deleted both node_modules/ and exchange/node_modules then reinstall all dependencies in both folders.
Deleting both node_modules folders worked for me, thanks. Wasn't that horrible since it looped in pm2 until it eventually worked, but this is nicer.
I have this often when a market watcher (UI) is running and i start the tradebot (CLI) for the same pair. After stopping the market watcher it works for me.
Deleting the node_modules folders and reinstalling them work if you don't use the import process to update the historical data. If you update, you will get the same error. My workaround, which I should have clarify, will not work if you try to use historical data. I think we need a real fix for this, not a workaround.
@crypto49er
I am unable to reproduce this. Are you running on windows? sqlite? etc.
On Mon, Aug 27, 2018 at 2:33 AM, Jack Crypto49er notifications@github.com
wrote:
Deleting the node_modules folders and reinstalling them work if you don't
use the import process to update the historical data. If you update, you
will get the same error. My workaround, which I should have clarify, will
not work if you try to use historical data. I think we need a real fix for
this, not a workaround.—
You are receiving this because you commented.
Reply to this email directly, view it on GitHub
https://github.com/askmike/gekko/issues/2329#issuecomment-416059154, or mute
the thread
https://github.com/notifications/unsubscribe-auth/AA7MD7nImRLVrT4KwM6RPU0QhIEf6S7Eks5uUuoIgaJpZM4VTgwE
.
--
PGP key at keybase.io/mikevanrossum
https://keybase.io/mikevanrossum/key.asc
@askmike
I'm running on a Mac with sqlite. I believe I am able to replicate this on Linux as well. I will confirm shortly and also provide the exact steps.
Thanks! Would love to reproduce this.
On Mon, 27 Aug 2018, 22:36 Jack Crypto49er, notifications@github.com
wrote:
@askmike https://github.com/askmike
I'm running on a Mac with sqlite. I believe I am able to replicate this on
Linux as well. I will confirm shortly and also provide the exact steps.—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
https://github.com/askmike/gekko/issues/2329#issuecomment-416248183, or mute
the thread
https://github.com/notifications/unsubscribe-auth/AA7MD8aRk1psJrAUnEoUYzXUFP8_ZRqOks5uVAP6gaJpZM4VTgwE
.
Hi,
I've the same error, on version 0.6.6 today
My config is a Debian 9 with NodeJS v8.11.4 on Gekko CLI only (no UI).
The strategie is RSI_BULL_BEAR_ADX using 1225 minutes of historic data with all datas neede:
Full history locally available. Seeding the trading method with all required historical candles
I also got before this error :
2018-08-27 15:24:16 (WARN): NOT creating order! Reason: Lot size is too small
even if the ORDER went well on Binance.
Hellpppp : )
Sorry but I have a lot of troubles with the 0.6.x branch and the 0.5.14 is not working on Binance anymore.
Let me know if you need any other infos to help reproduce it.
p.s.: @askmike > I can share with you the access to the Instance (SSH) if you want to check
@askmike
Here are the steps to replicate this issue:
I know people are running into this error with other exchanges, trade pairs and strategies. I haven't been able to replicate this on command with other trade pairs I suspect because Gekko doesn't try to stitch the local data with data from the exchange. I'm quite certain once it tries to stitch the data together, the historical data get corrupted and the user have to re-download that data set, which is a huge pain (unless they backed it up beforehand).
Here's how it looks from Terminal:
crypto49er (stable *) gekko $ node gekko --config sample-config.js
______ ________ __ __ __ __ ______
/ \ / |/ | / |/ | / | / \
/$$$$$$ |$$$$$$$$/ $$ | /$$/ $$ | /$$/ /$$$$$$ |
$$ | _$$/ $$ |__ $$ |/$$/ $$ |/$$/ $$ | $$ |
$$ |/ |$$ | $$ $$< $$ $$< $$ | $$ |
$$ |$$$$ |$$$$$/ $$$$$ \ $$$$$ \ $$ | $$ |
$$ \__$$ |$$ |_____ $$ |$$ \ $$ |$$ \ $$ \__$$ |
$$ $$/ $$ |$$ | $$ |$$ | $$ |$$ $$/
$$$$$$/ $$$$$$$$/ $$/ $$/ $$/ $$/ $$$$$$/
Gekko v0.6.6
I'm gonna make you rich, Bud Fox.
2018-08-27 16:31:25 (INFO): Setting up Gekko in realtime mode
2018-08-27 16:31:25 (INFO):
2018-08-27 16:31:25 (INFO): Setting up:
2018-08-27 16:31:25 (INFO): Candle writer
2018-08-27 16:31:25 (INFO): Store candles in a database
2018-08-27 16:31:25 (INFO):
2018-08-27 16:31:25 (INFO): Setting up:
2018-08-27 16:31:25 (INFO): Trading Advisor
2018-08-27 16:31:25 (INFO): Calculate trading advice
2018-08-27 16:31:25 (INFO): Using the strategy: MACD
2018-08-27 16:31:26 (INFO): The trading method requests 30 minutes of historic data. Checking availablity..
2018-08-27 16:31:26 (INFO):
2018-08-27 16:31:26 (INFO): No usable local data available, trying to get as much as possible from the exchange..
2018-08-27 16:31:26 (DEBUG): Fetching exchange data since 30 minutes ago
Scanning back in the history needed... moment.utc("2018-08-27T20:01:00.000+00:00")
2018-08-27 16:31:27 (DEBUG): Available exchange data:
2018-08-27 16:31:27 (DEBUG): from: 8 minutes ago
2018-08-27 16:31:27 (DEBUG): to: 0 minutes ago
2018-08-27 16:31:27 (DEBUG): Unable to stitch datasets.
2018-08-27 16:31:27 (INFO): Not seeding locally available data to the trading method.
2018-08-27 16:31:27 (INFO): Setting up:
2018-08-27 16:31:27 (INFO): Paper Trader
2018-08-27 16:31:27 (INFO): Paper trader that simulates fake trades.
2018-08-27 16:31:27 (INFO):
2018-08-27 16:31:27 (INFO): Setting up:
2018-08-27 16:31:27 (INFO): Performance Analyzer
2018-08-27 16:31:27 (INFO): Analyzes performances of trades
2018-08-27 16:31:27 (INFO):
2018-08-27 16:31:27 (INFO): Starting to watch the market: GDAX LTC/USD
2018-08-27 16:31:27 (DEBUG): scheduling ticks
2018-08-27 16:31:27 (DEBUG): Requested LTC/USD trade data from GDAX ...
2018-08-27 16:31:27 (DEBUG): Processing 100 new trades. From 2018-08-27 20:22:38 UTC to 2018-08-27 20:31:11 UTC. (9 minutes)
2018-08-27 16:31:47 (DEBUG): Requested LTC/USD trade data from GDAX ...
2018-08-27 16:31:47 (DEBUG): Processing 3 new trades. From 2018-08-27 20:31:44 UTC to 2018-08-27 20:31:44 UTC. (a few seconds)
^C
crypto49er (stable *) gekko $ node gekko --config sample-config.js
______ ________ __ __ __ __ ______
/ \ / |/ | / |/ | / | / \
/$$$$$$ |$$$$$$$$/ $$ | /$$/ $$ | /$$/ /$$$$$$ |
$$ | _$$/ $$ |__ $$ |/$$/ $$ |/$$/ $$ | $$ |
$$ |/ |$$ | $$ $$< $$ $$< $$ | $$ |
$$ |$$$$ |$$$$$/ $$$$$ \ $$$$$ \ $$ | $$ |
$$ \__$$ |$$ |_____ $$ |$$ \ $$ |$$ \ $$ \__$$ |
$$ $$/ $$ |$$ | $$ |$$ | $$ |$$ $$/
$$$$$$/ $$$$$$$$/ $$/ $$/ $$/ $$/ $$$$$$/
Gekko v0.6.6
I'm gonna make you rich, Bud Fox.
2018-08-27 16:31:53 (INFO): Setting up Gekko in realtime mode
2018-08-27 16:31:53 (INFO):
2018-08-27 16:31:53 (INFO): Setting up:
2018-08-27 16:31:53 (INFO): Candle writer
2018-08-27 16:31:53 (INFO): Store candles in a database
2018-08-27 16:31:53 (INFO):
2018-08-27 16:31:53 (INFO): Setting up:
2018-08-27 16:31:53 (INFO): Trading Advisor
2018-08-27 16:31:53 (INFO): Calculate trading advice
2018-08-27 16:31:53 (INFO): Using the strategy: MACD
2018-08-27 16:31:54 (INFO): The trading method requests 30 minutes of historic data. Checking availablity..
2018-08-27 16:31:54 (INFO):
2018-08-27 16:31:54 (INFO): Local data is still too recent, trying to get as much as possible from the exchange
2018-08-27 16:31:54 (DEBUG): Fetching exchange data since 30 minutes ago
Scanning back in the history needed... moment.utc("2018-08-27T20:01:00.000+00:00")
2018-08-27 16:31:54 (DEBUG): Available exchange data:
2018-08-27 16:31:54 (DEBUG): from: 8 minutes ago
2018-08-27 16:31:54 (DEBUG): to: 0 minutes ago
2018-08-27 16:31:54 (DEBUG): Stitching datasets
2018-08-27 16:31:54 (INFO): Partial history locally available, but 21 minutes are missing.
2018-08-27 16:31:54 (INFO): Seeding the trading method with partial historical data (Gekko needs more time before it can give advice).
2018-08-27 16:31:54 (DEBUG): Seeding with:
2018-08-27 16:31:54 (DEBUG): from: 9 minutes ago
2018-08-27 16:31:54 (DEBUG): to: 9 minutes ago
2018-08-27 16:31:54 (INFO): Setting up:
2018-08-27 16:31:54 (INFO): Paper Trader
2018-08-27 16:31:54 (INFO): Paper trader that simulates fake trades.
2018-08-27 16:31:54 (INFO):
2018-08-27 16:31:54 (INFO): Setting up:
2018-08-27 16:31:54 (INFO): Performance Analyzer
2018-08-27 16:31:54 (INFO): Analyzes performances of trades
2018-08-27 16:31:54 (INFO):
2018-08-27 16:31:54 (INFO): Starting to watch the market: GDAX LTC/USD
2018-08-27 16:31:54 (DEBUG): scheduling ticks
2018-08-27 16:31:54 (DEBUG): Requested LTC/USD trade data from GDAX ...
2018-08-27 16:31:54 (DEBUG): Processing 100 new trades. From 2018-08-27 20:23:08 UTC to 2018-08-27 20:31:50 UTC. (9 minutes)
_stream_writable.js:477
cb();
^
TypeError: cb is not a function
at afterWrite (_stream_writable.js:477:3)
at process._tickCallback (internal/process/next_tick.js:178:19)
Thanks a lot to @crypto49er for providing me with steps to reproduce. These kind of issues are impossible for me to fix without being able to reproduce.
@bobychain @moodyswing @danielm001 @cstegmann @nicolasbonnici @hiyan I was finally able to fix this! Fix landed in develop for now (see #2482), see here for documentation on running that: https://gekko.wizb.it/docs/installation/updating_gekko.html#Updating-the-develop-branch
Thanks @askmike. Will try.
However, I have not seen this error, since I upgraded node to v10 and rebuild node_modules, for a few weeks now.
Will report if I see this error again.
This error only happened when a few different things all happened at the
same time: when your strategies requires a history, when the history is
available locally but not from the exchange, when that history contained
more than 1 big candle (candleSize) and a few other minor details.
Note that if you see "CB is not a function" that error comes from the node
stream complaining. The actual issue was with Gekko. If you see it again
there is a new/another bug triggering it. Since I am sure this one is now
fixed.
On Tue, 28 Aug 2018, 17:24 Wei Ken, notifications@github.com wrote:
Thanks @askmike https://github.com/askmike. Will try.
However, I have not seen this error, since I upgraded node to v10 and
rebuild node_modules, for a few weeks now.Will report if I see this error again.
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
https://github.com/askmike/gekko/issues/2329#issuecomment-416513964, or mute
the thread
https://github.com/notifications/unsubscribe-auth/AA7MD-TDgNbfd7nHzPeallsUpBnBN0Mdks5uVQw8gaJpZM4VTgwE
.
Thanl you @askmike, trying it now!
I still have the problem, randomly or at start with the version 0.6.6.
Is it possible to re-open the ticket?
Gekko got the error 3 days ago and didn't trade since then, I had to restart manually.
I have seen other variables that are listed as not a function ("done is not a function"), but not cb. @bobychain, I think you should open a new issue. If you want a quick fix, you can have cb return only if it is a function (if typeof cb == 'function).
Most helpful comment
Thanks a lot to @crypto49er for providing me with steps to reproduce. These kind of issues are impossible for me to fix without being able to reproduce.
@bobychain @moodyswing @danielm001 @cstegmann @nicolasbonnici @hiyan I was finally able to fix this! Fix landed in develop for now (see #2482), see here for documentation on running that: https://gekko.wizb.it/docs/installation/updating_gekko.html#Updating-the-develop-branch