Improving the Macd 2.0 crypto trading algorithm using bearish detection

CryptoPredicted
Coinmonks
Published in
5 min readMay 24, 2018

--

Previously we analyzed and discussed our brand new Macd 2.0 algorithm. If you’ve been reading our posts then you’ll know I mentioned that these algorithms can be improved a lot. In this supplementary post I will discuss my progress on improving the Macd 2.0 algorithm.

Trend trading

As I mentioned in my previous posts, the state of the market is extremely important. For instance, don’t enter trades when the market is going down (a.k.a. bearish), unless you really know what you are doing.

Also Read: Best Crypto Trading Bots

Right now none of our algorithms take this into account, that’s why the 30-day ROIs went from over 40% (two weeks ago) to less than 15% (right now):

Signal ROIs as of today

You may recall that the MACD indicator is determined by subtracting two moving averages. We can then use this new data and come up with a trading algorithm/heuristic — and this we’ve been doing until now.

The challenge is now to optimize our Macd 2.0 algorithm by taking other features into account, such as the fact whether the market is bearish or not. By adding additional lines of code into our program we increase its complexity, and making it harder for hyper-parameter optimization. To keep the latter as simple as possible we have to keep the code as basic as possible, yet effective.

Bearish detection

I’ve spent many hours trying out various indicators and designing algorithms that would allow me to detect bearish conditions. But the harder I tried the more complex my code became, which was highly unfavorable. Eventually I came up with a method that was basic, yet effective.

Let us evaluate my new bearish detection technique through back testing. In the results below I ran trading simulations and computed its ROIs. These tests all used 5 months worth of data, from 1 January to 24 May.

ETH-USDT

The next chart shows the Buy/Sell signals without bearish detection code. Its average ROI is 78%.

The next chart shows the Buy/Sell signals with bearish detection code. Its average ROI is 97% (+19% more than the original algorithm).

LTC-USDT

The next chart shows the Buy/Sell signals without bearish detection code. Its average ROI is 41%.

The next chart shows the Buy/Sell signals with bearish detection code. Its average ROI is 51% (+10% more than the original algorithm).

BTC-USDT

The next chart shows the Buy/Sell signals without bearish detection code. Its average ROI is 12%.

The next chart shows the Buy/Sell signals with bearish detection code. Its average ROI is 36% (+24% more than the original algorithm).

Results analysis

The bearish detection code clearly did a good job. It improved the ROI of all algorithms by an average of 15%, and had the biggest improvement for BTC.

These improvements are also clearly visible on the charts themselves (that’s why I’ve shown them) — you can notice that during periods where the price is going down: there are way less buy/sell trades thanks to bearish detection. This eliminates many of the losing trades. The end result is a higher ROI.

Conclusion

For this analysis I’ve used 5 months worth of data, as opposed to our traditional 30 days. This was done on purpose to emphasize the impact on the overall ROI. This long period also has way more bearish periods than a 30-day period would have. If I run the same analysis on a randomly selected 30-day range, we would probably see a much lower change in ROI, because after all it’s not that big of an impact on a short-term basis.

This bearish detection code is the best I was able to come up with, which also had a positive impact on the overall ROI. So the optimization journey doesn’t end here, it’s just the beginning. After some more successful analysis I will adjust our existing app algorithms/signals with this bearish detection code.

Thank you for reading! If you enjoy our content feel free to give this post a clap. And follow us to stay tuned for more.
- Ilya Nevolin

Also, Read

--

--

CryptoPredicted
Coinmonks

Cryptocurrency price predictions using machine learning, development and analysis of algorithmic trading strategies and more. App: https://cryptopredicted.com/