Python script - Bybit Trades Data Saver using ClickHouse (ultra-fast solution for generating analytics)
Script will take the Trades data from Bybit REST API, save it to ClickHouse and then take it back from ClickHouse in JSON format.
First install ClickHoouse:
sudo apt-get install apt-transport-https ca-certificates dirmngr
sudo apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv E0C56BD4
echo "deb https://repo.clickhouse.tech/deb/stable/ main/" | sudo tee
/etc/apt/sources.list.d/clickhouse.list
sudo apt-get update
sudo apt-get install -y clickhouse-server clickhouse-client
And run it:
sudo service clickhouse-server start
clickhouse-client
Next create python virtual environment and activate it:
python3 -m venv .pb-ch && source .pb-ch/bin/activate
And then install necessary libraries:
pip install clickhouse-driver
pip install pandas
pip install pybit==2.4.1
This project is for informational and educational purposes only. You should not use this information or any other material as legal, tax, investment, financial or other advice. Nothing contained here is a recommendation, endorsement or offer by me to buy or sell any securities or other financial instruments. If you intend to use real money, use it at your own risk. Under no circumstances will I be responsible or liable for any claims, damages, losses, expenses, costs or liabilities of any kind, including but not limited to direct or indirect damages for loss of profits.
I develop trading bots of any complexity, dashboards and indicators for crypto exchanges, forex and stocks. To contact me:
Discord: https://discord.gg/zSw58e9Uvf
Join Bybit and receive up to $6,045 in Bonuses: https://www.bybit.com/invite?ref=P11NJW
I prefer using DigitalOcean.
To get $200 in credit over 60 days use my ref link: https://m.do.co/c/3d7f6e57bc04