TradingView
thienlovv
20 אוג׳ 2022 16:15

TDI - Traders Dynamic Index [Goldminds] with DIV RSI Alerts 

Airbnb, Inc.NASDAQ

תיאור

Originally from Goldminds. Later modified by Jakub a Babo. I just added RSI DIV alerts. You're welcome. :)
Instruction: once you have have this indicator and press Alt + A to create alert.
תגובות
ldonat
This is fantastic, but I'm getting the alerts an hour after divergence finishes. Could you tell me what I have to change in the script to fix that? Thanks.
thienlovv
@ldonat, Oh you need to change your time frame so you can set your alert again. For example, you're on 5 min and you set an alert; it will alert you 5 min. Change your the time and set alert again if you want different time frame.

Also if you want hidden divergence, you need to mark it on the settings.
ldonat
@thienlovv, Thanks for the quick reply. I only trade on the 15 minute chart and set my alerts on the 15 minute chart but I'm still getting the alerts an hour late.
thienlovv
@ldonat, oh I see. You may look at the code line 13-27 where is the delay especially line 15 ma = sma(r, bandLength) // Moving Average of RSI [current]. This might be the delayed.
The main function of the code:
src = close // Source of Calculations (Close of Bar)
r = rsi(src, rsiPeriod) // RSI of Close
ma = sma(r, bandLength) // Moving Average of RSI [current]
offs = (1.6185 * stdev(r, bandLength)) // Offset
up = ma + offs // Upper Bands
dn = ma - offs // Lower Bands
mid = (up + dn) / 2 // Average of Upper and Lower Bands
fastMA = sma(r, lengthrsipl) // Moving Average of RSI 7 bars back
slowMA = sma(r, lengthtradesl) // Moving Average of RSI 2 bars back
osc = slowMA
hline(20) // ExtremelyOversold
//hline(30) // Oversold
// hline(50) // Midline
//hline(70) // Overbought
hline(80) // ExtremelyOverbought

The rest are just calculations and plots.
thienlovv
@ldonat, I'm thinking if we want real time, we might substitute ma = sma(r, bandLength) for something like a "for loop" to scan the "close of bar".
thienlovv
@ldonat, anyways, thank you for interesting. Using RSI strategy is not 100%. I'm using this alert when I'm away from my computer. My main strategy is using RSI channel. Hope it might be interested to you.
עוד