OPEN-SOURCE SCRIPT

MACD strategy + Trailstop indicator

ที่อัปเดต:
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 !
Average True Range (ATR)Exponential Moving Average (EMA)EURUSDFREEMoving Average Convergence / Divergence (MACD)macdcrossmacdcrossoversimpletrendtrendcontinuationtrendfollowingtrendtrading

สคริปต์โอเพนซอร์ซ

ด้วยเจตนารมณ์หลักของ TradingView ผู้เขียนสคริปต์นี้ได้เผยแพร่เป็นโอเพนซอร์ส เพื่อให้เทรดเดอร์สามารถเข้าใจและตรวจสอบได้ ต้องขอบคุณผู้เขียน! ที่ให้คุณใช้ได้ฟรี แต่การนำโค้ดนี้ไปใช้ในการเผยแพร่ซ้ำจะต้องอยู่ภายใต้ กฎระเบียบการใช้งาน คุณสามารถตั้งเป็นรายการโปรดเพื่อใช้บนชาร์ตได้

ต้องการที่จะใช้สคริปต์นี้บนชาร์ตใช่ไหม?

คำจำกัดสิทธิ์ความรับผิดชอบ