- Install Docker. For the sake of simplicity, the bot is wrapped into Docker container.
- Create Binance API Key. Make sure it is trading only and restricted to withdrawals.
After you get API Key and Secret from Binance there are 2 options how to proceed:
- Create config file 'api.json' with the following contents:
{
"exchanges":[
{
"name": "binance",
"key": "YOUR_API_KEY",
"secret": "YOUR_API_SECRET"
}
]
}
- Pass Key and Secret as parameters to the Docker
-e "KEY=BINANCE_API_KEY"
and-e "SECRET=BINANCE_API_SECRET"
- Pull the image
docker pull iilunin/crypto-bot:stable
. - Create the folder for active and completed trades:
mkdir Active
- where you will put all new tradesmkdir Completed
- where bot will put completed trades
- If you store your API keys in
api.json
file then you need to create another foldermkdir Config
and copyapi.json
there. - Run the Bot. You will also need to specify timezone in the
TZ
parameter. The whole list of timezones is available here. If you don't useapi.json
, just remove this line-v $(pwd)/Config:/usr/src/configs:ro \
docker run -d --rm --name cryptobot \
-e "TZ=America/New_York" \
-e "KEY=BINANCE_API_KEY" \
-e "SECRET=BINANCE_API_SECRET" \
-v $(pwd)/Active:/usr/src/trades \
-v $(pwd)/Completed:/usr/src/complete_trades \
-v $(pwd)/Config:/usr/src/configs:ro \
iilunin/crypto-bot:stable
Once the bot is started, you can place your trade files into the Active
directory, so they picked up by the bot.
If by the start time Active
directory has trade files they will be picked up as well.
To stop the bot run docker stop cryptobot
Running Bot with UI enabled:
docker run -d --rm -p 3000:3000 --name cryptobot \
-e "TZ=America/New_York" \
-e "KEY=BINANCE_API_KEY" \
-e "SECRET=BINANCE_API_SECRET" \
-e "API_USER=ANY_USER_NAME" \
-e "API_PASS=ANY_PASSWORD" \
-v $(pwd)/Active:/usr/src/trades \
-v $(pwd)/Completed:/usr/src/complete_trades \
-v $(pwd)/Config:/usr/src/configs:ro \
iilunin/crypto-bot:stable
You need to specify API_USER
and API_PASS
. With this credentials you'll be able to authenticate
to the web interface. Web interface is accessible via this url http://localhost:3000
On Mac, sometimes Docker VM is getting out of sync with local time, which makes Biancne API unusable. The fasted (and only so far) method of fixing it, just to restart Docker (Click Docker icon in the top bar, and select Restart menu)