The 'mabStra' strategy - Is this strategy profitable, or not?

Do repost and rate:

Where to find this strategy

This time I will be investigating the MABStra strategy and if it is profitable or not.

This code is also part of the freqtrade github repository where a lot of bot trading strategies are collected and available for use.

To get this code:

  • visit the freqtrade site.
  • Navigate to their github repository, then click on the main github page.
  • You will see a repo that’s called freqtrade strategies.
  • In this repository you will find a folder called user data.
  • Then go to the strategies folder.
  • And all the way down you will find the mabStra file.

To download this exact strategy to your computer, follow the commands you see on the screen. Do this from within the user data strategies folder otherwise freqtrade will not recognise the file.

https://github.com/freqtrade/freqtrade-strategies/blob/main/user_data/strategies/hlhb.py

Browsing the code

Masoud Azizi is the author of this code and if you like his work, then pay him a friendly visit on his github site.

And at the top of the code we see our first warning he gives. Do not use this strategy without hyperopting it first.

So we know already that we are going to hyperopt this puppy.  But lets first find out later which timeframe promises to give us the best results with this strategy.

The proposed timeframe here is the 4 hour timeframe.

The ROI settings are time based and have specific profit points after certain amounts have been reached. This are the initial settings and we will find out later if these are already profitable, and if so, by how much.

Then there is  an initial stoploss set here, and I must say that this is this time it is tighter (is that a good word by the way) than earlier strategies by this author.

The following section here is the part where hyperparameter optimization will search for the most optimal values for the trading indicators.

You can learn more about that in my video about hyperoptimization.

Take note of the buy_div and sell_div parameters. They will become important later.

There is the actual indicator section.

There are six indicators used and all of them are simple moving averages.

Three of them are used for buy signals and three for sell signals.

The default values for all these averages are 7, 14 and 28 and at some point there will be changes for these if we are going to optimise these.

Let’s see what the actual buy and sell signals are:

The buy strategy will do the following

Divide the buy_mojo moving average by the buy_fast moving average, that result should be higher than the buy_div_min value to create our first signal.

Do the same division again with these moving averages but then the result should be below the buy_div_max value to create the second entry signal

Then the buy fastMA should be divided by the buy slowMA and that division should also be between the buy min and buy max value to create the entry 3 and 4 signals.

If all these conditions are met, then the buy signal is complete and the asset can be bought.

INITIAL BACKTEST RESULTS

Now I thought that the idea behind these rising and falling factors against another moving average was quite clever. It is not only the fact that a fast ma is above a slow ama, but also the strength of factor is taken into consideration here.

Unfortunately, this idea does not come into  fruition if you look at the initial backtest results. Only the 5 minute timeframe does seem to have good gains with this strategy. And only because I think that there are not much entry and exit signals on this timeframe.

And when the occasional entry signal arises, the strategy has difficulty to exit the trade because of the rarity of exit trades.

The amount of 5 minute trades is way lower than on the 1 day timeframe, which is very remarkable because mostly this is the opposite.

And another thing is that the average trade duration is around two days. Which I think is not realistic.

So I think that this is some sort of glitch of good luck that this strategy performs this well on the 5 minute timeframe.

However, because my methodology requires that I investigate the timeframe with the best results further. I am sort of forced to go ahead on this timeframe and see if hyperoptimization will improve things like the amount of pairs that will react to this strategy or the drawdown.

HYPEROPTIMIZED PARAMETERS BACKTEST RESULTS

So after a day of running hyperoptimization on my computer I got the advice to change the buy and sell parameter, roi and stoploss setting as follows. And I backtested these settings on the 5 minute timeframe.

And to my very big surprise

These settings performed awfull.

I have no clue why these settings were chosen as the ones that potentially had higher probabilities to perform better.

And even stranger, the fast moving averages have slower settings and the slow moving averages have faster settings, so actually there are some very strange “optimal” parameter settings found.

With these settings there are only 81 trades over 7 pairs. And a winrate of 49%

And there is almost no drawdown because there are almost no trades done. Only a couple of bad ones.

And I am not surprised with these settings.

Now I could do another run with Hyperoptimisation, but since this process took me one day and 5 hours to finish. And I have no trust that I will find better settings for this strategy.

So this time I am using the original strategy results and put these in the overall league…

STRATEGY LEAGUE

You can imagine where this strategy will be places with only a score of 5.

And that is at the bottom of this league.

Although the idea of this strategy is not bad

Using factors between fast and slow moving averages to determine if a faster moving average is above below a slower moving average is ingenuous.

And you can also determine at what rate it is rising, so actually some sort of momentum calculation

But Maybe using three MA’s to compared with each other makes this strategy unnecessary complicated.

And since the ROI setting created the most exit signals, there seems to be no need for using MA comparisons to create exit signals.

Which makes hyper optimisation calculations also a lot less complex.

This is the second 5 minute strategy of this series and again it entered on the lowest spot in this league.

Again, the idea was interesting, but the execution has flaws.

I will keep this idea in the back of my head nonetheless because I have a feeling that this can be helpful as a second or third confirmation indicator in another strategy.

But for now, lets keep it at this conclusion for this post.

Regulation and Society adoption

Ждем новостей

Нет новых страниц

Следующая новость