Home Artists Posts Import Register

Downloads

Content

Introduction

In this post I want to present you another spectacular performing Nostalgia for Infinity based trading algorithm that I have found on GitHub. It is called Combined NFI Version 6 SMA and I can already tell you that with my testing methodology this Algo ends up high on my Strategy list.

Where to find it

As I am working my way to the end of my backlog with algorithmic trading strategies, I sometimes come across a trading algorithm that is an evolution of something I already tested a while ago.

You have to know that, every day there are new iterations of trading strategies developed, that can  perform even better than their earlier versions. 

And this time is no exception.

You can find this strategy if you look for the name on Github. Code search results (github.com)


And as you can see, there are two persons that have this file saved in their code repository. 

Oh, and If you finished this video and still have doubts on the performance I have showed you, then you can also go down this page and open one of these files. Here you can check the results of the tests this person has done on this trading algo.

rat/Series another test/another_test_2.txt at becad6ffa09e2e8ab81a02d25ff14a7e20515e04 · criminau/rat (github.com)


Anyway, let’s not wonder of and dive into the code of this trading algorithm. 

I must warn you that I will not go into each line of code, since it consists of over 2200 lines. 

Let me open the file to show you…

Most of the times I call these humongous algos ‘black box algorithms’ since I cannot tell how it works in detail and where possible dangers lie. In the case something unexpected happens with trading. 

Since it is an evolution or fork from the original NFIX strategy (iterativv/NostalgiaForInfinity: Trading strategy for the Freqtrade crypto bot (github.com)) I’m assuming that this is a specific trading algorithm where many people have worked on and also have tested it on the probability to make money in the market. So it is already somewhat verified on its correct workings.

But this shouldn’t stop you from doing your own research too, since your setup could very well be totally different and might give you different results too.

So let me glance over this file and give you a high level overview of what it does. And for those persons that still want to have more information about it.

I have already have taken a deep dive into the original Nostalgia for infinity trading algo in an earlier video (LINK OPZOEKEN EN TONEN). So if you want to be more informed about its inner workings, you can always watch that video.

Now let’s continue with the file.

This algo operates on a 5-minute timeframe with an informative timeframe on the 1 hour. This relatively short interval allows the strategy to capture quick market movements and react quick to new opportunities.

The ROI setting will close out the trade as soon as a 1000% return on investment is reached from the moment the trade opens, which is extremely optimistic in typical trading scenarios. This high setting is probably set to disable the ROI and let the code of the algorithm determine the exit signals.

This is also the case with the large stop loss setting. It means that the strategy allows a trade to go 99% into loss before closing it, which is risky and likely not practical for most trading environments. Most of the time this setting is used to effectively disable the stop loss and let the trading rules decide when to exit the trade.

The trailing stop loss is also set to true. And this nags me a little bit, since it gives a positive bias to the backtest results. Therefore I also have made a file with the stop loss disabled and tested that version also. 

Later I will show you the results of both the trailing stop loss enabled and disabled versions. So you can decide which results are closer to reality.

The strategy uses several technical indicators that are pivotal for the decision-making processes.

And some of these are the:

  • SMA (Simple Moving Average)

  • EMA (Exponential Moving Average)

  • Elliot Wave Oscillator

  • RSI (Relative Strength Index)

  • MFI (Money Flow Index)

  • Chaikin Money Flow

  • Bollinger Bands

The code also contains a lot of methods that check for specific conditions to decide when to enter or exit trades. These conditions are based on the calculated indicators and might include checks for crossovers, thresholds being exceeded, or specific market trends.

The populate_buy_trend method in the strategy determines when to buy by evaluating a series of conditions derived from various technical indicators. If all these conditions align then the method flags these instances in the dataframe. That instructs the trading bot to execute buy orders at those specific moments. There are many different methods or buy conditions set for many different market situations. That makes this algorithm so divers and also complex.

Similarly, the populate_sell_trend method identifies when to sell by checking if conditions such as reaching profit targets or hitting stop-loss limits are met. And when any of these sell conditions hold true, the strategy updates the dataframe to signal selling points. Which guids the bot to exit positions accordingly. Also there are many different sell situations defined. And this is the reason why the default stop loss has been disabled.

So, overall, the strategy employs a very comprehensive and dynamic approach to trading and it uses a variety of technical indicators and complex logic to make trading decisions. 

Now, all these methods are designed to maximize potential gains while incorporating several layers of risk management to safeguard investments. 

But what about its ability to make profits in the market. Is it really as good as I promised at the beginning of this video?

Backtest results

Now again you have to be aware that these results are on my specific setup with my pairs to test. And if you test on your machine, the results might not be the same as what you see on the screen. 

That’s why you should always do you own research on your setup before any real live trading. This goes for any trading strategy you see on the internet.

