Gab0 / japonicus

Genetic Algorithm for Gekko Trading Bot.
MIT License
285 stars 102 forks source link

Error during execution #103

Open MaxxGit opened 6 years ago

MaxxGit commented 6 years ago

Hi, i use gekko without problem on my mac. I've launch japonicus with this string in terminal after launch gekko: python3 japonicus.py -g --strat MACD -w After about an hour the execution has stopped with this error:

======  EPOCH 260/800  ======

Locale5 first unevaluated: 0 0 individues removed due to equality

[0] EPOCH 53 &0 Maximum profit 24.391 Average profit 24.318
Minimum profit 24.248 Profit variation 0.072
Population size 92 Max population size 90
Avg trade number 0 Avg sharpe ratio 0

Elder dies 0

Loading Locale6 Loading Traceback (most recent call last): File "/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/site-packages/pandas/core/indexes/base.py", line 2525, in get_loc return self._engine.get_loc(key) File "pandas/_libs/index.pyx", line 117, in pandas._libs.index.IndexEngine.get_loc File "pandas/_libs/index.pyx", line 139, in pandas._libs.index.IndexEngine.get_loc File "pandas/_libs/hashtable_class_helper.pxi", line 1265, in pandas._libs.hashtable.PyObjectHashTable.get_item File "pandas/_libs/hashtable_class_helper.pxi", line 1273, in pandas._libs.hashtable.PyObjectHashTable.get_item KeyError: 'dateRange'

During handling of the above exception, another exception occurred:

Traceback (most recent call last): File "japonicus.py", line 128, in launchJaponicus() File "japonicus.py", line 112, in launchJaponicus gekko_generations(TargetParameters, GenerationMethod, EvaluationMode, web=web_server) File "/Users/max/Trading/gekko/japonicus/evolution_generations.py", line 175, in gekko_generations World.runEPOCH() File "/Users/max/Trading/gekko/japonicus/promoterz/sequence/parallel_world.py", line 23, in world_EPOCH LOCALE.EvolutionStatistics)) File "/Users/max/Trading/gekko/japonicus/web.py", line 42, in update_graph for W in range(len(df['dateRange'])): File "/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/site-packages/pandas/core/frame.py", line 2139, in getitem return self._getitem_column(key) File "/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/site-packages/pandas/core/frame.py", line 2146, in _getitem_column return self._get_item_cache(key) File "/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/site-packages/pandas/core/generic.py", line 1842, in _get_item_cache values = self._data.get(item) File "/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/site-packages/pandas/core/internals.py", line 3843, in get loc = self.items.get_loc(item) File "/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/site-packages/pandas/core/indexes/base.py", line 2527, in get_loc return self._engine.get_loc(self._maybe_cast_indexer(key)) File "pandas/_libs/index.pyx", line 117, in pandas._libs.index.IndexEngine.get_loc File "pandas/_libs/index.pyx", line 139, in pandas._libs.index.IndexEngine.get_loc File "pandas/_libs/hashtable_class_helper.pxi", line 1265, in pandas._libs.hashtable.PyObjectHashTable.get_item File "pandas/_libs/hashtable_class_helper.pxi", line 1273, in pandas._libs.hashtable.PyObjectHashTable.get_item KeyError: 'dateRange' 127.0.0.1 - - [09/Mar/2018 17:37:44] "POST /_dash-update-component HTTP/1.1" 200 - 127.0.0.1 - - [09/Mar/2018 17:37:44] "POST /_dash-update-component HTTP/1.1" 200 - 127.0.0.1 - - [09/Mar/2018 17:37:59] "POST /_dash-update-component HTTP/1.1" 200 - 127.0.0.1 - - [09/Mar/2018 17:37:59] "POST /_dash-update-component HTTP/1.1" 200 - 127.0.0.1 - - [09/Mar/2018 17:38:14] "POST /_dash-update-component HTTP/1.1" 200 -

Gab0 commented 6 years ago

I have had this issue. Were you using the latest version on that time? I think the problem got fixed but.. these things happen. Try to update and tell if it happens again :c I anyone get this error plz report.

MaxxGit commented 6 years ago

Hi Gab0, i have load the latest version (git pull on the repo), now the error is different. Follow log in terminal.

Tks

======  EPOCH 149/800  ======

Locale1 first unevaluated: 7 4 individues removed due to equality [3] EPOCH 149 &3 Maximum profit 16.259 Average profit -247.968 Minimum profit -4475.598 Profit variation 1056.907
Population size 17 Max population size 15
Avg trade number 1 Avg sharpe ratio 0

