For automatic trading on the stock exchange. Current implementation is for cryptocurrency trading on the cryptocurrency stock exchange Bitfinex.
Features: Web based. Server side: trading, collecting and storing history data, http server. Frontend: GUI, remote management, test strategy.
Overview: Current implementation developed for cryptocurrency trading on the cryptocurrency stock exchange Bitfinex. You have to have account and API Access.
Full overview might be found here
- Install server and frontend. Then all interactions will go through frontend GUI.
- Run GUI (from Start - Anaconda3 - Anaconda Prompt):
python trader/monitor_test.py
- Start the data collecting: Go to the last Tab and add pairs and timeframes. Start Collector. The history data will be collected for this pairs and timeframes. Note: You can trade only with pairs and timeframes that you've added.
- Ensure that the data collecting has been started by pushing the "Info" button. Note: You should wait a while. Check "count" for pairs, it should more than 200.
- You can play testing strategy before trading on testing tab
- Start trading: Go to the trading tab. Enter parameters and push Start button.
Connect to your server. You can do it with following command:
ssh [email protected] -p 22
Create user, update packages, clone repo:
adduser --gecos "" crypto_trader
usermod -aG sudo crypto_trader
apt-get -y update
apt-get -y upgrade
apt-get -y install git nano
su - crypto_trader
git clone https://github.com/Closius/crypto_trader.git
cd crypto_trader
I recommend to set your own POSTGRES_PASSWORD
and TRADER_PASSWORD
in setup.sh
for PostgresSql database
(With setup.sh
PostgresSql will be installed and a new database will be created).
Set your values in server/secret_settings.py
Hint: press Ctrl+X to finish editing with nano.
chmod +rx setup.sh
nano setup.sh
nano server/secret_settings.py
Run setup script:
sudo bash setup.sh
Download files from this repository or clone it with Git.
Clone repository (Install before Git. Then open console and type there):
git clone https://github.com/Closius/crypto_trader.git
Install Anaconda. I use Python 3.5.2 :: Anaconda 4.2.0 (x86_64). Also tested on Python 3.6. From Anaconda you need:
requests
matplotlib
statsmodels
PyQt5 (I use 5.10)
numpy
Windows: Go to Start - Anaconda3 - Anaconda Prompt
Install PyQtGraph:
pip install pyqtgraph
Install TA-lib. For Windows you can try unofficial windows binaries for both 32-bit and 64-bit
For install (from Anaconda Prompt):
pip install TA_lib.whl
Set SERVER_ENDPOINT
in secret_settings.py
. Note: Do not edit other variables in secret_settings.py
on frontend.
First stop trader and collector from frontend
Then go to your server and:
ssh [email protected] -p 22
cd ~/crypto_trader
git pull origin master
Check your values in server/secret_settings.py
sudo systemctl restart gunicorn_crypto_trader
sudo systemctl restart nginx