Home Artists Posts Import Register

Downloads

Content

Introduction

Hi there everyone. In this post I will present you my findings on the profitability of the Dyna Opti trading algorithm. It can be applied to many pairs and has good trading results on the 15 minute timeframe. 

Where to find it

The trading algorithm can be easily found and downloaded from GitHub if you search for it by its name. Code search results (github.com)

I’ll click on the first link that appears at the top and then do a quick walk through the code to see what’s happening there.

freqtrade-stuff/Dyna_opti.py at f6c38def0b2fe01d8d42e47740cdeab53511527b · PeetCrypto/freqtrade-stuff (github.com)

raw.githubusercontent.com/PeetCrypto/freqtrade-stuff/f6c38def0b2fe01d8d42e47740cdeab53511527b/Dyna_opti.py

The Strategy

You can see that this strategy is made by these people so all credits go to them for creating this file. I’m just the guy that shows you the results he got on his backtesting setup to inform you about the possible profitability of this algorithm.

It’s been coded to mainly work on the 5 minute timeframe and it has a multitude of options to further optimize the parameter settings for different things.

You can also see that this ROI and Stoploss settings are not rounded. So it’s probable that a optimization run has been done to optimize these settings on the authors computer. So it might be that on your specific setup these have to be tuned for optimal results.

The most interesting part of this algorithm is located in the indicator method.

Not only does it borrow from other Freqtrade trading algorithms, but also from Tradingview scripts too. Which I have never seen earlier as far as I can remember.

It uses Bollinger Bands to define normal price movements and volatility.

Relative Momentum Index and Streaks to gauge the strength of the market movement.

ATR to calculate stop-loss and take-profit levels dynamically.

And SSL Channel to identify market trend direction.

And that brings me to a thing that you have to be aware of when using this strategy. Because this file also depends on another file for these custom indicators that are referred to if you watch closely.

If I scroll to the top, you can see here that this imports the indicators from a module called custom_indicators. And that is a file that is also present in the same repository that you have to download to your strategy directory too before you can use this algorithm. freqtrade-stuff/custom_indicators.py at f6c38def0b2fe01d8d42e47740cdeab53511527b · PeetCrypto/freqtrade-stuff (github.com)

raw.githubusercontent.com/PeetCrypto/freqtrade-stuff/f6c38def0b2fe01d8d42e47740cdeab53511527b/custom_indicators.py

So after the indicator parameters, we arrive at the buy settings for this algorithm.

There are three buy conditions set. Of which one is the BinHV45 based buy signal. The other two buys are triggered based on a combination of conditions such as low relative price to the Bollinger Bands, momentum, and guard conditions that utilize the concept of average day range (ADR) to prevent buys during unfavorable market conditions.

The sell logic is a lot simpler. There isn’t any configured. 

The strategy primarily focuses on the configured dynamic ROI and custom stoploss for selling.

After this sell method there are a few other methods configured.

The most interesting method here is the dynamic ROI method here.

This method uses a mechanism for determining whether the minimum return on investment (ROI) has been reached dynamically, based on ongoing market conditions and specific trade characteristics.

If the indicators confirm an ongoing trend, then the strategy may opt for a higher ROI expectation, leveraging the strength of the trend.

And it also checks for the presence of a pullback from the peak price to decide whether to stick with the original ROI table or adjust expectations. 

If no specific trend or conditions are met, or if data isn't available to make a dynamic decision, it defaults to the static ROI values from the predefined table.

So now that we know a little bit more about this algorithm, lets continue with the performance of it on my backtesting setup to see how well it does on my dataset.

Backtest results

And with this out of the way, let’s continue with the backtest results. 

As you can see from this table, the best results are found on the 15 minute timeframe. 

Here it could attain a hypothetical result of over 100.000 USDT.

Interestingly enough, the win rate is only around 50 percent and there has been a maximum drawdown detected of almost 40 percent. This is quite different from the other trading algorithms I’ve tested recently.

If we take a look at the equity curve. 

Then we can see that the algorithm has the ability to rise strongly under bullish circumstances. But also can suffer from steep drawdowns when markets are under not such optimal conditions.

In my opinion that is in stark contrast to thoughts behind the dynamic ROI and custom stop loss that this algorithm contains.

