Al366io / binance-smartHold-trading-bot

SmartHolding Trading Bot

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

BTC Trading Bot: A Smart Hold Strategy

This trading bot is designed to automate the buying and selling of BTC on the BTC/USDT pair on Binance. Unlike aggressive trading bots, this bot focuses on a Smart Hold Strategy that aims to minimize risk while optimizing for long-term holding.

How it Works

Smart Hold Strategy: Why It's Different

This bot is designed for those who are committed to holding BTC in the long term. It operates on the principle that you should never lose money. Here are the possible scenarios:

  1. You Keep Holding BTC: The bot will not force sell your BTC. If conditions for selling are not met, you continue to hold, which is a good strategy for long-term investors.
  2. You Make a Profit: If the bot does sell, it means the BTC price has gone up. Even if the price doesn't go down again, you've sold at a higher price than you bought, resulting in a profit.

Overview:

  1. Time-Based Trading Window:
    • The bot sets a trading window every 4 hours for 1 minute, during which a sell actions can occur.
    • To Re-Buy, which is the most important thing, the bot doesn't wait 4 hours. If the condition to buy is met, it will perform the buy action straight away
  2. Buying Logic:
    • Buys if the current price is 5% below the average sell price.
    • Buys the maximum amount of BTC based on the available USDT balance.
    • Updates relevant parameters on successful buy.
  3. Selling Logic:
    • Sells if the current price is 5% above the last sell price or the last buy price if it's the first time selling after a buy.
    • Sells 12.5% of the total amount of BTC bought last time or the entire available BTC balance if it's less.
  4. WebSocket Connection:
    • Connects to Binance's WebSocket API for real-time price updates.
    • Handles reconnections and error scenarios.

Initial Setup and Requirements

To use this trading bot, there are some initial setup steps and requirements you must fulfill:

  1. Binance Account:

    You need to have an active Binance account. If you don't have one, you can sign up here.

  2. Binance API Key:

    You'll need to generate a Binance API key from your Binance account. This API key should be added to your .env file.

  3. .env File:

    We've included a .env.copy file in the repository to indicate which environment variables are needed. Rename this file to .env and fill in the required information.

  4. Initial BTC Holding:

    You need to already have some amount of BTC in your Binance account to start using the bot.

  5. Set Initial BTC Purchase Price:

    When you start the bot, you'll be prompted to set the price at which you initially bought your BTC. This is crucial for the bot's buying and selling logic.

Limitations

Like any trading bot, this bot is subject to market volatility and may not always make profitable trades. Additionally, the bot is designed to trade only on the BTC/USDT pair on Binance and may not work well on other exchanges or pairs.

Use this bot at your own risk and always do your own research before investing.

Contributing

If you would like to contribute to the bot, please feel free to fork the repository and submit a pull request.

About

SmartHolding Trading Bot

License:GNU General Public License v3.0


Languages

Language:JavaScript 99.5%Language:Makefile 0.3%Language:Dockerfile 0.2%