Can't run (json.decoder.JSONDecodeError: Expecting value: line 1 column 1 (char 0))
See original GitHub issueI am trying to get this to work but so far without luck. I found out that this requires Python3 and I’ve installed DEAR via pip. I’ve tried this on both a Raspberry pi and a Ubuntu Server.
This is the output of the Ubuntu Server:
$ python3 evolution.py using candlestick dataset {'from': 1451675160, 'to': 1503137160} DEBUG {'MIN_ VALUES': {'thresholds': {'high': 45, 'fibonacci': 0.1, 'persistence': 1, 'up': -0.125, 'down': -1.25, 'low': 10}, 'short': 1, 'long': 10, 'interval': 0, 'signal': 5}} DEBUG {'MAX_ VALUES': {'thresholds': {'high': 95, 'fibonacci': 1.0, 'persistence': 5, 'up': 1.525, 'down': 0.4, 'low': 60}, 'short': 21, 'long': 43, 'interval': 33, 'signal': 15}} Loading new date range; {'from': '2016-04-24 22:12:45', 'to': '2016-04-27 22:12:45'} multiprocessing.pool.RemoteTraceback: """ Traceback (most recent call last): File "/usr/lib/python3.5/multiprocessing/pool.py", line 119, in worker result = (True, func(*args, **kwds)) File "/usr/lib/python3.5/multiprocessing/pool.py", line 47, in starmapstar return list(itertools.starmap(args[0], args[1])) File "evolution.py", line 74, in Evaluate Score = runBacktest(Settings, DateRange) File "/home/nils/gekkoJaponicus/gekkoWrapper.py", line 91, in runBacktest RESULT = REQ.json() File "/usr/lib/python3/dist-packages/requests/models.py", line 808, in json return complexjson.loads(self.text, **kwargs) File "/usr/lib/python3.5/json/__init__.py", line 319, in loads return _default_decoder.decode(s) File "/usr/lib/python3.5/json/decoder.py", line 339, in decode obj, end = self.raw_decode(s, idx=_w(s, 0).end()) File "/usr/lib/python3.5/json/decoder.py", line 357, in raw_decode raise JSONDecodeError("Expecting value", s, err.value) from None json.decoder.JSONDecodeError: Expecting value: line 1 column 1 (char 0) """ The above exception was the direct cause of the following exception: Traceback (most recent call last): File "evolution.py", line 179, in <module> GA = gekko_generations() File "evolution.py", line 140, in gekko_generations fitnesses = parallel.starmap(toolbox.evaluate, to_simulation) File "/usr/lib/python3.5/multiprocessing/pool.py", line 268, in starmap return self._map_async(func, iterable, starmapstar, chunksize).get() File "/usr/lib/python3.5/multiprocessing/pool.py", line 608, in get raise self._value json.decoder.JSONDecodeError: Expecting value: line 1 column 1 (char 0)
And this is the output of the Pi:
python3 evolution.py using candlestick dataset {'from': 1483747620, 'to': 1491512820} Loading new date range; {'from': '2017-01-25 17:47:26', 'to': '2017-01-28 17:47:26'} Traceback (most recent call last): File "evolution.py", line 205, in <module> GA = gekko_generations() File "evolution.py", line 167, in gekko_generations fitnesses = toolbox.map(toolbox.evaluate, individues_to_simulate) File "evolution.py", line 20, in progrBarMap result.append(funct(array[w])) File "evolution.py", line 111, in Evaluate Score = runBacktest(Settings, DateRange) File "/home/nils/gekkoJaponicus/gekkoWrapper.py", line 91, in runBacktest RESULT = REQ.json() File "/usr/lib/python3/dist-packages/requests/models.py", line 808, in json return complexjson.loads(self.text, **kwargs) File "/usr/lib/python3.5/json/__init__.py", line 319, in loads return _default_decoder.decode(s) File "/usr/lib/python3.5/json/decoder.py", line 339, in decode obj, end = self.raw_decode(s, idx=_w(s, 0).end()) File "/usr/lib/python3.5/json/decoder.py", line 357, in raw_decode raise JSONDecodeError("Expecting value", s, err.value) from None json.decoder.JSONDecodeError: Expecting value: line 1 column 1 (char 0)
The cli which runs Gekko UI outputs the following:
/home/nils/gekko/plugins/paperTrader/paperTrader.js:14 this.fee = 1 - (calcConfig['fee' + calcConfig.feeUsing.charAt(0).toUpperCase() + calcConfig.feeUsing.slice(1)] + calcConfig.slippage) / 100; TypeError: Cannot read property 'charAt' of undefined at new PaperTrader (/home/nils/gekko/plugins/paperTrader/paperTrader.js:14:57) at load (/home/nils/gekko/core/pluginUtil.js:100:22) at /home/nils/gekko/node_modules/async/dist/async.js:1156:9 at replenish (/home/nils/gekko/node_modules/async/dist/async.js:1030:17) at iterateeCallback (/home/nils/gekko/node_modules/async/dist/async.js:1015:17) at /home/nils/gekko/node_modules/async/dist/async.js:988:16 at /home/nils/gekko/node_modules/async/dist/async.js:1158:13 at load (/home/nils/gekko/core/pluginUtil.js:68:14) at /home/nils/gekko/node_modules/async/dist/async.js:1156:9 at replenish (/home/nils/gekko/node_modules/async/dist/async.js:1030:17) xxx POST /api/backtest 500 247ms - Error: non-error thrown: Child process has died. at Object.onerror (/home/nils/gekko/node_modules/koa/lib/context.js:105:40) at process._tickCallback (internal/process/next_tick.js:109:7)
Issue Analytics
- State:
- Created 6 years ago
- Comments:10 (4 by maintainers)
I was recieving a 500 response. The error was very similar to what OP posted in the first place. However, I was able to solve the issue by manually installing talib and tulind libraries using
npm i tulind && npm i talib
. No errors after that, I’m actually trying to solve another bug that happens when attempting to run Japonicus with the custom.js file, as in custom strategy. Might open a new issue if unable to solve what’s going on. (Temporary fix for me was simply copying my custom strat into MACD.js and setting my custom config settings under MACD in the settings file, works but it feels so bad.)@HOllarves last time I tried, TA-Lib worked fine. Can you paste the Gekko side of the error?