Now the original strategy has a spectacular gain of 65300 usdt. That’s a gain of 6400 percent on the initial investment of 1000 dollar.

Whats even more admirable is that this strategy has also a 85 percent win rate and only a drawdown of 6 percent or so.

Also most of the pairs favor this algorithm so it could well be that your preferred trading pairs also respond well to this strategy.

The equity curve also shows that it responds well to almost any market circumstance. 

It is true that sometimes the algo has difficulty under very harsh circumstances as you can see around September 2022. But it recovers fine and continues to rise after that.

This can also bee seen in the drawdown plot

The highest drawdown occurred at that time. But on average the drawdown sits around 1.5 percent. 

Which I can certainly live with.

As you can imagine, most of the weeks this algo has green numbers. But sometimes this algorithm has trouble keeping the gains and will lose a significant amount of money as you can see on this plot.  According to these theoretical backtest results ofcourse.

Now what about the trades and profit itself.

These boxplots show you an overall view of what you can expect per trade.

The left plot depicts the winrate distribution for the Combined NFI strategy, showcasing a predominantly high performance with a median close to 0.9. Despite the general success, the presence of several outliers indicates episodes of unexpected lower winrates, dropping to around 0.2. This variability underlines a certain unpredictability in the strategy’s overall robustness.

On the right, the profit distribution plot reveals a strategy that oscillates around break-even, with a narrow interquartile range suggesting that most outcomes are modest in financial terms. However, the presence of significant outliers ranging from losses of -$2000 to profits reaching $6000 highlights the potential for both substantial gains and considerable risks. This dichotomy between frequent small gains and occasional large deviations will form a critical aspect of the strategy's financial impact that you have to be aware of.

No TSL

To stay on this somewhat critical note here. I also tested this strategy without the TSL enabled.

It’s performances are therefore also lower. But it gives a more realistic view on the capabilities of the algorithm in my personal opinion.

To make a ballbark estimation. It’s performance is around 5 to 10 percent lower than the TSL enabled version. 

On and by itself it is still very good though. Since some strategies that I tested with and without the TSL enabled have way higher differences in performance between each other.

The equity curve is also comparable with the TSL enabled. It looks a little bit more jagged. But overall you can expect the same performance.

Which is also the case with the boxplots of this NoTSL version.

The numbers are all a little bit lower and the variability is a little bit higher. But overall comparable.

So it’s up to you to decide which of these give a more realistic view on the performance here.

With TSL Enabled

Now Getting back to the original strategy results.

The overall performance indicators show a great performance on most of the indicators. With some minor exceptions like the profit percentage and maybe also the Sortino a little bit.

But with this overall performance you can already guess, and have also seen it here.

This trading algorithm currently enters at the top of my Strategy League. A well deserved position.

If I also add the No_TSL version to this list. Then that version enters a little bit lower. But still well within the current top 5 with the score I give it.

So there you have it. A completely new number one trading algorithm discovered. 

I actually never thought that this was possible, but in this business it is proven again to never assume things.

Thank you all for reading the post and to be a Patron for me. I appreciate this very very much.

I will soon come with new results of other backtests so, see you in the next Post.

Goodbye!

Files

Is This the Best Trading Algorithm of 2024? 6400% Gains and 85% Win Rate!!

Looking for a powerful trading algorithm? Check out my review of the Combined NFI v6 SMA with 6400% Gains and 85% Win Rate!!. I'll explain its key indicators, backtest performance, and how it can potentially boost your trading profits. Subscribe and hit the bell icon for more trading strategy insights!" === !!!! PATREON SUBS GET ACCESS TO ALL OUTPUT, CODE AND STRATEGIES !!!! 💬 SOCIAL 💬 Youtube : https://www.youtube.com/channel/UC-AOcefy1x7lTc17JiqaxqA?sub_confirmation=1 Patreon: https://www.patreon.com/dutchalgotrading Strategy league: https://www.dutchalgotrading.com Buy me a coffee: https://ko-fi.com/dutchcryptodad Youtube: https://www.youtube.com/@dutchalgotrading 💰 AFILIATE LINKS & PROMO’S 💰 Bybit: https://www.bybit.com/en-US/invite?ref=K7JEX Linode $100 Free credits: http://linode.gvw92c.net/dutchalgotrading Tradingview get $15 off with purchase : https://www.tradingview.com/pricing/?share_your_love=DutchCryptoDad 🏷️ TAGS 🏷️ #trading #bot #crypto #cryptocurrency #bitcoin #money #strategy #algorithmic #algorithm #backtesting #dutchcryptodad #dutchalgotrading 📺 PLAYLISTS 📺 Tested trading strategies: https://bit.ly/DCD_strategies_pl Freqtrade bot tutorials: https://bit.ly/DCD_freqtrade_pl 📈 CHART ANALYSIS 📈 Tradingview: https://bit.ly/DCD_Tradingview ⚠️ FINANCIAL DISCLAIMER ⚠️ This channel is for education and entertainment purposes only! All the content I show are hypothetical results on a limited backtest dataset. My way of deciding if an algorithm is good is not an exact science! Everybody has their own preferred way of determining if a trading algorithm fits their person needs or not. It is your responsibility to investigate if this strategy fits your risk appetite, backtest and will provide similar results under live circumstances! Past Performance Is NO Guarantee of Future Results!! I am in no way responsible for bad setups, strategies and possible losses (or gains) of money as a result! Everything expressed here is my own personal opinion and not official investment advice. Investing in cryptocurrency or trading involves a high degree of risk and should be considered only by persons who can afford to sustain a loss of their entire investment. Please do your own research or consult a financial advisor before making any financial decisions!

