Building a

Bitcoin trading bot

in Python

Or: How to get a working project done in one weekend

Anton Pirker - PyDays Vienna 2019 - anton@ignaz.at

Prices

Algorithm

Trade API

Logging

Status Page

Coinigy

Trading API

(REST)

Coinigy

Prices API (WebSockets)

Binance/Bittrex

DB

Prices

Algorithm

Trade API

Logging

Status Page

Coinigy

Trading API

(REST)

Coinigy

Trades API (WebSockets)

Binance/Bittrex

DB

(show trading script)

https://gitlab.com/antonpirker/cryptobot/blob/master/trade.py

(show fetch prices)

https://gitlab.com/antonpirker/cryptobot/blob/master/fetch_prices.py

(show status page script)

https://gitlab.com/antonpirker/cryptobot/blob/master/status.py

supervisor

to start scripts

and

keep them running

http://supervisord.org/

cronjob

to restart script every couple of hours

(because of websocket disconnecting)

Trading from: 2018-04-19

Trading until: 2018-05-19

Stats

BTC Price at beginning: USD 8,250

BTC Price at the end: USD 8,233

Number of trades: 450

 

Gains (more or less): 0

(because of fees)

Know the scope

Prioritize

Start with the hard part

Make it work. Make it right. Make it fast.

Use what you have/know

Conclusion

Thank's

http://bit.ly/pythonbitcoinbot - https://gitlab.com/antonpirker/cryptobot

Building a Bitcoin trading bot in Python (Python Days 2021)

By antonpirker

Building a Bitcoin trading bot in Python (Python Days 2021)

Or: How to get a working project done in one weekend

  • 682