Drun30

Momentum Strategy (BTC/USDT; 1h) - MACD (with source code)

Drun30 Mis à jour   
Good morning traders.
It's been a while from my last publication of a strategy and today I want to share with you this small piece of script that showed quite interesting result across bitcoin and other altcoins.

The macd indicator is an indicator built on the difference between a fast moving average and a slow moving average: this difference is generally plottted with a blue line while the orange line is simply a moving average computed on this difference.

Usually this indicator is used in technical analysis for getting signals of buy and sell respectively when the macd crosses above or under its moving average: it means that the distance of the fast moving average (the most responsive one) from the slower one is getting lower than what it-used-to-be in the period considered: this could anticipate a cross of the two moving averages and you want to anticipate this potential trend reversal by opening a long position

Of course the workflow is specularly the same for opening short positions (or closing long positions)

What this strategy does is simply considering the moving average computed on macd and applying a linear regression on it: in this way, even though the signal can be sligthly delayed, you reduce noise plotting a smooth curve.

Then, it simply checks the maximums and the minimums of this curve detecting whenever the changes of the values start to be negative or positive, so it opens a short position (closes long) on the maximum on this curve and it opens a long position (closes short) on the minimum.

Of course, I set an option for using this strategy in a conventional way working on the crosses between macd and its moving average. Alternatively you can use this workflow if you prefer.

In conclusion, you can use a tons of moving averages: I made a function in pine in order to allw you to use any moving average you want for the two moving averages on which the macd is based or for the moving average computed on the macd

PLEASE, BE AWARE THAT THIS TRADING STRATEGY DOES NOT GUARANTEE ANY KIND OF SUCCESS IN ADVANCE. YOU ARE THE ONE AND ONLY RESPONSIBLE OF YOUR OWN DECISIONS, I DON'T TAKE ANY RESPONSIBILITY ASSOCIATED WITH THEM. IF YOU RUN THIS STRATEGY YOU ACCEPT THE POSSIBILITY OF LOOSING MONEY, ALL OF MY PUBBLICATIONS ARE SUPPOSED TO BE JUST FOR EDUCATIONAL PURPOSES.
IT IS AT YOUR OWN RISK WHETHER TO USE IT OR NOT

But if you make money out of this, please consider to buy me a beer 😜

Happy Trading!
Notes de version:
Added compounding for backtest
Notes de version:
Added filter/take profit RSI in order to increase the percentage of profitable trades

Script open-source

Dans le véritable esprit de TradingView, l'auteur de ce script l'a publié en open-source, afin que les traders puissent le comprendre et le vérifier. Bravo à l'auteur! Vous pouvez l'utiliser gratuitement, mais la réutilisation de ce code dans une publication est régie par le règlement. Vous pouvez le mettre en favori pour l'utiliser sur un graphique.

Clause de non-responsabilité

Les informations et les publications ne sont pas destinées à être, et ne constituent pas, des conseils ou des recommandations en matière de finance, d'investissement, de trading ou d'autres types de conseils fournis ou approuvés par TradingView. Pour en savoir plus, consultez les Conditions d'utilisation.

Vous voulez utiliser ce script sur un graphique ?