The Ichess algorithm for trading crypto
Added 2024-08-16 07:00:01 +0000 UTCThe Ichess algorithm for trading crypto
Introduction
In this short post I will present the results I got from backtesting the Ichess trading strategy. The strategy is available in the following github repository: PeetCrypto/freqtrade-stuff: Strategies for Freqtrade (github.com). This repository contains many other algorithms too that I tested or one day will test.
The code is also available in other repo’s if you search GitHub: Code search results (github.com) In case the PeetCrypto repository will get offline.
The algorithm is created by @Mablue (Masoud Azizi). A developer of which I tested lots of strategies in the past.
The strategy
The "Ichess" strategy uses various components of the Ichimoku Kinko Hyo indicator, commonly known as the Ichimoku Cloud, combined with additional conditions and scoring systems to determine buy and sell signals in cryptocurrency trading.
The strategy involves computing several signals derived from the Ichimoku Cloud and assigning scores to these signals based on their bullish or bearish implications. A cumulative scoring system is used to integrate these signals over a period, which helps in deciding the trend (bullish or bearish).
Without getting into much detail on each and every line of code, I will describe the key components of this algorithm.
The strategy uses the the Ichimoku Cloud. It utilizes multiple calculations to form a 'cloud' on the trading chart that helps to visualize support, resistance, momentum, and trend direction.
It also uses the Heikin Ashi indicator. This indicator is used to average price data to create a Japanese candlestick chart that filters out market noise.
In the code there is a separate method (function) created that is used for the scoring. Signals derived from the Ichimoku Cloud and price action are scored as follows:
Tk Cross Score (Tenkan and Kijun Cross): Checks the crossing of the Tenkan line over the Kijun line, indicating potential bullish or bearish movements based on their relative positions and intersections with the cloud.
Pk Cross Score (Price and Kijun Cross): Assesses the crossing of the price over the Kijun line, which is a direct signal often used to confirm trends.
Kumo Breakout Score: Identifies breakouts from the cloud, which can suggest strong trend continuations.
Senkou Span Cross Score: Evaluates the crossing of Senkou Span A over Senkou Span B within the cloud, indicating potential trend changes.
Chikou Span Cross Score: Looks at the position of the Chikou Span in relation to the price 26 periods ago, providing insight into market sentiment.
Furthermore, the strategy uses various vectorized functions (np.vectorize) to apply the logic across the dataset efficiently.
And finally these scores are summed up for each time period and accumulated over time to form an Ichimoku_Score.
Median scores and other statistics can be calculated and used to adjust strategy parameters dynamically.
The code is quite extensive for calculating these scores. Eventually the buy and sell signals are calculated in their corresponding methods.
Buy Signal
The buy signal is generated when the fast timeperiod Ichimoku_Score crosses above the slow-moving Ichimoku average, indicating a shift towards a bullish trend.
Sell Signal
The sell signal is triggered when the fast-moving average of the Ichimoku_Score crosses below the slow-moving average Ichimoku scure, suggesting a bearish turn.
Besides these entry and exit signals, let’s not forget that the ROI and stop loss function also will cause an exit signal too.
This strategy is suited for daily timeframes but can be adjusted for other periods depending on trading goals.
Backtest results
The extensive and complicated code has probably taken a lot of time from the author.
Since this is only a post about its results and not a Youtube video is made, you can already guess what the message for this strategy will be.
The profits that were made during the backtest are reasonable. But we already know that much more profits are theoretically made by other algo’s with less complicated structures.
It’s nice that there is almost a 50 percent win rate. But the amount of drawdown and the results of the ratio’s do not make me feel comfortable. Eventually there is a profit factor of 1.11 and slightly more than 50 percent of the pairs fit this strategy according to the results.
The equity curve, which shows the performance over time, does show some promising results.
But the end result does not tell you the whole story here.
Because during a backtest the equity curve is also registered and you can see that this strategy certainly has the potential to have good gains. But the issue here is the drawdown from the peaks.
These occur mostly when crypto is in a bear market.
If there can be some sort of breaks applied to this algotrithm when entering bearish circumstances (for example not trading below the 200 sma according to my earlier post and video about the 200 sma). Perhaps than the end result would probably be much better here.
Overall this might lead to a strategy that performs much better. The Calmar, Sortino and Sharpe ratio might improve much better and the huge drawdown column would decrease as well.
I’m not expecting wonders buy adjusting this algorithm too much though. It mainly is a good excersise in having a trading idea and testing it out if it has a chance to succeed. In this case the idea was good but in reality it did not perform as expected.
So I will end the post here and hope you got some ideas from the code itself. It makes use of different functions to score an indicators performance, which on and by itself are very good ideas. And maybe they can be applied to other trading Ideas you have.
All the output I have from this test is attached as a zip file, so I hope you can download it without errors.
Thank you for your reading and your support!
And I will see you in the next post,
Goodbye!