Bretzay

MACD strategy + Trailstop indicator

Bretzay Telah dikemas kini   
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) :
Nota Keluaran:
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
Nota Keluaran:
Just updating the visual on chart.
Nota Keluaran:
.
Nota Keluaran:
Repaired the error, script works well again !
Skrip sumber terbuka

Dalam semangat TradingView yang sebenar, penulis skrip ini telah menerbitkannya dengan menggunakan sumber terbuka supaya pedagang-pedagang dapat memahami dan mengesahkannya. Sorakan kepada penulis! Anda dapat menggunakannya secara percuma tetapi penggunaan semula kod ini dalam penerbitan adalah dikawalselia oleh Peraturan Dalaman. Anda boleh menyukainya untuk menggunakannya pada carta.

Penafian

Maklumat dan penerbitan adalah tidak dimaksudkan untuk menjadi, dan tidak membentuk, nasihat untuk kewangan, pelaburan, perdagangan dan jenis-jenis lain atau cadangan yang dibekalkan atau disahkan oleh TradingView. Baca dengan lebih lanjut di Terma Penggunaan.

Ingin menggunakan skrip ini pada carta?