ClucfiatSlow/ClucfiatROI strategy (Patreon)
Downloads
Missing 2 files, as this post has not yet been imported.
Content
ClucfiatSlow/ClucfiatROI strategy
Hi everybody, and welcome to another short blogpost about the ClucFiatSlow and ClucfiatROI trading algorithms I hoarded a while ago, and now have the time to analyse their performances. These strategies were found under two names, but the results after testing were exactly the same. So it is highly likely that I was testing the exact same code too.
Let's just begin, shall we...
Code origins
As with many trading strategies back then, I did not write down where I got them from. And since a lot of the code was also not provided by an author, it's always hard to give credits where credits are due.
That is also the case with these algo codes unfortunately.
But let's not mourn too long on this fact and just analyze the code quickly for the idea behind this strategy.
And by the way, I'll stick to screenshots this time since Patreon has VERY BAD make-up possibilities for code (it once worked but now fails again).
I am going to compare the code between the two algo names to see the differences too here...
It's immediately visible that these two parts are almost the same here. Except for the name and the imported reduce function.
The strategy makes use of different time-based take profit points in the ROI table.
The buy and sell parameters already give a hint of the indicators used in this strategy here. The Bollinger Bands, Fisher and Volume.
The next section shows a 35 percent stop loss.
Also the trailing stop loss is activated here. Of which I am no fan of, since it can influence the results of the backtest.
The ideal timeframe seem to be the 5 minute TF here.
The next section shows the used indicators used.
These are the Bollinger Bands, EMA, a Mean volume, RSI and inverse Fisher RSI.
# # Inverse Fisher transform on RSI: values [-1.0, 1.0] (https://goo.gl/2JGGoy)
rsi = 0.1 * (dataframe['rsi'] - 50)
dataframe['fisher-rsi'] = (np.exp(2 rsi) - 1) / (np.exp(2 rsi) + 1)
But here comes the biggest differences between the two codes.
In the ROI version there is a detection mechanism that detects the runmode. And if there is live/dryrun detected, the SAR will be involved in the strategies equation.
This looks very strange too mee, because why would you add additional indicators in live/dryrun trading if you cannot investigate their influence in the backtests. This adds a huge uncertainty factor here in my opinion...
Also in the buy trend function there are differences now. But they also mainly concentrate on the detection of the runmode of the bot and its influence on buy and sell signals. Again not taken this into consideration during backtesting adds additional uncertainty factors...
If there are no active trades, then the same conditions append as the ClucfiatSlow strategy. But if there are active trades, then the close signal and SAR are used. And their influence cannot be tested during backtesting. Only when live trading or dryrunning. Would you dare to do this..?
After this section, the strategies start to sync again and all lines are the same again:
This piece of strategy code is essentially a set of conditions that, when met, signal a potential buy opportunity within a trading algorithm. Let's translate each part into more understandable terms:
Fisher Transform RSI Condition: The strategy begins by checking if the Fisher Transform of the Relative Strength Index (RSI) is less than a predefined parameter (params['fisher']). The Fisher Transform is a technical indicator that helps identify potential price reversals by making the price distribution more Gaussian, improving the identification of extremes in price movements.
Bollinger Bands and Price Conditions: This section is a bit more complex and involves multiple conditions, all of which need to be true:
The difference between the upper Bollinger Band and the lower Bollinger Band (bb1-delta) must be greater than a certain percentage of the closing price, defined by params['bbdelta-close'].
The difference between the current close and the previous close (closedelta) must be greater than a certain percentage of the current close, as specified by params['closedelta-close'].
The 'tail', which could refer to the lower shadow of a candlestick or another similar measure, must be less than the bb1-delta multiplied by a parameter (params['bbdelta-tail']). This condition might be checking for a small retracement or pullback in price.
The closing price should be less than the lower Bollinger Band from the previous period (lower-bb1.shift()), indicating the price might be extending beyond its typical range.
The closing price should also be less than or equal to the closing price from the previous period, suggesting a downtrend or consolidation.
EMA and Volume Conditions: Alternatively to the above conditions, the strategy may consider a different set of criteria:
The closing price should be below a slow Exponential Moving Average (ema_slow), indicating the overall trend might be bearish.
The closing price should be less than a specified multiple (params['close-bblower']) of the lower Bollinger Band calculated with a different setting (lower-bb2), further suggesting the price is in a lower range than usual.
The volume for the current period should be less than the previous period's slow volume mean (volume_mean_slow.shift(1)) multiplied by a parameter (params['volume']), indicating lower trading activity, which could imply a lack of strong buying interest at current price levels.
Finally, if either the complex Bollinger Band and price conditions or the EMA and volume conditions are met, the strategy identifies this as a buying signal.
In essence, this strategy looks for conditions where the price is extending beyond its normal range, showing signs of a potential reversal (through indicators like the Fisher Transform RSI and the positioning relative to Bollinger Bands), all while considering the trend and trading volume. It's a combination of momentum, trend following, and volatility expansion strategies, aiming to identify potential entry points during periods of price retracement or consolidation within a broader bearish trend.
After this, both strategies start to synchronise again in their trading rules:
In this part of the strategy code, the populate_sell_trend method is defined, which is responsible for identifying sell signals based on certain conditions. Here's a breakdown of what's happening:
Parameters Access: The method begins by accessing a set of parameters specific to sell conditions, stored in self.sell_params. These parameters likely contain thresholds and multipliers used to evaluate whether a sell signal should be triggered.
Setting Sell Conditions: The strategy then uses dataframe.loc to locate all rows in the DataFrame (which represents the historical price and indicator data) that meet all of the following conditions simultaneously, and sets their 'sell' column to 1, indicating a sell signal for those periods.
The first condition checks if the closing price, adjusted by a multiplier from params['sell-bbmiddle-close'], is greater than the middle Bollinger Band value (mid-bb2). This could indicate that the price is relatively high compared to its recent range, which might be a good opportunity to sell.
The second condition requires the fast Exponential Moving Average (ema_fast) to be greater than the closing price. This could indicate that the price is currently below the trend as measured by the ema_fast, suggesting bearish momentum.
The third condition checks if the Fisher Transform of the RSI (fisher-rsi) is greater than a sell threshold defined in params['sell-fisher']. A higher Fisher Transform RSI value might indicate overbought conditions, further supporting a potential sell.
The final condition simply ensures that the trading volume is greater than 0, confirming that there was trading activity in the period in question.
Returning the DataFrame: The method concludes by returning the modified DataFrame, now containing sell signals wherever the conditions were met.
So now that we know that both strategies differ in their workings when live trading or dry running but when backtesting, they behave similar.
That can be clearly shown if both the profitability curves are shown side by side:
You see, exactly similar. As wel as the wins/loses:
Now talking about the performance of this strategies (and from now on I will talk only about the ClucfiatSlow - but it will count for both algo's).
It is a strategy that reacts very heavily on market circumstances. The first peak is similar to the first peak of the last bear market and the second peak closely corresponds with the second higher peak (also see the dashed yellow bull market top line here).
The drawdown is huge and gets over 75 percent at it's peak. Also closely resembling the maximum drawdown of some crypto altcoins.
If I take a look at the profit loss graph, then we see a huge negative 'wick' down around may 2021 that represents a losing week of -13000 USDT. This should be valuable information to take into consideration when deciding to use this algorithm further!
Comparing this algo's performance curve with other trading algo's. Then its line 'comes from the ground' and is visible as the fourth best performing strategy. But it quickly becomes covered with other better performing strategy curves.
So let's not waste too much time on the other performance indicators here. At this point I (and probably you too) know enough.
The fact that I did not even make a Youtube video for it promises enough information here :o)
Look closely at the position of both algo's in the strategy league plot. They sit next to each other in the lower half of this long list of tested algorithms here.
My only conclusion at the moment is that there are some interesting ideas in this code that I will remember in the future.
For example the Inverse Fisher RSI calculation looks interesting:
And the idea that there is a possibility to change the behaviour of the algorithm, depending on the runmode is on and by itself interesting here (although I personally would not use it to change the rules of the strategy here, but who am I...)
Anyway, this is the end of this post. Thanks for reading and your Patreon support!!
And until the next post on another trading algorithm.
Goodbye!