This CCXT Trading Bot is pre-configured for deployment on Heroku. You only need to provide the exchange, keys, and strategy.
-
Clone this repository to your local.
-
Add your respective exchange API keys to the config.py file. (Note: Kucoin is used for example)
-
Create your personal webhook password in the config.py file.
-
Update config key references in the app.py file.
-
Code your trading strategy in app.py. (Please see CCXT Manual for details.)
-
Postman Testing (Optional, but recommended)
- Install project packages
- In terminal, enter commands:
set FLASK_APP = app.py $env:FLASK_ENV = "development" flask run
Now you can test your bot locally via Postman. Make sure it will communicate with your exchange and execute orders correctly, and rejects any unauthorized requests.
-
On Heroku, create a new app, and follow Heroku instructions for either uploading directly from your local or for a Github repo. NOTE: Since this contains your account keys, if you upload to Github, make sure it is set to private. Heroku will build and deploy it automatically. If there are any build errors, make sure all the packages versions agree with Heroku's Python environment.
-
Provide your webhook endpoint and JSON-formatted password to whatever service will be making the requests.
Tradingview Alert Example
Webhook: https://(example-app).herokuapp.com/webhook
Message: { "password" : "123abc" }