Comments

Adam Iulian

Yes, this is the best strategy indeed 💯, how many open trades and pairs did u used for backtesting?

Dutch Algotrading

10 open trades on 50 pairs. Exactly the same as all other strategies. So i beleive my comparisons are valid.

Kolis

I can not get same result like you. When I do backtest I get only one trade done :D I even downgrade version to have same like you. Can you provide some sample commad and config to run it (if it is okay)?

Bamboo Elegent

I would like to ask you if the code for this data analysis can be open sourced, I think your charts are so beautiful

Bamboo Elegent

Can you write a blog post explaining how you do these data analysis? Your work is really rewarding and always learning from you

Dutch Algotrading

Hi, Kolis. It's always difficult to exactly say where the problem lies since I do not know your exact setup. If you have the exact setup as me, and do the standard backtests on the exact timeframe, then these numbers should be comparable (although not always exactly the same is my experience). One single different parameter can make the backtest start at another time, pair or something else and then comparisons get very difficult. That's why I also include all my output in the posts. You can always compare your output with mine to see where the exact differences are. Hope this helps.

Dutch Algotrading

I already did in the past in an early post. To repeat myself short. I categorize all parameter outputs in ranges and give each range a score. The score depends on my preferences so I might score low dradown higher than high profit. IN the end All scores for each output parameter are added up to one single score. If you know anything about (project) portfolio analysis, that's where this method comes from.

Dutch Algotrading

Difficult because the whole analysis its some sort of 'trade secret' and competitive advantage. I hope you understand. But the colors are superbasic. For example, this is the palette of the comparisons of all the strategies in the plot of the strategy league: df_all_strategies['highlight'] = df_all_strategies['strategy_name'].apply( lambda x: 'Requested' if x == strategy_name else 'Other') # Set the seaborn style sns.set_style("darkgrid", {"axes.facecolor": "black"}) # Create the plot plt.figure(figsize=(19.20, 10.80)) ax = sns.barplot( x='strategy_name', y='total_score', data=df_all_strategies, hue='highlight', dodge=False, palette={'Requested': 'orange', 'Other': 'blue'}, edgecolor='black' ) # Remove the legend and set labels and title ax.legend().set_visible(False) ax.set_title( f'All Strategy scores in League (with {strategy_name})', fontsize=16, color='white') ax.set_xlabel('Strategy League strategies', fontsize=10, color='white') ax.set_ylabel('Score', fontsize=10, color='white') # ax.tick_params(axis='x', labelsize=10, rotation=45, colors='white') ax.tick_params(axis='x', labelsize=10, colors='white') ax.tick_params(axis='y', labelsize=10, colors='white') ax.set_facecolor('black')

Frederic Collard

I'm running this algo in dryrun for 2 weeks and the results are promizing. Not great but OK, the bot makes a little money and does not lose in total. Have one of you tried hyperopting this algo ? To my understanding, we should focus on the buy and the sell spaces as the algo is build in a way it manages itself its own stoploss and exit conditions. The poroblem is, there are so many parameters in buy and sell conditions that I'm getting lost. I think this algo is an excellent candidate to make a good trading strategy that performs well overtime in many market conditions if properlly optimized. I think also there is room for improvement in the way this algo handles loosing trades, hence the proposal to hyperopt exit condition parameters. Any suggestion on which specific parameter to enable for hyperopt in those 2 spaces would be more than welcome. Can you put me on the track to get insights on which parameter, entry or exit conditions have the more impact on results ?

Dutch Algotrading

Thanks for your comment. Valuable information! My guess is that the current market is also boring, which reflects the bots results too. Advising the specific parameter to adjust/enable is difficult and tricky since this also depends on the pairs you want to trade. This should be a trial&error investigation besed on your own setup to see which settings work out best. But even then in real live (forward) trading it could turn out completely different from what you expect. Welcome in the world of trading...:-)