The ObeliskRSI Trading algorithm – Prone to heavy drawdown
Added 2024-11-28 17:00:04 +0000 UTC
Introduction
In my previous blog post I wrote that I am running pretty far behind with my analysis on the performance of pre-defined and complete Freqtrade strategies that you can find on Github or the Internet.
Under normal circumstances I write the complete text for my video’s and then alter it here and there to create a blog post for reference. But since these next couple of algorithms, and their respective posts, are mostly derivations or evolutions of older strategies and do not have the same high performance, I decided to only write ‘exclusive blog posts’ of these. I also have thought of a different style of writing that should eventually stay informative enough while not diving too deep into the code. I think I have explained enough already how to interpret these Freqtrade coded algorithms in older video’s. So if you are new here and really need to know how these algorithms should be read and what they do line by line, then please watch the older posts for that information.
This Obelisk RSI strategy that I have left on my shelf is the first one to handle, so here it goes…
The Strategy
Timeframe and Strategy Overview
The ObeliskRSI_v6_1 strategy (downloadable on github here) is programmed to operate on a 5-minute timeframe, making it a short-term trading approach designed to take advantage of brief market fluctuations. Its aim is probably to catch dips in the market, buying in before a reversal and riding the price back up to generate profit. So in essence, it is a momentum-based strategy that tries to capture value from market “bottoms” while avoiding overextended downtrends.
ROI and Stop Loss Settings
The return on investment (ROI) setup is designed for flexibility, with gradually decreasing profit targets as time in the trade progresses. It starts aggressively, targeting a 15% profit immediately, but as time elapses, it lowers to 4% at 35 minutes, 1% at 65 minutes, and finally reaches a break-even point of 0% by 115 minutes. This progressive ROI structure helps the strategy adapt to varying market conditions, capturing quick profits when possible, yet willing to settle for smaller gains if the trade lingers longer than expected.
The stop loss is set at a conservative -30%, meaning the strategy is willing to risk up to 30% of a trade’s value before cutting losses. This wide stop loss aligns with the strategy’s anticipation of reversals, allowing lots of room for price fluctuations. Additionally, a custom stop loss function gradually reduces the risk exposure over time, narrowing from the initial -30% down to nearly break-even after 110 minutes, providing an extra layer of loss protection.
Custom Stop Loss Ramp
A custom stop loss ramp all the way down at the bottom of the code dynamically tightens the stop loss using a time-based curve that narrows the allowable loss as the trade progresses. It begins with the full stop loss but gradually tightens along a cubic curve until, after 110 minutes, it nearly reaches zero. This approach prevents trades from dragging on indefinitely and ultimately forces an exit after a set period, win or lose. This feature tries to act like a “safety net,” capturing any profits that may exist by the time the stop loss curve reaches its end point, and I think that this way it tries to ensure that the strategy doesn’t hold onto a losing trade for too long.
Indicators in populate_indicators
This strategy only uses the Relative Strength Index (RSI). And also in two ways. First, it calculates a long-term RSI by resampling the data over a 1-hour timeframe, which provides insight into the broader market trend (bullish or bearish). The results of this longer RSI are then used to determine if the strategy is in a “bullish” or “bearish” mode, switching between different buy and sell thresholds depending on this trend.
The second RSI calculation is done on the standard 5-minute timeframe, and it acts as the primary trigger for both buying and selling. When the RSI dips below a certain value, the algorithm considers this a sign that the asset may be oversold, indicating a buying opportunity. Conversely, when the RSI crosses above a set threshold, it signals a potential overbought condition, triggering a sale.
Entry and Exit Rules
The entry rules in populate_buy_trend use a comparison between the RSI value and specific thresholds, depending on whether the trend is bullish or bearish. For example, in bullish conditions, the strategy uses a higher RSI threshold (like 35) as a buy trigger. When RSI crosses below this threshold, it indicates a temporary dip in a generally upward market, suggesting a buying opportunity. In bearish conditions, a lower RSI threshold (like 21) is used, reflecting a need for a stronger dip before entering, which aligns with the strategy’s more cautious stance during downtrends.
In populate_sell_trend, the exit rules are similar, but in reverse. Here, the RSI thresholds determine the exit point, aiming to capture gains once the price reaches an overbought region. In bullish conditions, the strategy exits at a higher RSI level, while in bearish conditions, it exits sooner at a lower RSI, playing it safer. This dynamic approach of entering earlier and exiting later in bullish markets and doing the opposite in bearish markets. This aligns well with the strategy’s idea of capturing market dips and riding them up for profit.
My first reaction is that it has the potential to navigate different market moods. In a choppy market with frequent dips or a more sustained trend. But stay aware about the author’s notes. The strategy might backtests well but real-world performance can vary and trading live with high volatility pairs requires a keen eye and possibly some tweaks too.
Backtest results
The backtest results show this current picture of the strategies performance on my specific setup.
The backtest results for the strategy show a promising level of profitability but also highlight areas for improvement. With an End Balance of $3168.46 and a Profit % of 216.85%, the strategy achieved solid growth over the test period. The Win % of 56.74% indicates a favorable win rate, although not exceptionally high for an RSI-based strategy, suggesting that some trades might be operating on thin margins.
The strategy's CAGR (Compound Annual Growth Rate) is modest at 0.47, pointing to steady, incremental growth rather than explosive returns. However, the Maximum Drawdown of 74.25% is notably high, which could be a concern for risk-averse traders.
On the risk-adjusted metrics, we see a Sharpe Ratio of 2.65 and a Sortino Ratio of 2.39, both indicating that the strategy generates returns with a reasonable level of consistency relative to its volatility. The Calmar Ratio of 0.63, however, reflects the impact of the high drawdown on long-term performance stability and this number should be taken seriously if you want to proceed testing this algorithm.
The Profit Factor of 1.02 shows that for every dollar risked, there’s only a marginal profit, indicating that gains are nearly balanced with losses. And lastly, with 59.18% of pairs profitable, the strategy shows adaptability across various assets, though not overwhelmingly so.
The performance plot shows a dramatic rise followed by a steep decline in cumulative profit. From early 2020 to mid-2021, the strategy performs impressively, with the cumulative profit (orange line) climbing steadily, supported by regular weekly profits (green bars). However, after peaking around mid-2021, the strategy’s performance takes a turn. The cumulative profit starts to decrease, showing a persistent decline through 2022 and into 2023. Weekly losses (red bars) become more frequent and pronounced, and the strategy struggles to recover its earlier momentum.
The drawdown analysis reveals a critical insight into the strategy's vulnerability during downturns. In the early stages, from 2020 to mid-2021, drawdowns remain relatively mild, fluctuating below the average drawdown level of 25.73% (indicated by the green line). However, after the 2021 bull market top we see a significant shift. Drawdowns begin to escalate sharply, with the red line showing a steady climb that peaks beyond 70% by late 2022. This high drawdown level is a clear indication that while the strategy performs well in choppy or upward-trending markets, it lacks safeguards in prolonged downtrends. And this highlights an area for potential improvement, such as implementing tighter risk management.
The winrate and profit distribution plots provide another view of the strategy’s consistency and variability in returns.
In the winrate distribution plot, we see a median win rate around 0.57, with most values concentrated between 0.52 and 0.62. This reflects a relatively stable win rate with moderate fluctuations, which is a positive sign for reliability.
On the profit distribution plot, the median profit is close to zero, indicating a balance between profitable and unprofitable trades. However, the plot also reveals several outliers in red, representing occasional high losses. This makes it clear that a few large losses significantly impact the overall performance and highlights the strategy’s occasional vulnerability to severe drawdowns. That is consistent with the earlier observed high maximum drawdown.
Eventually this algorithm ends up pretty low on the total Strategy League. This plot also makes it clear that this strategy was lying on the shelf pretty long because the current League is much, much larger at the moment.
The performance comparison charts offer a comprehensive perspective on the strategy relative to other top strategies. You can immediately see that the strategy’s drawdown stands out as a major concern. This level of drawdown dwarfs other strategies and it exposes the portfolio to significant risk. Such high drawdown implies that prolonged losses could quickly erode gains, which may not be sustainable or appealing for risk-averse traders.
Its win rate is stable but not outstanding compared to other strategies, reflecting a balanced but moderate edge in trade success. Similarly, the profit factor hovers around 1, meaning that profits and losses are nearly equal on average, leaving minimal room for compounding returns after accounting for losses.
Also the risk-adjusted metrics like the Sharpe and Sortino ratios do not outshine its peers. These ratios highlight that the strategy’s returns come with considerable volatility, and while profitable, it may not be the most consistent performer relative to its risk.
In conclusion, using this algorithm comes with significant risk. The substantial drawdown indicates that this algorithm may not be suitable for all traders, particularly those who prioritize risk management. To improve its robustness, the strategy proble could lie in its usage of the specific stop loss function as its protective mechanism. Ultimately, ObeliskRSI_v6_1 is an aggressive, quick gaining option in favorable market circumstances that could appeal to traders comfortable with drawdowns but may not meet the needs of those seeking a more balanced or risk-adjusted approach.
And with this conclusion I am at the end of this post. I hope you like this new style of posts for the coming period. I personally think it’s more concise and high level. If the performance of an algorithm is very good, we can always go back to the code and see where the possible strengths and weaknesses are so that we can improve the code if necessary.
For now thank you for reading this post and being a Patron. And I will see you in the next post!
Goodbye!
Comments
Hi MoAtlas, first of all my condolences on your loved one's passing. I hope that her memory brings comfort to you. Thank you for your compliments as well. I try to do my best to be as extensive and informative so that you can decide for yourself which strategy is most suitable and hopefully creates much wealth for you. Take care!
Dutch Algotrading
2024-12-03 09:30:25 +0000 UTCI really appreciate all the work you put into your videos and the content is so impressive. Thank you for all that you do. My mom was from Friesland and she just passed away…I always love hearing the Dutch accent as it reminds me of her. Thank you so much.
MoAtlas
2024-11-30 19:53:07 +0000 UTC