Algo-Trading  with Python(ic)

in #bitcoin6 years ago (edited)

When I began with crypto trading, I quickly realized that I couldn’t pay that much attention to the market and prices which it deserves. Compared to the traditional stock markets, crypto currencies are traded 24/7.

Depending on your local timezone and your time expenses during the day, it is mandatory to have an automatism which act as your agent when the markets is getting interesting for you in terms of placing orders.

My first approach was to develop Python based trading algorithms based on Jupyter and Plotly.

Plotly has a good looking visualization of OHLC data and the use of Jupyter has the advantage of running a trading server headless.

But are those features important when we think about automatic trading? From my experience in trading bot development, a good platform must fulfill the following characteristics:

  • Open Source
  • Debugging capability
  • Back-testing capability
  • Reliable interfaces for stock exchanges
  • Logging

My job has given me the opportunity to do extensive tests with Node-RED, a web-based data-flow programming framework based on Java Script which meets some of my requirements perfectly. But there are also some characteristics which are detrimental for the us as the platform for developing a trading bot based on it:

  • No multiprocessing
  • Lack of suitable libraries (compared to Python)

To my mind, there is no way around Python. Based on my experiences with Node-RED, I started to develop a suitable counterpart. Unfortunately, my skills in developing web-based interactive GUIs are very limited, so I choose PyQT5 for creating a GUI. The result can be seen below:

I named the result Pythonic.

Pythonic meets the following conditions:

  • Open Source
  • Platform independent
  • Multi-language (currently EN, DE, ES, CN)
  • Extensive debugging and logging features
  • Extensible by self-made Python code
  • Full access to the entire range of Python libraries
  • Many pre-configured standard functions (scheduler, branch, go-to, technical analysis, …)
  • Apply changes on-the-fly

Of course there are also some characteristics which may be adverse compared to other solutions:

  • No global namespace: Every element is executed in its own process
  • Multiprocessing: The start of a separate process is rather slow compared to multithreading
  • No built-in visualization options for market data

I also included a Monero miner which uses 1 CPU core to mine for my benefit, but you usually take no notice about it normal operation.

The lack of visualization possibility for market data is a conscious decision: The visualizations of market data which you find on the website of your favorite cryto exchanges are normally much better than everything you find in the accessories area of PyQT5.

It took me over one year to develop this tool in my leisure. Of course the work is not done: future releases will bring new features and enhancements.

For those who want to test it, follow the installation instruction on the Github repository. I will also write some tutorials how to setup a trading bot based on Pythonic.

Sort:  

✅ Enjoy the vote! For more amazing content, please follow @themadcurator for a chance to receive more free votes!

Coin Marketplace

STEEM 0.26
TRX 0.20
JST 0.038
BTC 97252.23
ETH 3609.35
USDT 1.00
SBD 3.85