This maximum drawdown is also somewhat of an outlier in relation to the average drawdown of 5 percent over the complete backtest. We should however take this high drawdown possibility into consideration when we want to use this algo for our own trading though.

If I show you the mean profit/loss chart over the backtest period, then you see at which week that single huge drawdown moment occurred. There are also a coupoe of other weeks that suffered a big loss and further investigation is needed to find out what happened here.


The winrate box plot on the left  reveals that the median winrate is around 0.5 which indicates that on average, the strategy wins about half of its trades.

The interquartile range (IQR) extends from around 0.35 to 0.55. That suggests a moderate level of consistency in the strategy's performance week-over-week.

The single outlier observed near the 0.0 winrate level points to the exceptionally poor performing week. But luckily the whisker above to a winrate of 1.0, indicates that there are also weeks where the strategy wins all its trades.


The profit distribution box plot on the right shows a median profit around $0, similar to the break-even point.

And the narrow Inter quartile range implies that most weeks neither generate significant profits nor substantial losses.

However, the striking distribution of outliers, especially in the loss direction, shows again that the strategy can suffer occasional significant losses. Which we have seen in the previous plots.

Nevertheless, this algo still manages to attain a admirable hypothetical gain and that looks to be a good sign for possible live trading situations.

But when you decide to investigate this algo further on your own setup, then please remember that, in comparison with other strategies, is performance indicators show mixed results.

Especially again the drawdown amount that was unexpectedly high. Tis also influences other ratios like Calmar, Sortino and Sharpe.

Lookahead bias

I also tested this algo on lookahead bias. But the function unfortunately could not give me any results back. So you have to keep in mind that this algorithm could suffer from lookahead bias. 

The trailing stop loss is not configured so this issue is non existential.

Strategy league and conclusion

With this all said, with the information I have from the backtest, the total added score of all the individual factors makes this trading strategy end up in the top 10 best performing algorithms.

As said many times before, if you want to use this algorithm on your own setup, please make sure you do extensive tests and research first before using real money. Only if it proves to be profitable under forward testing conditions you might carefully use this strategy with real money.

So with this conclusion I am at the end of this post. I hope you like it.

This is it for me now, and I will see you in the next post.

Goodbye!


Files

BOOST your TRADING RESULTS with the Dyna Opti Algorithm !

Discover the incredible potential of the Dyna Opti trading algorithm! In this video, I present my findings on the profitability of the Dyna Opti algorithm, applied to various trading pairs and demonstrating impressive results on the 15-minute timeframe. 🔍 What's Inside: An overview of the Dyna Opti algorithm and its unique features A walkthrough of the code and its components Backtesting results showcasing potential gains and risks Analysis of key indicators like Bollinger Bands, Relative Momentum Index, and ATR Important notes on optimizing ROI and custom stop-loss settings 📥 Where to Find It: The Dyna Opti algorithm is available for download on GitHub: Dyna Opti on GitHub 🔔 Stay Connected: If you find this video helpful, please give it a thumbs up and subscribe to my channel for more trading insights. Don't forget to hit the notification bell so you never miss an update! 📊 Backtesting Highlights: Best results on the 15-minute timeframe Hypothetical gains of over $100,000 USDT Detailed equity curve analysis and drawdown observations 💬 Join the Discussion: Share your backtesting results and experiences in the comments! Let’s learn and grow together. === !!!! 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

Diego B

hi ! non backtest ... error : no module named 'custom_indicators'' ..

Diego B

Anyone have this problem ?

Dutch Algotrading

I beleive this is the video where I also demonstrated that you have to download an additional file from the original repository with the additional indicators

Ivan Moroz

I have two problems no module named 'custom_indicators'' .. and freqtrade.resolvers.iresolver - WARNING - Could not import /freqtrade/user_data/strategies/Dyna_opti.py due to 'No module named 'arrow'' - freqtrade - ERROR - Impossible to load Strategy 'Dyna_opti'. This class does not exist or contains Python code errors.

Dutch Algotrading

Did you install all the Python modules? Another thing could be that your installation is new and does not use deprecated functions anymore (which some of the 'older' strategy code depend on). That could also be a problem. Maybe these tips help.