Elder dies 0

Loading Locale3 first unevaluated: 10 4 individues removed due to equality [6] 127.0.0.1 - - [12/Mar/2018 16:05:55] "POST /_dash-update-component HTTP/1.1" 200 - 127.0.0.1 - - [12/Mar/2018 16:05:55] "POST /_dash-update-component HTTP/1.1" 200 - EPOCH 83 &6 Maximum profit 42.199 Average profit 33.497
Minimum profit -42.300 Profit variation 22.407 Population size 34 Max population size 30
Avg trade number 1 Avg sharpe ratio 0

Elder dies 0

Loading Epoch runs in 20.33 seconds; Backend power [2.1666696866353354]

======  EPOCH 150/800  ======

Locale1 first unevaluated: 15 7 individues removed due to equality [8] 127.0.0.1 - - [12/Mar/2018 16:06:10] "POST /_dash-update-component HTTP/1.1" 200 - 127.0.0.1 - - [12/Mar/2018 16:06:10] "POST /_dash-update-component HTTP/1.1" 200 - 127.0.0.1 - - [12/Mar/2018 16:06:25] "POST /_dash-update-component HTTP/1.1" 200 - 127.0.0.1 - - [12/Mar/2018 16:06:25] "POST /_dash-update-component HTTP/1.1" 200 - EPOCH 150 &8 Maximum profit 16.259 Average profit -1555.853
Minimum profit -4475.598 Profit variation 2142.428
Population size 20 Max population size 15
Avg trade number 0.250 Avg sharpe ratio 0

Elder dies 1

