jkswoods

JKSW Strength momentum index v2

Based on increasing and decreasing strength, this indicator will give a good indication of when a short or long opportunity is available.
Script open-source

Dans le véritable esprit de TradingView, l'auteur de ce script l'a publié en open-source, afin que les traders puissent le comprendre et le vérifier. Bravo à l'auteur! Vous pouvez l'utiliser gratuitement, mais la réutilisation de ce code dans une publication est régie par le règlement. Vous pouvez le mettre en favori pour l'utiliser sur un graphique.

Clause de non-responsabilité

Les informations et les publications ne sont pas destinées à être, et ne constituent pas, des conseils ou des recommandations en matière de finance, d'investissement, de trading ou d'autres types de conseils fournis ou approuvés par TradingView. Pour en savoir plus, consultez les Conditions d'utilisation.

Vous voulez utiliser ce script sur un graphique ?
study(title="JKSW Strength momentum index v2", shorttitle="JKSW SMI v2")

// Plot the RSI 
src = input(ohlc4, "Source")

shortlen = input(10, "Short term bars", integer)
midlen = input(35, "Mid term bars", integer)
longlen = input(110, "Long term bars", integer)

shortup = rma(max(change(src), 0), shortlen)
shortdown = rma(-min(change(src), 0), shortlen)

midup = rma(max(change(src), 0), midlen)
middown = rma(-min(change(src), 0), midlen)

longup = rma(max(change(src), 0), longlen)
longdown = rma(-min(change(src), 0), longlen)

short = shortdown == 0 ? 100 : shortup == 0 ? 0 : 100 - (100 / (1 + shortup / shortdown))
mid = middown == 0 ? 100 : midup == 0 ? 0 : 100 - (100 / (1 + midup / middown))
long = longdown == 0 ? 100 : longup == 0 ? 0 : 100 - (100 / (1 + longup / longdown))

// Overbought line
hline(80, "Overbought", black, dotted, 2)
// Oversold line
hline(20, "Oversold", black, dotted, 2)
// Mid line
hline(50, "Mid line", black, dotted)

// Plot on the chart where the points cross
color = short > mid ? short > long ? green : yellow : short < long ? red : yellow 
plot(short, color=color, title="SMI")
barcolor(color)