Bretzay

MACD strategy + Trailstop indicator

Bretzay 已更新   
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) :
版本注释:
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
版本注释:
Just updating the visual on chart.
版本注释:
.
版本注释:
Repaired the error, script works well again !
开源脚本

本着真正的TradingView精神,该脚本的作者将其开源发布,以便交易者可以理解和验证它。为作者喝彩!您可以免费使用它,但在出版物中重复使用此代码受网站规则的约束。 您可以收藏它以在图表上使用。

免责声明

这些信息和出版物并不意味着也不构成TradingView提供或认可的金融、投资、交易或其它类型的建议或背书。请在使用条款阅读更多信息。

想在图表上使用此脚本?