Loading Locale3 first unevaluated: 8 2 individues removed due to equality [6] 127.0.0.1 - - [12/Mar/2018 16:06:41] "POST /_dash-update-component HTTP/1.1" 200 - 127.0.0.1 - - [12/Mar/2018 16:06:41] "POST /_dash-update-component HTTP/1.1" 200 - 127.0.0.1 - - [12/Mar/2018 16:06:57] "POST /_dash-update-component HTTP/1.1" 200 - 127.0.0.1 - - [12/Mar/2018 16:06:57] "POST /_dash-update-component HTTP/1.1" 200 - 127.0.0.1 - - [12/Mar/2018 16:07:11] "POST /_dash-update-component HTTP/1.1" 200 - 127.0.0.1 - - [12/Mar/2018 16:07:11] "POST /_dash-update-component HTTP/1.1" 200 - 127.0.0.1 - - [12/Mar/2018 16:07:26] "POST /_dash-update-component HTTP/1.1" 200 - 127.0.0.1 - - [12/Mar/2018 16:07:26] "POST /_dash-update-component HTTP/1.1" 200 - 127.0.0.1 - - [12/Mar/2018 16:07:41] "POST /_dash-update-component HTTP/1.1" 200 - 127.0.0.1 - - [12/Mar/2018 16:07:41] "POST /_dash-update-component HTTP/1.1" 200 - 127.0.0.1 - - [12/Mar/2018 16:07:56] "POST /_dash-update-component HTTP/1.1" 200 - 127.0.0.1 - - [12/Mar/2018 16:07:56] "POST /_dash-update-component HTTP/1.1" 200 - 127.0.0.1 - - [12/Mar/2018 16:08:12] "POST /_dash-update-component HTTP/1.1" 200 - 127.0.0.1 - - [12/Mar/2018 16:08:12] "POST /_dash-update-component HTTP/1.1" 200 - 127.0.0.1 - - [12/Mar/2018 16:08:28] "POST /_dash-update-component HTTP/1.1" 200 - 127.0.0.1 - - [12/Mar/2018 16:08:28] "POST /_dash-update-component HTTP/1.1" 200 - 127.0.0.1 - - [12/Mar/2018 16:08:43] "POST /_dash-update-component HTTP/1.1" 200 - 127.0.0.1 - - [12/Mar/2018 16:08:43] "POST /_dash-update-component HTTP/1.1" 200 - 127.0.0.1 - - [12/Mar/2018 16:08:56] "POST /_dash-update-component HTTP/1.1" 200 - 127.0.0.1 - - [12/Mar/2018 16:08:56] "POST /_dash-update-component HTTP/1.1" 200 - 127.0.0.1 - - [12/Mar/2018 16:09:11] "POST /_dash-update-component HTTP/1.1" 200 - 127.0.0.1 - - [12/Mar/2018 16:09:11] "POST /_dash-update-component HTTP/1.1" 200 - 127.0.0.1 - - [12/Mar/2018 16:09:27] "POST /_dash-update-component HTTP/1.1" 200 - 127.0.0.1 - - [12/Mar/2018 16:09:27] "POST /_dash-update-component HTTP/1.1" 200 - 127.0.0.1 - - [12/Mar/2018 16:09:43] "POST /_dash-update-component HTTP/1.1" 200 - 127.0.0.1 - - [12/Mar/2018 16:09:43] "POST /_dash-update-component HTTP/1.1" 200 - 127.0.0.1 - - [12/Mar/2018 16:09:59] "POST /_dash-update-component HTTP/1.1" 200 - 127.0.0.1 - - [12/Mar/2018 16:09:59] "POST /_dash-update-component HTTP/1.1" 200 - 127.0.0.1 - - [12/Mar/2018 16:10:11] "POST /_dash-update-component HTTP/1.1" 200 - 127.0.0.1 - - [12/Mar/2018 16:10:11] "POST /_dash-update-component HTTP/1.1" 200 - 127.0.0.1 - - [12/Mar/2018 16:10:26] "POST /_dash-update-component HTTP/1.1" 200 - 127.0.0.1 - - [12/Mar/2018 16:10:26] "POST /_dash-update-component HTTP/1.1" 200 - 127.0.0.1 - - [12/Mar/2018 16:10:42] "POST /_dash-update-component HTTP/1.1" 200 - 127.0.0.1 - - [12/Mar/2018 16:10:42] "POST /_dash-update-component HTTP/1.1" 200 - 127.0.0.1 - - [12/Mar/2018 16:10:58] "POST /_dash-update-component HTTP/1.1" 200 - 127.0.0.1 - - [12/Mar/2018 16:10:58] "POST /_dash-update-component HTTP/1.1" 200 - 127.0.0.1 - - [12/Mar/2018 16:11:14] "POST /_dash-update-component HTTP/1.1" 200 - 127.0.0.1 - - [12/Mar/2018 16:11:14] "POST /_dash-update-component HTTP/1.1" 200 - 127.0.0.1 - - [12/Mar/2018 16:11:29] "POST /_dash-update-component HTTP/1.1" 200 - 127.0.0.1 - - [12/Mar/2018 16:11:29] "POST /_dash-update-component HTTP/1.1" 200 - 127.0.0.1 - - [12/Mar/2018 16:11:41] "POST /_dash-update-component HTTP/1.1" 200 - 127.0.0.1 - - [12/Mar/2018 16:11:41] "POST /_dash-update-component HTTP/1.1" 200 - Error: config failure Error: config failure http://localhost:3000/api/backtest http://localhost:3000/api/backtest Error: config failure http://localhost:3000/api/backtest {'gekkoConfig': {'debug': True, 'info': True, 'watch': {'exchange': 'poloniex', 'currency': 'USDT', 'asset': 'XRP'}, 'paperTrader': {'fee': 0.25, 'feeMaker': 0.15, 'feeTaker': 0.25, 'feeUsing': 'maker', 'slippage': 0.05, 'simulationBalance': {'asset': 1, 'currency': 100}, 'reportRoundtrips': True, 'enabled': True}, 'tradingAdvisor': {'enabled': True, 'method': 'MACD', 'candleSize': 10, 'historySize': 10}, 'MACD': {'long': 23.6, 'short': 1.9, 'signal': 10.17, 'thresholds': {'down': -0.32499999999999996, 'persistence': 2.8, 'up': 0.05}}, 'backtest': {'daterange': {'from': '2017-05-16 06:50:33', 'to': '2017-08-14 06:50:33'}}, 'performanceAnalyzer': {'riskFreeReturn': 2, 'enabled': True}, 'valid': True}, 'data': {'candleProps': ['id', 'start', 'open', 'high', 'low', 'close', 'vwp', 'volume', 'trades'], 'indicatorResults': True, 'report': True, 'roundtrips': False, 'trades': True}} {'gekkoConfig': {'debug': True, 'info': True, 'watch': {'exchange': 'poloniex', 'currency': 'USDT', 'asset': 'XRP'}, 'paperTrader': {'fee': 0.25, 'feeMaker': 0.15, 'feeTaker': 0.25, 'feeUsing': 'maker', 'slippage': 0.05, 'simulationBalance': {'asset': 1, 'currency': 100}, 'reportRoundtrips': True, 'enabled': True}, 'tradingAdvisor': {'enabled': True, 'method': 'MACD', 'candleSize': 10, 'historySize': 10}, 'MACD': {'long': 23.0, 'short': 4.51, 'signal': 9.27, 'thresholds': {'down': -0.010000000000000009, 'persistence': 2.08, 'up': 0.47500000000000003}}, 'backtest': {'daterange': {'from': '2017-05-16 06:50:33', 'to': '2017-08-14 06:50:33'}}, 'performanceAnalyzer': {'riskFreeReturn': 2, 'enabled': True}, 'valid': True}, 'data': {'candleProps': ['id', 'start', 'open', 'high', 'low', 'close', 'vwp', 'volume', 'trades'], 'indicatorResults': True, 'report': True, 'roundtrips': False, 'trades': True}} Error: config failure http://localhost:3000/api/backtest Error: config failure http://localhost:3000/api/backtest {'gekkoConfig': {'debug': True, 'info': True, 'watch': {'exchange': 'poloniex', 'currency': 'USDT', 'asset': 'XRP'}, 'paperTrader': {'fee': 0.25, 'feeMaker': 0.15, 'feeTaker': 0.25, 'feeUsing': 'maker', 'slippage': 0.05, 'simulationBalance': {'asset': 1, 'currency': 100}, 'reportRoundtrips': True, 'enabled': True}, 'tradingAdvisor': {'enabled': True, 'method': 'MACD', 'candleSize': 10, 'historySize': 10}, 'MACD': {'long': 23.0, 'short': 1.9, 'signal': 9.27, 'thresholds': {'down': -0.010000000000000009, 'persistence': 2.08, 'up': 0.47500000000000003}}, 'backtest': {'daterange': {'from': '2017-05-16 06:50:33', 'to': '2017-08-14 06:50:33'}}, 'performanceAnalyzer': {'riskFreeReturn': 2, 'enabled': True}, 'valid': True}, 'data': {'candleProps': ['id', 'start', 'open', 'high', 'low', 'close', 'vwp', 'volume', 'trades'], 'indicatorResults': True, 'report': True, 'roundtrips': False, 'trades': True}} Error: config failure http://localhost:3000/api/backtest {'gekkoConfig': {'debug': True, 'info': True, 'watch': {'exchange': 'poloniex', 'currency': 'USDT', 'asset': 'XRP'}, 'paperTrader': {'fee': 0.25, 'feeMaker': 0.15, 'feeTaker': 0.25, 'feeUsing': 'maker', 'slippage': 0.05, 'simulationBalance': {'asset': 1, 'currency': 100}, 'reportRoundtrips': True, 'enabled': True}, 'tradingAdvisor': {'enabled': True, 'method': 'MACD', 'candleSize': 10, 'historySize': 10}, 'MACD': {'long': 30.5, 'short': 8.2, 'signal': 13.59, 'thresholds': {'down': -0.08999999999999997, 'persistence': 3.12, 'up': 0.24}}, 'backtest': {'daterange': {'from': '2017-05-16 06:50:33', 'to': '2017-08-14 06:50:33'}}, 'performanceAnalyzer': {'riskFreeReturn': 2, 'enabled': True}, 'valid': True}, 'data': {'candleProps': ['id', 'start', 'open', 'high', 'low', 'close', 'vwp', 'volume', 'trades'], 'indicatorResults': True, 'report': True, 'roundtrips': False, 'trades': True}} {'gekkoConfig': {'debug': True, 'info': True, 'watch': {'exchange': 'poloniex', 'currency': 'USDT', 'asset': 'XRP'}, 'paperTrader': {'fee': 0.25, 'feeMaker': 0.15, 'feeTaker': 0.25, 'feeUsing': 'maker', 'slippage': 0.05, 'simulationBalance': {'asset': 1, 'currency': 100}, 'reportRoundtrips': True, 'enabled': True}, 'tradingAdvisor': {'enabled': True, 'method': 'MACD', 'candleSize': 10, 'historySize': 10}, 'MACD': {'long': 23.6, 'short': 1.9, 'signal': 10.17, 'thresholds': {'down': -0.32499999999999996, 'persistence': 2.8, 'up': 0.0}}, 'backtest': {'daterange': {'from': '2017-05-16 06:50:33', 'to': '2017-08-14 06:50:33'}}, 'performanceAnalyzer': {'riskFreeReturn': 2, 'enabled': True}, 'valid': True}, 'data': {'candleProps': ['id', 'start', 'open', 'high', 'low', 'close', 'vwp', 'volume', 'trades'], 'indicatorResults': True, 'report': True, 'roundtrips': False, 'trades': True}} {'gekkoConfig': {'debug': True, 'info': True, 'watch': {'exchange': 'poloniex', 'currency': 'USDT', 'asset': 'XRP'}, 'paperTrader': {'fee': 0.25, 'feeMaker': 0.15, 'feeTaker': 0.25, 'feeUsing': 'maker', 'slippage': 0.05, 'simulationBalance': {'asset': 1, 'currency': 100}, 'reportRoundtrips': True, 'enabled': True}, 'tradingAdvisor': {'enabled': True, 'method': 'MACD', 'candleSize': 10, 'historySize': 10}, 'MACD': {'long': 23.0, 'short': 4.51, 'signal': 9.27, 'thresholds': {'down': -0.45, 'persistence': 2.8, 'up': 0.47500000000000003}}, 'backtest': {'daterange': {'from': '2017-05-16 06:50:33', 'to': '2017-08-14 06:50:33'}}, 'performanceAnalyzer': {'riskFreeReturn': 2, 'enabled': True}, 'valid': True}, 'data': {'candleProps': ['id', 'start', 'open', 'high', 'low', 'close', 'vwp', 'volume', 'trades'], 'indicatorResults': True, 'report': True, 'roundtrips': False, 'trades': True}} multiprocessing.pool.RemoteTraceback: """ Traceback (most recent call last): File "/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/site-packages/requests/packages/urllib3/connectionpool.py", line 600, in urlopen chunked=chunked) File "/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/site-packages/requests/packages/urllib3/connectionpool.py", line 386, in _make_request six.raise_from(e, None) File "", line 2, in raise_from File "/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/site-packages/requests/packages/urllib3/connectionpool.py", line 382, in _make_request httplib_response = conn.getresponse() File "/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/http/client.py", line 1331, in getresponse response.begin() File "/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/http/client.py", line 297, in begin version, status, reason = self._read_status() File "/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/http/client.py", line 266, in _read_status raise RemoteDisconnected("Remote end closed connection without" http.client.RemoteDisconnected: Remote end closed connection without response

During handling of the above exception, another exception occurred:

Traceback (most recent call last): File "/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/site-packages/requests/adapters.py", line 438, in send timeout=timeout File "/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/site-packages/requests/packages/urllib3/connectionpool.py", line 649, in urlopen _stacktrace=sys.exc_info()[2]) File "/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/site-packages/requests/packages/urllib3/util/retry.py", line 357, in increment raise six.reraise(type(error), error, _stacktrace) File "/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/site-packages/requests/packages/urllib3/packages/six.py", line 685, in reraise raise value.with_traceback(tb) File "/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/site-packages/requests/packages/urllib3/connectionpool.py", line 600, in urlopen chunked=chunked) File "/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/site-packages/requests/packages/urllib3/connectionpool.py", line 386, in _make_request six.raise_from(e, None) File "", line 2, in raise_from File "/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/site-packages/requests/packages/urllib3/connectionpool.py", line 382, in _make_request httplib_response = conn.getresponse() File "/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/http/client.py", line 1331, in getresponse response.begin() File "/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/http/client.py", line 297, in begin version, status, reason = self._read_status() File "/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/http/client.py", line 266, in _read_status raise RemoteDisconnected("Remote end closed connection without" requests.packages.urllib3.exceptions.ProtocolError: ('Connection aborted.', RemoteDisconnected('Remote end closed connection without response',))

During handling of the above exception, another exception occurred:

Traceback (most recent call last): File "/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/multiprocessing/pool.py", line 119, in worker result = (True, func(*args, kwds)) File "/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/multiprocessing/pool.py", line 47, in starmapstar return list(itertools.starmap(args[0], args[1])) File "/Users/max/Trading/gekko/japonicus/evolution_generations.py", line 48, in bEvaluate DateRange, phenotype, gekkoUrl) File "/Users/max/Trading/gekko/japonicus/evaluation/gekko/backtest.py", line 56, in Evaluate Debug=genconf.gekkoDebug) for DR in DateRange ] File "/Users/max/Trading/gekko/japonicus/evaluation/gekko/backtest.py", line 56, in Debug=genconf.gekkoDebug) for DR in DateRange ] File "/Users/max/Trading/gekko/japonicus/evaluation/gekko/backtest.py", line 29, in runBacktest result = httpPost(url, gekko_config) File "/Users/max/Trading/gekko/japonicus/evaluation/gekko/API.py", line 23, in httpPost raise e File "/Users/max/Trading/gekko/japonicus/evaluation/gekko/API.py", line 14, in httpPost Request = requests.post(URL, json=data) File "/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/site-packages/requests/api.py", line 112, in post return request('post', url, data=data, json=json, kwargs) File "/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/site-packages/requests/api.py", line 58, in request return session.request(method=method, url=url, kwargs) File "/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/site-packages/requests/sessions.py", line 518, in request resp = self.send(prep, send_kwargs) File "/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/site-packages/requests/sessions.py", line 639, in send r = adapter.send(request, **kwargs) File "/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/site-packages/requests/adapters.py", line 488, in send raise ConnectionError(err, request=request) requests.exceptions.ConnectionError: ('Connection aborted.', RemoteDisconnected('Remote end closed connection without response',)) """

The above exception was the direct cause of the following exception:

Traceback (most recent call last): File "japonicus.py", line 134, in launchJaponicus() File "japonicus.py", line 118, in launchJaponicus gekko_generations(TargetParameters, GenerationMethod, EvaluationMode, web=web_server) File "/Users/max/Trading/gekko/japonicus/evolution_generations.py", line 175, in gekko_generations World.runEPOCH() File "/Users/max/Trading/gekko/japonicus/promoterz/sequence/parallel_world.py", line 13, in world_EPOCH LOCALE.run() File "/Users/max/Trading/gekko/japonicus/promoterz/locale.py", line 49, in run self.loop(self.World, self) File "/Users/max/Trading/gekko/japonicus/promoterz/sequence/standard_loop.py", line 34, in standard_loop locale.extraStats['nb_evaluated'], locale.extraStats['avgTrades'] = World.parallel.evaluatePopulation(locale) File "/Users/max/Trading/gekko/japonicus/promoterz/evaluationPool.py", line 70, in evaluatePopulation results[A] = results[A].get(timeout=timeout) File "/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/multiprocessing/pool.py", line 644, in get raise self._value File "/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/multiprocessing/pool.py", line 119, in worker result = (True, func(*args, **kwds)) File "/Users/max/Trading/gekko/japonicus/promoterz/evaluationPool.py", line 37, in evaluateBackend fitnesses = P.starmap(self.EvaluationTool, Q ) File "/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/multiprocessing/pool.py", line 274, in starmap return self._map_async(func, iterable, starmapstar, chunksize).get() File "/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/multiprocessing/pool.py", line 644, in get raise self._value requests.exceptions.ConnectionError: ('Connection aborted.', RemoteDisconnected('Remote end closed connection without response',)) 127.0.0.1 - - [12/Mar/2018 16:11:55] "POST /_dash-update-component HTTP/1.1" 200 - 127.0.0.1 - - [12/Mar/2018 16:11:55] "POST /_dash-update-component HTTP/1.1" 200 - 127.0.0.1 - - [12/Mar/2018 16:12:10] "POST /_dash-update-component HTTP/1.1" 200 - 127.0.0.1 - - [12/Mar/2018 16:12:10] "POST /_dash-update-component HTTP/1.1" 200 - 127.0.0.1 - - [12/Mar/2018 16:12:25] "POST /_dash-update-component HTTP/1.1" 200 - 127.0.0.1 - - [12/Mar/2018 16:12:25] "POST /_dash-update-component HTTP/1.1" 200 - 127.0.0.1 - - [12/Mar/2018 16:12:40] "POST /_dash-update-component HTTP/1.1" 200 - 127.0.0.1 - - [12/Mar/2018 16:12:40] "POST /_dash-update-component HTTP/1.1" 200 - 127.0.0.1 - - [12/Mar/2018 16:12:55] "POST /_dash-update-component HTTP/1.1" 200 - 127.0.0.1 - - [12/Mar/2018 16:12:55] "POST /_dash-update-component HTTP/1.1" 200 - 127.0.0.1 - - [12/Mar/2018 16:13:10] "POST /_dash-update-component HTTP/1.1" 200 - 127.0.0.1 - - [12/Mar/2018 16:13:10] "POST /_dash-update-component HTTP/1.1" 200 - 127.0.0.1 - - [12/Mar/2018 16:13:25] "POST /_dash-update-component HTTP/1.1" 200 - 127.0.0.1 - - [12/Mar/2018 16:13:25] "POST /_dash-update-component HTTP/1.1" 200 -

Gab0 commented 6 years ago

Hello @MaxxGit, what was the command you used to start the session? Have you got any sucessful run? From the traceback it seems its a bug with dataset dateranges... but I can't guarantee. cheers!

WildcatKSS commented 6 years ago

Hi Gab0,

I have loaded the latest version (git pull on the repo) and I get the following error when i run this command.

python japonicus.py -b --strat DEMA

File "japonicus.py", line 34 SyntaxError: Non-ASCII character '\xe2' in file japonicus.py on line 35, but no encoding declared; see http://python.org/dev/peps/pep-0263/ for details

Can you tell me what I'm doing wrong?

Thanks

Gab0 commented 6 years ago

Hey @WildcatKSS I have no idea of whats behind this SyntaxError. But try the latest commit, a simple fix that should work. Sadly you won't see the beautiful ASCII art of the title.

Gab0 commented 6 years ago

@WildcatKSS Hey, sorry. I thought I had implemented a lock to make impossible to run the program under python2, and provide a warning message, but encoding error has priority. So that's it. you are running it under python2 but python>=3.6 is required ^^

lenzoburger commented 6 years ago

Hey,

I am not sure if this is the same issue but i am also getting the KeyError: 'dateRange' error sometimes. I pulled the latest dev branch a couple of days ago and I have been able to successfully run full -g Genetic algorithm evolution. But i have gotten this error during some of the runs especially when I reach the following scenario during a run:

first unevaluated: 0
0 individues removed due to equality

The error always stops the run for me. I am running GA evolution with following command

python3.6 japonicus.py -g --strat RSI_BULL_BEAR_ADX_BB_SIDE -w

ERROR:

Locale12
first unevaluated: 0
0 individues removed due to equality
-
[0]
EPOCH 4 &0
Maximum profit 38.403   Average profit 28.110   
Minimum profit -14.037  Profit variation 17.153 
Population size 105     Max population size 158 
Avg trade number 0      Avg sharpe ratio -0.371 

Elder dies 0

Loading
Locale13
Locale exploding due to assertion error! (zero population)
Loading
Traceback (most recent call last):
  File "gekkoPC/venv/lib/python3.6/site-packages/pandas/core/indexes/base.py", line 2525, in get_loc
    return self._engine.get_loc(key)
  File "pandas/_libs/index.pyx", line 117, in pandas._libs.index.IndexEngine.get_loc
  File "pandas/_libs/index.pyx", line 139, in pandas._libs.index.IndexEngine.get_loc
  File "pandas/_libs/hashtable_class_helper.pxi", line 1265, in pandas._libs.hashtable.PyObjectHashTable.get_item
  File "pandas/_libs/hashtable_class_helper.pxi", line 1273, in pandas._libs.hashtable.PyObjectHashTable.get_item
KeyError: 'dateRange'

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "japonicus.py", line 171, in <module>
    launchJaponicus(parser)
  File "japonicus.py", line 156, in launchJaponicus
    EvaluationMode, settings, options, web=web_server
  File "gekkoPC/japonicus_develop/evolution_generations.py", line 186, in gekko_generations
    World.runEPOCH()
  File "gekkoPC/japonicus_develop/promoterz/sequence/parallel_world.py", line 22, in world_EPOCH
    World.web.update_graph(LOCALE.name, LOCALE.EvolutionStatistics),
  File "gekkoPC/japonicus_develop/web.py", line 45, in update_graph
    for W in range(len(df['dateRange'])):
  File "gekkoPC/venv/lib/python3.6/site-packages/pandas/core/frame.py", line 2139, in __getitem__
    return self._getitem_column(key)
  File "gekkoPC/venv/lib/python3.6/site-packages/pandas/core/frame.py", line 2146, in _getitem_column
    return self._get_item_cache(key)
  File "gekkoPC/venv/lib/python3.6/site-packages/pandas/core/generic.py", line 1842, in _get_item_cache
    values = self._data.get(item)
  File "gekkoPC/venv/lib/python3.6/site-packages/pandas/core/internals.py", line 3843, in get
    loc = self.items.get_loc(item)
  File "gekkoPC/venv/lib/python3.6/site-packages/pandas/core/indexes/base.py", line 2527, in get_loc
    return self._engine.get_loc(self._maybe_cast_indexer(key))
  File "pandas/_libs/index.pyx", line 117, in pandas._libs.index.IndexEngine.get_loc
  File "pandas/_libs/index.pyx", line 139, in pandas._libs.index.IndexEngine.get_loc
  File "pandas/_libs/hashtable_class_helper.pxi", line 1265, in pandas._libs.hashtable.PyObjectHashTable.get_item
  File "pandas/_libs/hashtable_class_helper.pxi", line 1273, in pandas._libs.hashtable.PyObjectHashTable.get_item
KeyError: 'dateRange'
lenzoburger commented 6 years ago

In my case, I can see that in the error above it references Locale13 which i have found doesn't have a corresponding csv created in the Run Folder(screenshot below). Is it likely that the CSV file was not created for locale13.csv because of Locale exploding due to assertion error! (zero population). Therefore _updateGraph() method in web.py is trying to update graph for locale13 csv that does not exist but may have already been added to df['dateRange'] dictionary. Hence line 45 of web.py (referenced in exception in above comment) throwing an error. _I am not sure what the best solution is ... nor how to implement it and reproduce the issue for testing_. What do you think @Gab0 ?

Line 45 web.py

for W in range(len(df['dateRange'])): 

Just before error is thrown:

Loading
Locale13
Locale exploding due to assertion error! (zero population)
Loading
Traceback (most recent call last):

update_Graph method: image

Run Folder: image

Gab0 commented 6 years ago

@lenzoburger At current version web graph data doesn't come from csv files, but from data from statistics loaded at runtime... But yeah, early locale destruction is the cause that the data doesn't have 'dateRange' key. I'm fixing this to avoid this error. Did this KeyError caused the program to exit? cheers!

lenzoburger commented 6 years ago

@Gab0, yes it caused the program to exit. Thanks!

lenzoburger commented 6 years ago

@Gab0 , I have pulled the latest commits from branch develop, but i am still getting the above error.

Locale11 Exploded and update_graph method fails:

Loading
Locale11
Locale exploding due to assertion error! (zero population)
Loading
Traceback (most recent call last):
  File "gekkoPC/venv/lib/python3.6/site-packages/pandas/core/indexes/base.py", line 2525, in get_loc
    return self._engine.get_loc(key)
  File "pandas/_libs/index.pyx", line 117, in pandas._libs.index.IndexEngine.get_loc
  File "pandas/_libs/index.pyx", line 139, in pandas._libs.index.IndexEngine.get_loc
  File "pandas/_libs/hashtable_class_helper.pxi", line 1265, in pandas._libs.hashtable.PyObjectHashTable.get_item
  File "pandas/_libs/hashtable_class_helper.pxi", line 1273, in pandas._libs.hashtable.PyObjectHashTable.get_item
KeyError: 'dateRange'

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "japonicus.py", line 172, in <module>
    launchJaponicus(parser)
  File "japonicus.py", line 157, in launchJaponicus
    EvaluationMode, settings, options, web=web_server
  File "gekkoPC/japonicus_develop/evolution_generations.py", line 220, in gekko_generations
    World.runEPOCH()
  File "gekkoPC/japonicus_develop/promoterz/sequence/parallel_world.py", line 22, in world_EPOCH
    World.web.update_graph(LOCALE.name, LOCALE.EvolutionStatistics),
  File "gekkoPC/japonicus_develop/web.py", line 45, in update_graph
    for W in range(len(df['dateRange'])):
  File "gekkoPC/venv/lib/python3.6/site-packages/pandas/core/frame.py", line 2139, in __getitem__
    return self._getitem_column(key)
  File "gekkoPC/venv/lib/python3.6/site-packages/pandas/core/frame.py", line 2146, in _getitem_column
    return self._get_item_cache(key)
  File "gekkoPC/venv/lib/python3.6/site-packages/pandas/core/generic.py", line 1842, in _get_item_cache
    values = self._data.get(item)
  File "gekkoPC/venv/lib/python3.6/site-packages/pandas/core/internals.py", line 3843, in get
    loc = self.items.get_loc(item)
  File "gekkoPC/venv/lib/python3.6/site-packages/pandas/core/indexes/base.py", line 2527, in get_loc
    return self._engine.get_loc(self._maybe_cast_indexer(key))
  File "pandas/_libs/index.pyx", line 117, in pandas._libs.index.IndexEngine.get_loc
  File "pandas/_libs/index.pyx", line 139, in pandas._libs.index.IndexEngine.get_loc
  File "pandas/_libs/hashtable_class_helper.pxi", line 1265, in pandas._libs.hashtable.PyObjectHashTable.get_item
  File "pandas/_libs/hashtable_class_helper.pxi", line 1273, in pandas._libs.hashtable.PyObjectHashTable.get_item
KeyError: 'dateRange'
Gab0 commented 6 years ago

@lenzoburger Haa the fix was faulty. I'm pushing a new version that got this right. Thanks!