In this video I will make no exception when it comes to presenting trading strategies that have the potential to make us money in the crypto market even if they are adaptions from other versions. So if you want inspiration to improve your own algorithm, then keep on watching this video.
Just like the popular Nostalgia for Infinity or NFIX trading algorithm, there can be multiple adaptations on the same base strategy rules which can add significant improvements to the original baseline. This time the author @Rallipanos presents another iteration of his (or hers) own trading algorithm. On my setup it showed promising results, so I therefore I want to present you these results.
Just like other versions, this code can be found on Github to download and use.

Like I always say, all the kudo’s and compliments go to the original author of the trading algorithm. I’m just the guy that tests this out and show the promising results on the Youtube.
Lets find out what’s actually happening in this spot trading only algorithm. and try to understand it’s parameters and rules so that we can understand a little bit what makes it tick and why it does it’s buys and sells

After the import of the necessary libraries its time to define some parameter settings and the first custom indicator.
These parameter settings are used later in the strategy as the default settings on which to make trades on.
The Elliot Wave Oscillator here is created. We’ll see later if it is also actually used in the code.
The next part defined the interface version and since we are already at version three I know that this is an old code. Hopefully it still remains profitable because sometimes older algorithms will lose their edge.
The ROI table will take profits if after a certain amount of time the strategy has the configured profits reached. Here at 21,5 percent at any time, 3 percent at 40 minutes 1.6 percent at 87 minutes and after 201 minutes if will just end its trade if there are no profits made. To me this already seems that the parameters are found after a hyperoptimizing setting since they are not nice round numbers. But I could be mistaken ofcourse.
The Stoploss is set at 35 percent, so after entering the trade, its possible that after a 35 percent loss the algorithm will exit the trade here.
The SMA Offset settings here define the ranges in which the optimal settings should be sought if you want to hyperoptimize this trading strategy.
It searches for the optimal sma lengths and low and high offsets if you are going to optimize this algorithm.
The next section here shows that a trailing stop has been set. Of which I am not very fond of since it can influence the backtest results.
Furthermore the proposed timeframe is set here. And initially the 5 minute timeframe should be the best one. Then the informative timeframe is set. In this case the one hour timeframe.
Some startup candle counts and the plot configuration here, that plots the MA buy and sell lines if you want to create a visual output of the backtest results of a pair.
But the real interesting thing starts at the populate indicators method here.
In this part of the strategy, there are several key technical indicators calculated that will help with the buy and sell decisions.
First, the Exponential Moving Averages, or EMAs are calculated, for both buying and selling signals.
Next, there is the Hull Moving Average, a 50-period average that helps smooth out price movements. Along with a 100-period EMA and a short-term 9-period Simple Moving Average. Probably to capture short-term price trends.
For momentum, the Elliot Wave Oscillator, or EWO, is calculated. This indicator was defined earlier in this code and it measures the difference between two EMAs which gives us insight into market momentum.
Finally, the Relative Strength Index, or RSI, is defined in in three different timeframes—14, 4, and 20 periods. Probably to assess overbought or oversold conditions and help us time our entries and exits.
Let’s discuss the buy and sell rules next:
There are three separate buy signals created. EWO1, EWO2 and EWOLOW.
Each of these rules consists of further individual buy rules.
I’ll only discuss the first rule here, the others can be a good homework assignment for you to find out what they do.
So the buy1 signal gets active when the rsi is below 35, the close price is below a threshold where the MA buy line with the length that has been set in the hyperparameter section is multiplied by the offset value also configured in the hyperparameter section.
Then the Elliot wave value should be above the EWO high threshold
The RSI should be below the RSI threshold
There should be at least volume detected
And finally the close price should be below the SMA sell times its threshold value too.
I believe that The intention behind this set of buy rules is to identify a strong buying opportunity when the market is showing signs of being oversold but with momentum indicating a potential upward movement.
Now try to find out for yourself what the intention is for these other two buy signals…
The sell signals are also separated in two different sell conditions, each with its own rules. Besides the ROI and stop loss ofcourse.
The first rule of the first sell conditions states to sell when the close price is above the SMA9, and when the close price is above the configures sma sell length times the offset.
Also the RSI indicator should be above 50, the volume should be above 0 and the rsi fast should be above the rsi slow indicator.
The second sell rule is almost the same, but here the close price should be below the hma 30 instead of using the RSI.
Or when the hull moving average times 1.149 is lower or even than the ema 100
Or when the close price is higher or even higher then the ema 100 times 0.951
Now before I did a backtest I also did lookahead bias analysis and a recursive analysis and these are the results.
So let’s now continue with the backtest and let me show you the results I got on my setup.
NotAnotherSMAOffsetStrategy
The first backtest results I want to show you are that of the strategy where the trailing stop loss is active. You see that the profits made by this trading strategy are pretty good. With an overall hypothetical 3126 win percentage, a very respectable 75 percent win rate and only a 5 percent drawdown. Also 93 percent of the pairs seem to respond well to this algorithm.
This results in a equity curve that you see now. Nice steady upward movements. Here and there a small drawdown. But further nothing to worry about.
I also tested this strategy without using a trailing stop loss to see if this was of great influence of the strategy. But surprisingly, here the results were even better. So I’ll discuss these results instead of those with TSL activated.
NoTSL version
The win profits ended up even higher. The win percentage got a little bit lower just like the drawdown and pairs ratio. But the other performance indicators scored a little bit higher so eventually this overall score also ended up higher.
But the differences are minimal. The equity curve has almost the same admirable rise to a higher end result.
And the drawdown’s biggest spike is in this case just over 5 percent with an average drawdown of even lower than 1 percent.
Furthermore, most weeks offer a positive results and only when the last bear market was in full swing there were some weeks with negative results.
The box plots of the win distribution and the profit distribution always give good insights in the past performance over the dataset I use.
The win rate distribution shows a relatively tight spread, with most trades achieving a win rate between 60% and 85%, suggesting moderate consistency in successful trades. There are some outliers at 20% and even 0%, but these are rare occasions.
On the profit distribution side, the majority of weekly profits cluster around a small range, indicating relatively stable returns, but there are notable outliers both on the high end (around 12,000 – apparently a superlucky week in trading) and the low end
(around -2,000). This suggests that the strategy has the potential for large gains but it also carries some risk of significant losses during certain periods.
So comparing the endresult with other very successful trading strategies shows that it can certainly match itself with the big boys. It might not be the highest gainer but considering its steady rise its certainly worth your attention and further investigation.
Also some of the performance indicators show promising results and sometimes have even better scores than the ones that are currently in the top 10 of best hypothetical performers. Like Calmar, Sortino and especially the Sharpe ratio, profit factor and pairs ratio.
So you see, sometimes its worth taking the time to check out another version or iteration of an already well known strategy. You might even add your own specific indicator or trading rule to the equation and it could perform even better. If you do, then please add this to the comments below so that others can check out on your work as well.
For me this algo is interesting enough to do a forward test with and I will do this in the future. I might even present you with the findings after a while after I have taken this algorithm to the test.
Now I hope that you have enough information about this trading strategy and have added this to your arsenal too. Or at least take it into consideration for testing.
I think I have enough said about the strategy.
So this is it for this post and I will see you in the next one.
Goodbye!