THE BEST FOUND! NFI5MOHO Trading algorithm (Patreon)
Downloads
Content
Introduction
Have you ever wondered which algorithmic trading strategy would provide you with the highest gains in combination with the best risk management?
Well in this post I will present you my findings on the NFI5 MOHO trading algorithm that might prove to be the best trading strategy for your automatic trading yet.
Where to find this strategy
If you open Github and search for the term NFI5MOHO, then you’ll find out that a lot of repositories contain this file (https://github.com/search?q=NFI5MOHO&type=code).
There are also other versions available. But in my case I have tested this Work In Progress version.
Let me open the code to take a look what’s inside…
Next select raw, and then we are good to go to explore this code.
As with some earlier tested strategies, this is also a variation of the Nostalgia for infinity trading algorithm. A black box algorithm that is created by Iterativ and maintained by lots of other contributors. https://github.com/iterativv/NostalgiaForInfinity
Interestingly enough there are only four versions in this repo and I suspect that somebody else had made some personal adjustments. That person did not add his or her name to the code, but if you recognize your work here. The creator, the contributors and you deserve all the credits here.
I’m just the guy that presents his personal findings to the Youtube audience here.
The strategy
Now there is a small clue on the differences between the original NFIX version and this specific version. And these are written down here in the code:
Apparently the code has been adjusted to also contain the MultiOffsetLambo algorithm and some optimized parameters. And since this appears to be added way back in june 2021, I think these adjustments could be valid additions to the algo.
That’s also where the adjustment of the name comes from MO Multi Offset, HO Hyper Optimized.
Now as with earlier videos about the NFIX strategy, Im not going over all the lines.
But I will only show you some highlights within the code.
For example, here you can make a decision whether to use or ignore a certain buy and sell conditon.
These are the spaces that are prepared to be optimized by the Hyperopt command:
Together with some Moving Average indicators.
After these moving averages there is the Trailing stop loss setting. Here it says that it is not used, but still the setting is set to True.
However when I downloaded this file I have manually set this to False. So this time you will see the results without TSL enabled.
Now I also tested this strategy on the 5 minute timeframe. Since that was the only timeframe this algo could work on.
A little bit further below, after a lot more adjustable hyperopt parameters there is a custom sell method programmed.
Also informative pairs are used. As well as a bunch of informative indicators configured on the 1 hour timeframe.
After that there are normal timeframe indicators coded.
These informative 1 hour timeframe and normal indicators are then used in the populate indicators method so fill the dataframe that the bot will use for deciding the buy and sell signals.
After that, the real fun begins and the conditions under which a buy signal should be triggered are defined.
For example
This buy condition is enabled when buy_condition_1_enable is true. It signals a buy if several criteria are met: the 50-period EMA is above the 200-period EMA on the 1-hour timeframe, the 200-period SMA is trending upwards, and specific safety conditions related to dips and pumps are satisfied.
It also requires the current price to have increased significantly from its lowest point in the last 36 periods, the 1-hour RSI to be within a specified range, the current RSI to be below a certain threshold, the Money Flow Index (MFI) to be below a specified value, and volume to be positive.
And this goes on for each and every specific buy condition that is configured.
What’s at least equally important are the exit signals.
They also consist of different sets with different rules. Althought not that many as the buy parameters.
For example this third sell condition sells a position if it is enabled and also if the rsi is above a certain value and the volume is larger than 0.
MultiOffsetLamboV0
To find the part that originares from the MultiOffsetLamboV0 algorithm, I had to search for the original algo first. https://github.com/search?q=MultiOffsetLamboV0+&type=code
IN that code there was a buy trend configured that made use of the Elliot Wave Oscillator.
That piece was included in the NFI5MOHO buy section at the end
Also the corresponding sell method was also copied from the Lambo file to the NFI file as you can see here.
Together with the Elliot Wave Oscillator itself at the end.
Backtest results
But now lets continue with the results I got.
Also, because I immediately tested this algo with the Trailing Stop Loss disabled I will not surprise you with different results after what I present next.
And after I tested I was very much pleasantly surprised by these hypothetical results this algo gave me.
This trading algorithm has scored tremenously well on my setup.
With a win rate of over 90 percent and a maximum drawdown of less than 15 percent, this strategy managed to attain a profit of almost 17000 percent.
80 percent of the pairs respond well to the rules of this algorithm. All the ratios have very high scores too. Although the Calmer seems to be a little bit too optimistic here. So keep this in the back of your head.
Let’s take a look at the equity curve.
By the looks of it, the rules of this algorithm seem to hold during bullish and bearish circumstances.
There are some dips in the curve, but nothing too serious so it seems.
The biggest drawdown was around may 2020 and that was around the time the pandemic happened.
The second larges drawdown happened around the lowest period in the last bear market. So not too much surprises here.
This also is reflected by the profits per week and the mean profit and loss curve. Again the biggest losses happened during last times bear market. Maybe the strategy can be tweaked to not trade at these moments or so.
Next there are the winrate and profit distribution boxplots. These tell me more about what to expect on average about the trades.
The yellow line in the Win rate box plot indicates the median win rate, which appears to be around 0.85, suggesting that in an average week, the strategy wins about 85% of the trades.
The box represents the interquartile range, with the lower quartile (25th percentile) around 0.8 and the upper quartile at 1.0. This range indicates that 50% of the weekly win rates fall within this range.
The whiskers extend to approximately 0.6 on the lower end and 1.0 on the upper end, indicating that most of the data points fall within this range.
And there are also several red dots below the lower whisker, these are the outliers. And they represent weeks where the win rate was significantly lower than the general distribution. You could also see these weeks in the previous plot.
Now about the profit box plot.
The yellow line in this box plot indicates the median weekly profit. It is around 0, suggesting that the median week sees neither significant profit nor loss.
The box itself shows the interquartile range for profits, which is relatively tight. This indicates that 50% of the weeks have profits that fall within a narrow range close to the median.
These whiskers indicate the spread of the profits, extending from around -2000 to 3000, showing a wider variability in weekly profits compared to the win rate.
Now there are also red dots above and below the whiskers. Again they represent outliers. Positive outliers show some weeks with significant profits, up to 20000, while negative outliers show weeks with significant losses, down to -5000.
Now the total hypothetical profit is not the highest ever found. But There is more then only gains here. Risk management and the way that this equity is gained is also very important.
In trading it is always a question of how much risk to take to attain a certain reward. And with algotrading this is not different.
Besides, some of the strategies that have these insane performances also have a dark side to them as well. I discussed these in the video’s and blog posts on my patreon page. And if you want to know more about what the pro’s and con’s are of these other strategies, then I reccommend you watch these video’s and posts.
If I compare the individual performance indicators of this NFIXMOHO strategy, then you see that on a lot of these subplots it outperforms most the other best performing algorithms.
To me, some of the most important factors are the profit factor in combination with the profit percentage. Togehter with the applicability on the pairs that I intend to trade on. Eventually other scores like Sharpe, Sortino and Calmar are derived from these performances.
Strategy League and ending
And if I count all the individual scores up to one total score, then you see that this specific trading strategy has the highest overall score of all the algorithms I tested so far.
Now, that’s something that I did not expect to see since the last time I found another well performing strategy.
Did I reach the ultimate score yet. Well actually not but as it seems now, we are getting close. And it might be that in the future even better performing strategies force me to recalculate this entire list again with adjusted scores.
But for now this algo seems worthy to me to be added to my live trading bot to see if it actually performs well under live circumstances too.
And this is were we end up in this post. A NEW NUMBER ONE TRADING ALGORITHM that we can try out to see if it will make us live changing money.
Thanks for reading and being a Patron and I will see you in the next post.
Goodbye!