Bretzay

MACD strategy + Trailstop indicator

Bretzay Mis à jour   
Welcome traveler !

Here is my first indicator I made after 3 days of hardlearning pine code (beginner in coding).
I hope it will please you, if you have any suggestion to enhance this indicator, do not hesitate to give me your thoughts in the comments section or by Private message on trading View !

How does it works ?

It's a simple MACD strategy as describe here :
Uses of EMA 200 as a trend confirmer,
For sells :
When above Zero line (MACD) and under EMA200, we go on sell (background color is red)

For buys:
When under Zero line (MACD) and above EMA 200, we go on Buy (back ground color is green)

FILTERS !

I haded one filter to reduce noise on the indicator :
Signals aren't taken if one of the 14 last candles closed on the other side of the EMA 14.

What are the green and red lines ?
The green line is equivalent of a potential stop loss as a buyer side, same for the red one on seller side !
To make the space with the price bigger, please use "ATR multiplier" in the input options of the indicator while on your chart !

Is it timeframe specific ?

Hell no it is not timeframe specific ! You can try to use it on every timeframe !
As usual, I like to remind you that the best way to test an indicator is to go backtest it or to paper trade before using it on real market conditions !
If you find an idea of filter for a specific timeframe, do not hesitate to contact me ! I'll try to do my best to enhance this indicator as the time goes !

Is there repainting ?
There is no repainting on confirmation !
There's only a movement that I don't know how to ignore on the current open candle for the trail stop indicator I built, it should not be a problem if you place alerts to automatise your trading on the close of the candle, and not the high or low !
If you know how to resolve this problem with my code, I would be glad to get your tips to enhance the script ! :)

Example of the indicator in market (backtest, as said, no repaint on confirmation) :
Notes de version:
New user input to enable/disable :
- Background confirmations
- TrailStop filter : permit you to only see the SuperTrend Indicator or my selfmade add (make you see more places to place SL when supertrend isn't in the right direction)
- Added some informations to make inputs clearer (less plots without names)


The Stop loss is now filtered, to make the chart a bit cleaner
Some adjustments made to the ATR and the Trail stop to make it touched less by the price
Background between price and super trend so you can differenciate super trend indicator and the selfmade TS
Notes de version:
Just updating the visual on chart.
Notes de version:
.
Notes de version:
Repaired the error, script works well again !
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 ?