The trend up seem by green dots
Trend down seen by red dots
and the line red or green
I Set this one for 1 hour chart , try to play with settings for better optimization
So it nice system to detect trends
Happy new year to all members of TradingView
So link is for his code is
1. Creating an alert warns you.
2. Using these settings: muliplier=0.1, period=20, percent=0.2 with XAG and XAU on 15 min, I set up alerts (per bar close) overnight and looked at them this morning. There were 4 alerts of which triggered but nothing is on the chart at that specific time.
@RafaelZioni is that something you can look into?
Try to change lines 6, 7 and 14 like this:
st_mult = input(title="ATR Multiplier", defval=1.5, minval=0, maxval=10, step=0.1,type=float ) //line 6
st_period = input(title="ATR Period", defval=5, minval=1, maxval=14, step=1,type=integer ) //line 7
percent = st_mult * atr( st_period )/close //line 14
This way, percent is adaptable to the volatility and you can change the time frame without wasting time finding the best parameter.
Credits go to Sylvain Vervoort in an article on the S&C magazine June 2013.