Giter Club home page Giter Club logo

bybit_bot's Introduction

Bybit Unified Trading Bot

This trading bot is designed to automate trading actions on the Bybit exchange, specifically focusing on exploiting funding rate discrepancies across different cryptocurrency contracts. It employs the pybit.unified_trading API to interact with the Bybit exchange, fetching real-time funding rates, server time, and account balances, and placing trades based on calculated metrics.

Features

  • Fetches real-time server time from Bybit.
  • Retrieves account balance in USDT (Tether).
  • Determines the latest funding rates for specified symbols.
  • Identifies symbols with the highest and lowest funding rates.
  • Places market orders with calculated quantities, including setting take profit (TP) and stop loss (SL) levels.
  • Schedules trading actions to execute at specific times each day.

Requirements

  • Python 3.6 or higher.
  • pybit - For interacting with Bybit's API.
  • pandas - For data manipulation and analysis.
  • python-dotenv - For loading environment variables from a .env file.
  • concurrent.futures - For parallel execution of tasks.
  • A .env file containing your Bybit API key and secret.

Installation

  1. Clone this repository to your local machine.
  2. Install required Python packages:
pip install pybit pandas python-dotenv
  1. Create a .env file in the root directory of the project, and add your Bybit API key and secret as follows:
Bybit_API_Key=your_api_key_here
Bybit_API_Secret=your_api_secret_here

Usage

  1. Ensure your .env file with API credentials is set up.
  2. Run the script:
python <script_name>.py
  1. The bot will start and follow the scheduled times for executing the trading strategy.

Strategy Overview

  • The bot calculates the risk exposure based on a predefined threshold and the account balance.
  • It fetches the current funding rates for symbols listed in a specified CSV file.
  • Based on the funding rates, it identifies the symbols with the most extreme rates (highest and lowest).
  • Orders are placed on the symbol with the best (highest absolute value) funding rate, considering risk management by setting TP and SL levels.
  • The bot is scheduled to run these checks and trades at specific times daily.

Contributions

Contributions are welcome. Please open an issue or pull request if you have suggestions or improvements.

Disclaimer

This trading bot is provided as-is, and it comes with no guarantees or warranties. Trading cryptocurrencies carries a high level of risk, and you should only trade with money you can afford to lose. The developers are not responsible for any trading losses incurred using this software.

bybit_bot's People

Contributors

loryo80 avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.