https://github.com/camhahu/bybit-trading-bot
A trading bot for Bybit utilising APScheduler
https://github.com/camhahu/bybit-trading-bot
backtester bybit trading-bot
Last synced: 7 months ago
JSON representation
A trading bot for Bybit utilising APScheduler
- Host: GitHub
- URL: https://github.com/camhahu/bybit-trading-bot
- Owner: camhahu
- Created: 2020-02-29T09:11:19.000Z (over 6 years ago)
- Default Branch: master
- Last Pushed: 2020-04-16T23:21:30.000Z (over 6 years ago)
- Last Synced: 2025-08-12T21:04:12.166Z (12 months ago)
- Topics: backtester, bybit, trading-bot
- Language: Python
- Homepage:
- Size: 172 KB
- Stars: 17
- Watchers: 2
- Forks: 18
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Simple Bybit Trading Bot
Still in development!
A trading bot that can be used with the [Bybit trading platform](https://www.bybit.com/app/exchange/BTCUSD).
Works out of the box with a simple (not profitable) strategy implementation.
You can implement your own stratwegies by inheriting from the BaseStrategy class. See strategies/__init__.py for more information.
# Usage
Clone the repository and set up a python virtual environment.
Install the packages in requirements.txt with pip
You will need to [get an API key and secret](https://help.bybit.com/hc/en-us/articles/360039260974-How-to-add-a-new-API-key-) from Bybit.
Add the values to secret/bybit_keys.json
Running main.py will start the bot using APScheduler. It is effectively a cron job managed by a python program.
Backtesting/Optimising strategies can be done by running testing.py.
See comments for more details.
# Todo
- Run as a service instead of using APScheduler
- Properly implement the pandas/numpy math in strategies to utilise vector operations
- Telegram bot to send messages when the bot takes actions + some sort of intermittent summaries
- Write unit tests for the MockExchange and Backtester
- Add features for Limit orders, stop loss/take profit in TradintBot
- Give the bot an on-tick callback, as opposed to only querying the server when a new candle is ready
# Things I've Learnt
- cron jobs
- How to make a basic Telegram bot
- How to optimise hyperparameters for a model
- Different trading strategies, risk management strategies, technical analysis in general
- Trading manually is more fun