Closed jonathanicq closed 3 years ago
Hi Jonathan ! I had started looking at that but honestly I'm not so convinced that bots are the way to go... If I compare my crypto money, I lost more when trying to trade compared to holding specific values. So for the moment the project is a bit on hold. The biggest issue with bots is that they only seem to work if the market goes up... If it crashes down as we have seen recently, the bots don't seem to do a good job either preventing losses or avoiding the missed opportunity if the price bounces back up again... Have you already tried bots?
In fact, I've been working to define my own strategy and later take some bot to just replace the guidelines.
I believe that what we are needing most, is not the whole pack, but a nice interface where we can add/build our own strategy with low or no code.
Have you thought about it ?
I fully agree... I looked around what exists and it seems either we need to pay (around 100 per year seems to be the average), or it is command line bots from github such as here : https://github.com/edeng23/binance-trade-bot
This one has an UI but seems less robust and customizable : https://github.com/chrisleekr/binance-trading-bot
So I do agree with you but for the moment it seems that paying for an app is the only way to have customizable bots with an easy UI without coding... I tried to use Binance Limit trading to sell if go down and buy if go up but it requires to go daily to do it efficiently.
Let me know if you find any free tool for Binance that could be easily transferred to docker...
Ah, I remember why I stopped trying on this addon! It was just too resource intensive and crashed my rpi3+ on building. You could try it though, it should work if only it can build!
@alexbelgium I'll play with it I'm running over Rasp 4 (4Gb) it should be sufficient.
Can you detail a little bit the parameters? I saw that i can use a custom strategy, but is not clear how do i built it.
Cheers
Hi, all infos are here : https://github.com/edeng23/binance-trade-bot
I linked the addon options to the environment variable that could be accepted by the bots
BTW : no UI... but people seemed enthusiastic on github as I see the number of stars so I was thinking it was perhaps worth to try it ;)
@alexbelgium Unfortunately It does not start
ERROR: Failed building wheel for ujson
Successfully built sqlalchemy sqlitedict MarkupSafe cryptography regex PyYAML zope.interface Failed to build greenlet ujson ERROR: Could not build wheels for ujson which use PEP 517 and cannot be installed directly
Removing intermediate container 94c21f870ce3
21-05-17 09:38:13 ERROR (MainThread) [asyncio] Task exception was never retrieved future: <Task finished name='Task-275208' coro=<AddonManager.rebuild() done, defined at /usr/src/supervisor/supervisor/jobs/decorator.py:70> exception=AddonsError()> Traceback (most recent call last): File "/usr/src/supervisor/supervisor/docker/addon.py", line 520, in _build image, log = self.sys_docker.images.build( File "/usr/local/lib/python3.8/site-packages/docker/models/images.py", line 287, in build raise BuildError(chunk['error'], result_stream) docker.errors.BuildError: The command '/bin/ash -o pipefail -c apk add --no-cache git moreutils gcc musl-dev python3-dev libffi-dev openssl-dev cargo && pip install --upgrade pip && pip install -U pip && git clone https://github.com/edeng23/binance-trade-bot && cd /binance-trade-bot && python3 -m pip install -r requirements.txt' returned a non-zero code: 1 The above exception was the direct cause of the following exception: Traceback (most recent call last): File "/usr/src/supervisor/supervisor/addons/init.py", line 330, in rebuild await addon.instance.install(addon.version) File "/usr/src/supervisor/supervisor/utils/init.py", line 33, in wrap_api return await method(api, *args, kwargs) File "/usr/local/lib/python3.8/concurrent/futures/thread.py", line 57, in run result = self.fn(*self.args, *self.kwargs) File "/usr/src/supervisor/supervisor/docker/addon.py", line 504, in _install self._build(version) File "/usr/src/supervisor/supervisor/docker/addon.py", line 540, in _build raise DockerError() from err supervisor.exceptions.DockerError The above exception was the direct cause of the following exception: Traceback (most recent call last): File "/usr/src/supervisor/supervisor/jobs/decorator.py", line 107, in wrapper raise err File "/usr/src/supervisor/supervisor/jobs/decorator.py", line 105, in wrapper return await self._method(args, kwargs) File "/usr/src/supervisor/supervisor/addons/init.py", line 332, in rebuild raise AddonsError() from err supervisor.exceptions.AddonsError 21-05-17 09:38:26 INFO (MainThread) [supervisor.homeassistant.api] Updated Home Assistant API token 21-05-17 09:56:06 INFO (MainThread) [supervisor.updater] Fetching update data from https://version.home-assistant.io/stable.json 21-05-17 09:57:04 INFO (MainThread) [supervisor.resolution.check] Starting system checks with state CoreState.RUNNING 21-05-17 09:57:04 INFO (MainThread) [supervisor.resolution.checks.base] Run check for IssueType.PWNED/ContextType.ADDON 21-05-17 09:57:04 INFO (MainThread) [supervisor.resolution.checks.base] Run check for IssueType.SECURITY/ContextType.CORE 21-05-17 09:57:04 INFO (MainThread) [supervisor.resolution.checks.base] Run check for IssueType.FREE_SPACE/ContextType.SYSTEM 21-05-17 09:57:04 INFO (MainThread) [supervisor.resolution.check] System checks complete 21-05-17 09:57:04 INFO (MainThread) [supervisor.resolution.evaluate] Starting system evaluation with state CoreState.RUNNING 21-05-17 09:57:06 INFO (MainThread) [supervisor.resolution.evaluate] System evaluation complete 21-05-17 09:57:06 INFO (MainThread) [supervisor.resolution.fixup] Starting system autofix at state CoreState.RUNNING 21-05-17 09:57:06 INFO (MainThread) [supervisor.resolution.fixup] System autofix complete
Do you want to invest time on it ? The addons has no log only supervisor
Thanks for testing! I've modified the dockerfile to add gcc if you want to try to build again.
Sincerely I'm not convinced that it's worth it... Especially since I again lost 25% of my crypto money in 2 days with Elon musks 's latest tweets ;)
I'm updating it right now, keep you posted. where should I define the coins that I want to play ?
SUPPORTED_COIN_LIST: "XLM TRX ICX EOS IOTA ONT QTUM ETC ADA XMR DASH NEO ATOM DOGE VET BAT OMG BTT"
Is not in the config
Usually I don't update versions when I test it myself I just refresh the repo then rebuild ;-) I've bumped the version to 1.1 to allow you to install it more transparently :-)
Btw : installing too many builds manually causes a bug in HA where they accumulate and take a lot of place. You need to run in terminal "docker image prune - a - f" to remove those
Ah, the list of supported coins is manually encoded as an environmental variable. Tell me if you want to delete some and I'll do it - currently the whole list is present
@alexbelgium
No lucky yet
ERROR: Failed building wheel for ujson
Successfully built sqlalchemy sqlitedict MarkupSafe cryptography regex PyYAML zope.interface Failed to build greenlet ujson ERROR: Could not build wheels for ujson which use PEP 517 and cannot be installed directly
Removing intermediate container fe50ea5584a7
21-05-17 11:57:19 WARNING (MainThread) [supervisor.addons.validate] Add-on have full device access, and selective device access in the configuration. Please report this to the maintainer of Samba NAS 21-05-17 11:57:19 WARNING (MainThread) [supervisor.addons.validate] Add-on config 'startup' with 'before' is deprecated. Please report this to the maintainer of RPi MySensor Gateway 21-05-17 11:57:19 WARNING (MainThread) [supervisor.addons.validate] Add-on config 'auto_uart' is deprecated, use 'uart'. Please report this to the maintainer of RPi MySensor Gateway 21-05-17 11:57:19 WARNING (MainThread) [supervisor.addons.validate] Add-on config 'devices' use a deprecated format, the new format uses a list of paths only. Please report this to the maintainer of RPi MySensor Gateway 21-05-17 11:57:19 WARNING (MainThread) [supervisor.addons.validate] Add-on have full device access, and selective device access in the configuration. Please report this to the maintainer of RPi MySensor Gateway 21-05-17 11:57:20 WARNING (MainThread) [supervisor.addons.validate] Add-on have full device access, and selective device access in the configuration. Please report this to the maintainer of Emby beta NAS 21-05-17 11:57:22 INFO (MainThread) [supervisor.store] Loading add-ons from store: 101 all - 0 new - 0 remove 21-05-17 11:57:22 INFO (MainThread) [supervisor.store] Loading add-ons from store: 101 all - 0 new - 0 remove 21-05-17 11:57:22 INFO (MainThread) [supervisor.resolution.evaluate] System evaluation complete 21-05-17 11:57:22 INFO (MainThread) [supervisor.resolution.fixup] Starting system autofix at state CoreState.RUNNING 21-05-17 11:57:22 INFO (MainThread) [supervisor.resolution.fixup] System autofix complete 21-05-17 11:57:22 ERROR (MainThread) [asyncio] Task exception was never retrieved future: <Task finished name='Task-300284' coro=<AddonManager.rebuild() done, defined at /usr/src/supervisor/supervisor/jobs/decorator.py:70> exception=AddonsError()> Traceback (most recent call last): File "/usr/src/supervisor/supervisor/docker/addon.py", line 520, in _build image, log = self.sys_docker.images.build( File "/usr/local/lib/python3.8/site-packages/docker/models/images.py", line 287, in build raise BuildError(chunk['error'], result_stream) docker.errors.BuildError: The command '/bin/ash -o pipefail -c apk add --no-cache git moreutils gcc musl-dev python3-dev libffi-dev openssl-dev cargo && pip install --upgrade pip && pip install -U pip && git clone https://github.com/edeng23/binance-trade-bot && cd /binance-trade-bot && python3 -m pip install -r requirements.txt' returned a non-zero code: 1 The above exception was the direct cause of the following exception: Traceback (most recent call last): File "/usr/src/supervisor/supervisor/addons/init.py", line 330, in rebuild await addon.instance.install(addon.version) File "/usr/src/supervisor/supervisor/utils/init.py", line 33, in wrap_api return await method(api, *args, kwargs) File "/usr/local/lib/python3.8/concurrent/futures/thread.py", line 57, in run result = self.fn(*self.args, *self.kwargs) File "/usr/src/supervisor/supervisor/docker/addon.py", line 504, in _install self._build(version) File "/usr/src/supervisor/supervisor/docker/addon.py", line 540, in _build raise DockerError() from err supervisor.exceptions.DockerError The above exception was the direct cause of the following exception: Traceback (most recent call last): File "/usr/src/supervisor/supervisor/jobs/decorator.py", line 107, in wrapper raise err File "/usr/src/supervisor/supervisor/jobs/decorator.py", line 105, in wrapper return await self._method(args, kwargs) File "/usr/src/supervisor/supervisor/addons/init.py", line 332, in rebuild raise AddonsError() from err supervisor.exceptions.AddonsError 21-05-17 12:03:19 INFO (MainThread) [supervisor.host.apparmor] Adding/updating AppArmor profile: 6c45555e_binance_bot 21-05-17 12:03:19 INFO (MainThread) [supervisor.host.services] Reloading local service hassos-apparmor.service 21-05-17 12:03:20 INFO (SyncWorker_3) [supervisor.docker.addon] Starting build for 6c45555e/aarch64-addon-binance_bot:1.1
@alexbelgium 21-05-17 12:33:11 INFO (SyncWorker_3) [supervisor.docker.addon] Build 6c45555e/aarch64-addon-binance_bot:1.1 done 21-05-17 12:33:11 INFO (MainThread) [supervisor.addons] Add-on '6c45555e_binance_bot' successfully installed 21-05-17 12:40:58 WARNING (MainThread) [supervisor.addons.options] Option 'CURRENT_COIN_SYMBOL' does not exist in the schema for Binance Trader Bot (6c45555e_binance_bot) 21-05-17 12:40:58 WARNING (MainThread) [supervisor.addons.options] Option 'SUPPORTED_COIN_LIST' does not exist in the schema for Binance Trader Bot (6c45555e_binance_bot) 21-05-17 12:40:58 WARNING (MainThread) [supervisor.addons.options] Option 'BRIDGE_SYMBOL' does not exist in the schema for Binance Trader Bot (6c45555e_binance_bot) 21-05-17 12:40:58 WARNING (MainThread) [supervisor.addons.options] Option 'API_KEY' does not exist in the schema for Binance Trader Bot (6c45555e_binance_bot) 21-05-17 12:40:58 WARNING (MainThread) [supervisor.addons.options] Option 'API_SECRET_KEY' does not exist in the schema for Binance Trader Bot (6c45555e_binance_bot) 21-05-17 12:40:58 WARNING (MainThread) [supervisor.addons.options] Option 'SCOUT_MULTIPLIER' does not exist in the schema for Binance Trader Bot (6c45555e_binance_bot) 21-05-17 12:40:58 WARNING (MainThread) [supervisor.addons.options] Option 'SCOUT_SLEEP_TIME' does not exist in the schema for Binance Trader Bot (6c45555e_binance_bot) 21-05-17 12:40:58 WARNING (MainThread) [supervisor.addons.options] Option 'TLD' does not exist in the schema for Binance Trader Bot (6c45555e_binance_bot) 21-05-17 12:40:58 WARNING (MainThread) [supervisor.addons.options] Option 'BUY_TIMEOUT' does not exist in the schema for Binance Trader Bot (6c45555e_binance_bot) 21-05-17 12:40:58 WARNING (MainThread) [supervisor.addons.options] Option 'SELL_TIMEOUT' does not exist in the schema for Binance Trader Bot (6c45555e_binance_bot) 21-05-17 12:41:09 WARNING (MainThread) [supervisor.addons.options] Option 'CURRENT_COIN_SYMBOL' does not exist in the schema for Binance Trader Bot (6c45555e_binance_bot) 21-05-17 12:41:09 WARNING (MainThread) [supervisor.addons.options] Option 'BRIDGE_SYMBOL' does not exist in the schema for Binance Trader Bot (6c45555e_binance_bot) 21-05-17 12:41:09 WARNING (MainThread) [supervisor.addons.options] Option 'API_KEY' does not exist in the schema for Binance Trader Bot (6c45555e_binance_bot) 21-05-17 12:41:09 WARNING (MainThread) [supervisor.addons.options] Option 'API_SECRET_KEY' does not exist in the schema for Binance Trader Bot (6c45555e_binance_bot) 21-05-17 12:41:09 WARNING (MainThread) [supervisor.addons.options] Option 'SCOUT_MULTIPLIER' does not exist in the schema for Binance Trader Bot (6c45555e_binance_bot) 21-05-17 12:41:09 WARNING (MainThread) [supervisor.addons.options] Option 'SCOUT_SLEEP_TIME' does not exist in the schema for Binance Trader Bot (6c45555e_binance_bot) 21-05-17 12:41:09 WARNING (MainThread) [supervisor.addons.options] Option 'TLD' does not exist in the schema for Binance Trader Bot (6c45555e_binance_bot) 21-05-17 12:41:09 WARNING (MainThread) [supervisor.addons.options] Option 'BUY_TIMEOUT' does not exist in the schema for Binance Trader Bot (6c45555e_binance_bot) 21-05-17 12:41:09 WARNING (MainThread) [supervisor.addons.options] Option 'SELL_TIMEOUT' does not exist in the schema for Binance Trader Bot (6c45555e_binance_bot) 21-05-17 12:41:51 INFO (SyncWorker_1) [supervisor.docker.interface] Cleaning addon_6c45555e_binance_bot application 21-05-17 12:41:53 INFO (SyncWorker_1) [supervisor.docker.addon] Starting Docker add-on 6c45555e/aarch64-addon-binance_bot with version 1.1 21-05-17 12:44:00 INFO (MainThread) [supervisor.snapshots] Found 9 snapshot files 21-05-17 12:44:09 INFO (SyncWorker_2) [supervisor.docker.interface] Cleaning addon_6c45555e_binance_bot application 21-05-17 12:44:11 INFO (SyncWorker_2) [supervisor.docker.addon] Starting Docker add-on 6c45555e/aarch64-addon-binance_bot with version 1.1
well at least it starts now :-)
For your errors, did you encode the options manually in the addon options? You need to use the pre-existing format (not in yaml) or else it won't work
I've mapped them to the ones that you are using : api_key=APIKEY api_secret_key=APISECRET current_coin=CURRENTCOIN bridge=BRIDGE tld=DOMAIN hourToKeepScoutHistory=HISTORY scout_multiplier=SCOUTMULTI scout_sleep_time=SCOUTSLEEP strategy=STRATEGY buy_timeout=BUYTIMEOUT sell_timeout=SELLTIMEOUT
error on run.sh location, I'll correct that
@alexbelgium I'm using all the test data from edeng23
Don't worry about the key's they are not my real one :)
ah ah ;-) it was my first reaction I was a bit worried ;-) although with the keys I don't believe we can take the money out of Binance - only trade it from one crypto to another
It's building fine on mine system too now and I'm just patching a few thing
Latest version starts but has another type of bug
Actually perhaps it works and its only because I don't use a binance key that it exists while saying that history is empty
@alexbelgium
After my HA Restart this is what happen 21-05-17 19:53:47 ERROR (SyncWorker_0) [supervisor.docker] Image 6c45555e/aarch64-addon-binance_bot not exists for addon_6c45555e_binance_bot 21-05-17 19:53:47 INFO (SyncWorker_0) [supervisor.resolution.module] Create new issue IssueType.MISSING_IMAGE - ContextType.ADDON / 6c45555e_binance_bot 21-05-17 19:53:47 INFO (SyncWorker_0) [supervisor.resolution.module] Create new suggestion SuggestionType.EXECUTE_REPAIR - ContextType.ADDON / 6c45555e_binance_bot 21-05-17 19:53:47 ERROR (MainThread) [asyncio] Task exception was never retrieved future: <Task finished name='Task-1212' coro=<HomeAssistantWebSocket.async_send_command() done, defined at /usr/src/supervisor/supervisor/homeassistant/websocket.py:106> exception=TypeError('Received message 257:None is not str')> Traceback (most recent call last): File "/usr/src/supervisor/supervisor/homeassistant/websocket.py", line 134, in async_send_command return await self._client.async_send_command(message) File "/usr/src/supervisor/supervisor/homeassistant/websocket.py", line 46, in async_send_command response = await self.client.receive_json() File "/usr/local/lib/python3.8/site-packages/aiohttp/client_ws.py", line 291, in receive_json data = await self.receive_str(timeout=timeout) File "/usr/local/lib/python3.8/site-packages/aiohttp/client_ws.py", line 276, in receive_str raise TypeError(f"Received message {msg.type}:{msg.data!r} is not str") TypeError: Received message 257:None is not str 21-05-17 19:53:56 INFO (MainThread) [supervisor.api.proxy] Home Assistant WebSocket API request initialize 21-05-17 19:53:56 INFO (MainThread) [supervisor.api.proxy] WebSocket access from a0d7b954_nodered 21-05-17 19:53:56 INFO (MainThread) [supervisor.api.proxy] Home Assistant WebSocket API request running
Then I click over Rebuild and when I click to start
21-05-17 19:57:09 ERROR (MainThread) [supervisor.utils] Can't execute run while a task is in progress
it should that it's on but no log in the addon tab
I expect that when I start it shows something in the supervisor and/or in the log of the addon. like the the v1.1 So I think there is something triggering twice
@alexbelgium It finally enriched some log line It Seems that is missing a file
[s6-init] making user provided files available at /var/run/s6/etc...exited 0. [s6-init] ensuring user provided files have correct perms...exited 0. [fix-attrs.d] applying ownership & permissions fixes... [fix-attrs.d] done. [cont-init.d] executing container initialization scripts... [cont-init.d] done. [services.d] starting services [services.d] done. sed: /user.cfg: No such file or directory [cmd] /binance-trade-bot/run.sh exited 1 [cont-finish.d] executing container finish scripts... [cont-finish.d] done. [s6-finish] waiting for services. [s6-finish] sending all processes the TERM signal.
Hi, have you updated to v0.1? It should solve this issue :) thanks :)
@alexbelgium Indeed the new version its better
2021-05-18 08:31:51,643 - crypto_trading_logger - INFO - Starting
Traceback (most recent call last):
File "/usr/local/lib/python3.9/runpy.py", line 197, in _run_module_as_main
return _run_code(code, main_globals, None,
File "/usr/local/lib/python3.9/runpy.py", line 87, in _run_code
exec(code, run_globals)
File "/binance-trade-bot/binance_trade_bot/main.py", line 5, in
Do you think that the service it stoped due the fake key ? Can you add a nife error feedback (Connection fail or something like that?)
@alexbelgium I've tested with my real key and i got the same result, so It's really a problem.
Thanks! It was a coding error... Should be solved I'll try again :)
Oh it seems to work! The only error I have is invalid api key now @jonathanicq
@alexbelgium
Indeed it moved a lot forward but I got stuck on that log
2021-05-18 20:58:26,967 - crypto_trading_logger - INFO - Initializing
Would anything should be otherwise? Isn't it a sign that it is working?
Mmh I see several mention of this error 9n the upstream image repo https://github.com/edeng23/binance-trade-bot/issues?q=Order+does+not+exist. But no clear solution...
@alexbelgium I've facing also this error "invalid quantity"
2021-05-19 16:24:48,184 - crypto_trading_logger - INFO - Initializing
Hi Jonathan, I had no time recently to work on it, but I saw that another trading bot exists! https://github.com/miouzikal/hassio-addons/tree/master/binance-trade-bot-for-hassio
Perhaps it would interest you ;)
@alexbelgium Thanks man, I'll give a look for sure.
@alexbelgium I saw your msg by e-mail, but I was off and now I can't find where you wrote me. But... No, the Bot is not making profit I need to dig more on it, but I saw that missed several good opportunities.
Anyways, I'll keep you posted
Thanks... It is hard to make money I find with bitcoin for the moment. Good luck!
Closing issue as another comparable addon exists
Hi Alex, Nice to see that you are working on such project. I'm counting down the days to put your bot on test. Let me know if you need beta tester.
Regards