Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error while analyzing data: 'buy_window' #22

Open
ygbanks opened this issue Apr 1, 2023 · 5 comments
Open

Error while analyzing data: 'buy_window' #22

ygbanks opened this issue Apr 1, 2023 · 5 comments

Comments

@ygbanks
Copy link

ygbanks commented Apr 1, 2023

Hello, I hope you're doing well. I want to take a moment to appreciate the enormous amount of work you have done for the world, it's magical what you have committed to creating.
I have faced this error trying to run the project on my ubuntu server. Any idea on how I could get it to work or fix what's going on?

--Error:

(venv) root@ygbanks-com:~/BTCML# python3 -m service.server -c config.json
Initializing server. Trade pair: BTCUSDT.
/root/BTCML/venv/lib/python3.10/site-packages/sklearn/base.py:318: UserWarning: Trying to unpickle estimator StandardScaler from version 1.2.1 when using version 1.2.2. This might lead to breaking code or invalid results. Use at your own risk. For more info please refer to:
https://scikit-learn.org/stable/model_persistence.html#security-maintainability-limitations
warnings.warn(
/root/BTCML/venv/lib/python3.10/site-packages/sklearn/base.py:318: UserWarning: Trying to unpickle estimator LogisticRegression from version 1.2.1 when using version 1.2.2. This might lead to breaking code or invalid results. Use at your own risk. For more info please refer to:
https://scikit-learn.org/stable/model_persistence.html#security-maintainability-limitations
warnings.warn(
/root/BTCML/service/server.py:77: DeprecationWarning: There is no current event loop
App.loop = asyncio.get_event_loop()
Finished health check (connection, server status etc.)
Finished initial data collection.
Scheduler started.
Error while analyzing data: 'buy_window'
Error while analyzing data: 'buy_window'
Error while analyzing data: 'buy_window'

@asavinov
Copy link
Owner

asavinov commented Apr 1, 2023

Thank you for using the software. If you are using the latest version, then last error seems to be caused by incompatible config. The entry buy_window is moved to score_aggregation.window (same for sell_window). Either use the previous version or check out config-sample-v0.5.0.json which has the structure for the newest version.

The first two warnings are because the scaler was trained using some previous version (the sklearn was upgraded after the models were trained). So you can get rid of these warnings by re-training the models.

@ygbanks
Copy link
Author

ygbanks commented Apr 1, 2023

Thank you for response brother. I am using the latest source code of the git and the v0.5.0 config sample structure. I am running a (venv) since I am using root for my server. I tried downgrading the config to v0.4.0 and got this error:
raceback (most recent call last):
File "/usr/lib/python3.10/runpy.py", line 196, in _run_module_as_main
return _run_code(code, main_globals, None,
File "/usr/lib/python3.10/runpy.py", line 86, in _run_code
exec(code, run_globals)
File "/root/BTCML/service/server.py", line 157, in
start_server()
File "/root/BTCML/venv/lib/python3.10/site-packages/click/core.py", line 1130, in call
return self.main(*args, **kwargs)
File "/root/BTCML/venv/lib/python3.10/site-packages/click/core.py", line 1055, in main
rv = self.invoke(ctx)
File "/root/BTCML/venv/lib/python3.10/site-packages/click/core.py", line 1404, in invoke
return ctx.invoke(self.callback, **ctx.params)
File "/root/BTCML/venv/lib/python3.10/site-packages/click/core.py", line 760, in invoke
return __callback(*args, **kwargs)
File "/root/BTCML/service/server.py", line 58, in start_server
load_config(config_file)
File "/root/BTCML/service/App.py", line 270, in load_config
conf_json = json.loads(conf_str)
File "/usr/lib/python3.10/json/init.py", line 346, in loads
return _default_decoder.decode(s)
File "/usr/lib/python3.10/json/decoder.py", line 340, in decode
raise JSONDecodeError("Extra data", s, end)
json.decoder.JSONDecodeError: Extra data: line 81 column 2 (char 1906)

I tried exiting the venv (virtual environment) then tried to run the service and I am getting this error instead:
(Note: I do have that module installed and configured hence it didn't cause this error in the venv, I believe it's happening because I am running on root directly so I tried the venv and it fixed this error.)
root@ygbanks-com:~/BTCML# python3 -m service.server -c config.json
Traceback (most recent call last):
File "/usr/lib/python3.10/runpy.py", line 196, in _run_module_as_main
return _run_code(code, main_globals, None,
File "/usr/lib/python3.10/runpy.py", line 86, in _run_code
exec(code, run_globals)
File "/root/BTCML/service/server.py", line 7, in
from apscheduler.schedulers.asyncio import AsyncIOScheduler
ModuleNotFoundError: No module named 'apscheduler.schedulers.asyncio'

I am going to reinstall the project and do the training/data downloading from scratch again and give it a try then report back to you if it works or not. Thank you.

@asavinov
Copy link
Owner

asavinov commented Apr 1, 2023

Use the latest version 0.5.0 and the latest config (structure).
json.decoder.JSONDecodeError: Extra data: line 81 column 2 (char 1906) - here you have syntax error in your config.
ModuleNotFoundError: No module named 'apscheduler.schedulers.asyncio' here something wrong with the APScheduler package. Check that you installed it and have version 3.9

@ygbanks
Copy link
Author

ygbanks commented Apr 3, 2023

Hello brother, I have reinstalled all git from scratch, built a virtual environment then installed all requirements and included APScheduler 3.9. I then ran all of the scripts in order then met up with this error:
(venv) root@ygbanks-com:~/intelligent-trading-bot# python -m service.server -c config.json
Initializing server. Trade pair: BTCUSDT.
/root/intelligent-trading-bot/service/server.py:77: DeprecationWarning: There is no current event loop
App.loop = asyncio.get_event_loop()
Finished health check (connection, server status etc.)
Finished initial data collection.
Scheduler started.
/root/intelligent-trading-bot/venv/lib/python3.10/site-packages/scipy/stats/_stats_mstats_common.py:182: RuntimeWarning: invalid value encountered in double_scalars
slope = ssxym / ssxm
/root/intelligent-trading-bot/venv/lib/python3.10/site-packages/scipy/stats/_stats_mstats_common.py:196: RuntimeWarning: invalid value encountered in sqrt
t = r * np.sqrt(df / ((1.0 - r + TINY)(1.0 + r + TINY)))
/root/intelligent-trading-bot/venv/lib/python3.10/site-packages/scipy/stats/_stats_mstats_common.py:199: RuntimeWarning: invalid value encountered in double_scalars
slope_stderr = np.sqrt((1 - r**2) * ssym / ssxm / df)
/root/intelligent-trading-bot/venv/lib/python3.10/site-packages/scipy/stats/_stats_mstats_common.py:182: RuntimeWarning: invalid value encountered in double_scalars
slope = ssxym / ssxm
/root/intelligent-trading-bot/venv/lib/python3.10/site-packages/scipy/stats/_stats_mstats_common.py:196: RuntimeWarning: invalid value encountered in sqrt
t = r * np.sqrt(df / ((1.0 - r + TINY)
(1.0 + r + TINY)))
/root/intelligent-trading-bot/venv/lib/python3.10/site-packages/scipy/stats/_stats_mstats_common.py:199: RuntimeWarning: invalid value encountered in double_scalars
slope_stderr = np.sqrt((1 - r**2) * ssym / ssxm / df)

@iploshchik
Copy link

hi, which particular error did you meet? I see there are bunch of warnings, which could occur as Alexandr mentioned due to wrong version of scipy installed (but the script still runs). The depreciation warning could be related to non properly configured exchange api keys

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants