{"id":16419699,"url":"https://github.com/salaah01/simple-binance-bot","last_synced_at":"2025-03-21T03:32:54.590Z","repository":{"id":39719493,"uuid":"362914076","full_name":"Salaah01/simple-binance-bot","owner":"Salaah01","description":"A very simple Binance bot","archived":false,"fork":false,"pushed_at":"2024-09-04T00:11:38.000Z","size":148,"stargazers_count":8,"open_issues_count":10,"forks_count":3,"subscribers_count":3,"default_branch":"master","last_synced_at":"2024-10-12T07:25:35.471Z","etag":null,"topics":["binance","binance-api","bitcoin","bot","cryptocurrency","python","trading"],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/Salaah01.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":"CODE_OF_CONDUCT.md","threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2021-04-29T18:40:40.000Z","updated_at":"2024-08-28T20:17:43.000Z","dependencies_parsed_at":"2024-03-27T00:32:40.858Z","dependency_job_id":"425726db-30d7-4b13-8745-26b590f30b3a","html_url":"https://github.com/Salaah01/simple-binance-bot","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Salaah01%2Fsimple-binance-bot","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Salaah01%2Fsimple-binance-bot/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Salaah01%2Fsimple-binance-bot/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Salaah01%2Fsimple-binance-bot/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Salaah01","download_url":"https://codeload.github.com/Salaah01/simple-binance-bot/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":221811374,"owners_count":16884305,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["binance","binance-api","bitcoin","bot","cryptocurrency","python","trading"],"created_at":"2024-10-11T07:25:37.706Z","updated_at":"2024-10-28T09:16:33.062Z","avatar_url":"https://github.com/Salaah01.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Simple Binance Bot\n\nA very simple bot that trades in the Binance market.\n\n## Strategies\n\nThe bot uses RSI and Bollinger to estimate the best time to buy and sell\nassets.\nCharacteristics such as length/period for analysing data can be accessed and\nupdated from `./bot/config.json`.\n\n## Setup\n\n### Binance\n\n- Create a [Binance account](https://www.binance.com/en/register?ref=135385561).\n- Enable Two-Factor Authentication\n- Create a new set of API keys.\n- Deposit some money or buy some cryptocurrency. Either some form of balance or currency is needed for the bot to be able to buy/sell.\n\n### Bot\n\n1. Create a the file `./bot/.keys.json` and add your API keys. Example below:\n\n```json\n{\n  \"BINANCE_API_KEY\": \"\u003cBINANCE_API_KEY\u003e\",\n  \"BINANCE_SECRET_KEY\": \"\u003cBINANCE_SECRET_KEY\u003e\"\n}\n```\n\n2. If you are using Linux/UNIX, I recommend changing the permissions of the created file to 600 for added security: `chmod 600 ./bot/.keys.json`.\n\n3. If you are using Docker, then go to step 4, otherwise, skip step 4.\n\n4. Build the docker image: `docker-compose up --build`. Skip the rest of the steps (Isn't Docker great?)\n5. Install [TA-Lib](https://github.com/mrjbq7/ta-lib). The process differs depending on your OS, so please read the documentation.\n6. Create a virtual environment. `python -m venv venv`.\n7. Activate the virtual environment:\n   **Linux:** `venv/bin/activate`.\n   **Windows (Powershell):** `venv\\Scripts\\Activate`.\n8. Install Python packages: `pip install -r ./bot/requirements.txt`.\n\n## Running (and Testing) Bot\n\nIf you are using Docker, you would need to ensure that the containers are running. To run the containers, `docker-compose up`. Once you have started containers, you can run `bash bot_shell.sh` that will connect you to the bot container into a bash shell.\n\nFor those who are not using docker: `cd bot`.\n\nAs the name suggests, `controller.py` controls most of the automation. In order to start testing/running run `python controller.py` followed by args. To see a full, up-to-date list of the args, run `python controller.py -h`.\n\n**Usage**\n\n```\nusage: controller.py [-h] [-t] [-m {balance_amount,balance_percent}]\n                     [-p FLAT_AMOUNT] [-P BALANCE_PERCENT]\n\nArguments for setting up the Binance bot.\n\noptional arguments:\n  -h, --help            show this help message and exit\n  -t, --test-mode       Run in test mode?\n  -m {balance_amount,balance_percent}, --buy-mode {balance_amount,balance_percent}\n                        What buying strategy would you like to use?\n  -p FLAT_AMOUNT, --flat-amount FLAT_AMOUNT\n                        Flat amount to pay for each buy operation.\n  -P BALANCE_PERCENT, --balance-percent BALANCE_PERCENT\n                        Percentage of available balance to use during buy operation\n                        (25=25%).\n```\n\n**Configuration**\nMost of the configurations is handled by `./bot/config.json`.\nBelow is a outline of each configuration.\n\n```json\n{\n  \"defaults\": {\n    \"interval\": \"\u003c\u003c Interval e.g: \u003c\u003c 1m, 3m, 5m, 4h \u003e\u003e\",\n    \"socket_address\": \"THIS SHOULD NOT BE CHANGED.\",\n    \"stop_loss_percent\": \"\u003c\u003c Stop loss percentage. 10 = 10%.\",\n    \"closes_array_size\": \"THIS SHOULD NOT BE CHANGED.\"\n  },\n  \"buy_options\": {\n    \"test_mode\": \"Running on test mode? (bool)\",\n    \"mode\": \"Trading mode. 'balance_percent' or 'balance_percent'\"\n  },\n  \"strategies\": {\n    \"rsi\": {\n      \"period\": \"RSI period as an integer. e.g: 14\",\n      \"overbought_limit\": \"RSI upper limit (overbought). e.g: 70\",\n      \"oversold_limit\": \"RSI lower limit (oversold). e.g: 30\"\n    },\n    \"bollinger\": {\n      \"period\": \"Bollinger period. e.g: 20\"\n    }\n  },\n  \"testing\": {\n    \"testing\": \"Running on test most? - (bool)\",\n    \"post_requests\": \"Send post requests during test most? (bool)\"\n  },\n  \"trade_currencies\": [\"Currencies to trade in:\", \"GBP\", \"USDT\"],\n  \"trade_symbols\": [\n    \"ETCUSDT\",\n    \"EOSUSDT\",\n    \"QTUMUSDT\",\n    \"THETAUSDT\",\n    \"CTSIUSDT\",\n    \"ONTUSDT\",\n    \"ZENUSDT\",\n    \"STORJUSDT\",\n    \"REEFUSDT\",\n    \"ZECUSDT\"\n  ]\n}\n```\n\n## Disclaimer\n\nYou are free to use this program as you wish but must understand the risks associated with using the program. I do not have a financial background and have no authority in advising when it is best to buy/sell assets.\n\nAs such, I do not guarantee that you will make money and warn you that you may in fact lose money.\n\nUnder no circumstances will I or any other contributor be held responsible or liable in any way for any claims, damages, losses, expenses or any other liabilities whatsoever.\n\nBy using this program you acknowledge that you so at your own risk.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsalaah01%2Fsimple-binance-bot","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsalaah01%2Fsimple-binance-bot","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsalaah01%2Fsimple-binance-bot/lists"}