OPEN-SOURCE SCRIPT
RSI MTF 15m + 1h (Oriol)

//version=5
indicator("RSI MTF 15m + 1h (Oriol)", overlay = false, timeframe = "", timeframe_gaps = true)
// ─── PARÀMETRES ─────────────────────────────────────────────
rsiLength = input.int(14, "Període RSI")
src = input.source(close, "Font de preu")
tfFast = input.timeframe("15", "Timeframe ràpid (RSI 15m)")
tfSlow = input.timeframe("60", "Timeframe lent (RSI 1h)")
showSignals = input.bool(true, "Mostrar senyals LONG/SHORT")
// ─── RSI MULTITIMEFRAME ────────────────────────────────────
// RSI del timeframe ràpid (per defecte 15m)
src_fast = request.security(syminfo.tickerid, tfFast, src)
rsi_fast = ta.rsi(src_fast, rsiLength)
// RSI del timeframe lent (per defecte 1h)
src_slow = request.security(syminfo.tickerid, tfSlow, src)
rsi_slow = ta.rsi(src_slow, rsiLength)
// ─── DIBUIX RSI ─────────────────────────────────────────────
plot(rsi_fast, title = "RSI ràpid (15m)", color = color.new(color.aqua, 0), linewidth = 2)
plot(rsi_slow, title = "RSI lent (1h)", color = color.new(color.orange, 0), linewidth = 2)
hline(70, "Sobrecomprat", color = color.new(color.red, 70), linestyle = hline.style_dashed)
hline(30, "Sobrevenut", color = color.new(color.lime, 70), linestyle = hline.style_dashed)
hline(50, "Mitja", color = color.new(color.gray, 80))
// ─── CONDICIONS D’EXEMPLE ───────────────────────────────────
// LONG: RSI 1h < 40 i RSI 15m creua cap amunt 30
// SHORT: RSI 1h > 60 i RSI 15m creua cap avall 70
longCond = (rsi_slow < 40) and ta.crossover(rsi_fast, 30)
shortCond = (rsi_slow > 60) and ta.crossunder(rsi_fast, 70)
// ─── SENYALS (SENSE SCOPE LOCAL) ────────────────────────────
plotshape(showSignals and longCond,
title = "Possible LONG",
style = shape.triangleup,
location = location.bottom,
color = color.new(color.lime, 0),
size = size.small,
text = "LONG")
plotshape(showSignals and shortCond,
title = "Possible SHORT",
style = shape.triangledown,
location = location.top,
color = color.new(color.red, 0),
size = size.small,
text = "SHORT")
// ─── ALERTES ────────────────────────────────────────────────
alertcondition(longCond, title = "Senyals LONG RSI 15m+1h",
message = "Condició LONG RSI 15m + 1h complerta")
alertcondition(shortCond, title = "Senyals SHORT RSI 15m+1h",
message = "Condició SHORT RSI 15m + 1h complerta")
indicator("RSI MTF 15m + 1h (Oriol)", overlay = false, timeframe = "", timeframe_gaps = true)
// ─── PARÀMETRES ─────────────────────────────────────────────
rsiLength = input.int(14, "Període RSI")
src = input.source(close, "Font de preu")
tfFast = input.timeframe("15", "Timeframe ràpid (RSI 15m)")
tfSlow = input.timeframe("60", "Timeframe lent (RSI 1h)")
showSignals = input.bool(true, "Mostrar senyals LONG/SHORT")
// ─── RSI MULTITIMEFRAME ────────────────────────────────────
// RSI del timeframe ràpid (per defecte 15m)
src_fast = request.security(syminfo.tickerid, tfFast, src)
rsi_fast = ta.rsi(src_fast, rsiLength)
// RSI del timeframe lent (per defecte 1h)
src_slow = request.security(syminfo.tickerid, tfSlow, src)
rsi_slow = ta.rsi(src_slow, rsiLength)
// ─── DIBUIX RSI ─────────────────────────────────────────────
plot(rsi_fast, title = "RSI ràpid (15m)", color = color.new(color.aqua, 0), linewidth = 2)
plot(rsi_slow, title = "RSI lent (1h)", color = color.new(color.orange, 0), linewidth = 2)
hline(70, "Sobrecomprat", color = color.new(color.red, 70), linestyle = hline.style_dashed)
hline(30, "Sobrevenut", color = color.new(color.lime, 70), linestyle = hline.style_dashed)
hline(50, "Mitja", color = color.new(color.gray, 80))
// ─── CONDICIONS D’EXEMPLE ───────────────────────────────────
// LONG: RSI 1h < 40 i RSI 15m creua cap amunt 30
// SHORT: RSI 1h > 60 i RSI 15m creua cap avall 70
longCond = (rsi_slow < 40) and ta.crossover(rsi_fast, 30)
shortCond = (rsi_slow > 60) and ta.crossunder(rsi_fast, 70)
// ─── SENYALS (SENSE SCOPE LOCAL) ────────────────────────────
plotshape(showSignals and longCond,
title = "Possible LONG",
style = shape.triangleup,
location = location.bottom,
color = color.new(color.lime, 0),
size = size.small,
text = "LONG")
plotshape(showSignals and shortCond,
title = "Possible SHORT",
style = shape.triangledown,
location = location.top,
color = color.new(color.red, 0),
size = size.small,
text = "SHORT")
// ─── ALERTES ────────────────────────────────────────────────
alertcondition(longCond, title = "Senyals LONG RSI 15m+1h",
message = "Condició LONG RSI 15m + 1h complerta")
alertcondition(shortCond, title = "Senyals SHORT RSI 15m+1h",
message = "Condició SHORT RSI 15m + 1h complerta")
오픈 소스 스크립트
트레이딩뷰의 진정한 정신에 따라, 이 스크립트의 작성자는 이를 오픈소스로 공개하여 트레이더들이 기능을 검토하고 검증할 수 있도록 했습니다. 작성자에게 찬사를 보냅니다! 이 코드는 무료로 사용할 수 있지만, 코드를 재게시하는 경우 하우스 룰이 적용된다는 점을 기억하세요.
면책사항
해당 정보와 게시물은 금융, 투자, 트레이딩 또는 기타 유형의 조언이나 권장 사항으로 간주되지 않으며, 트레이딩뷰에서 제공하거나 보증하는 것이 아닙니다. 자세한 내용은 이용 약관을 참조하세요.
오픈 소스 스크립트
트레이딩뷰의 진정한 정신에 따라, 이 스크립트의 작성자는 이를 오픈소스로 공개하여 트레이더들이 기능을 검토하고 검증할 수 있도록 했습니다. 작성자에게 찬사를 보냅니다! 이 코드는 무료로 사용할 수 있지만, 코드를 재게시하는 경우 하우스 룰이 적용된다는 점을 기억하세요.
면책사항
해당 정보와 게시물은 금융, 투자, 트레이딩 또는 기타 유형의 조언이나 권장 사항으로 간주되지 않으며, 트레이딩뷰에서 제공하거나 보증하는 것이 아닙니다. 자세한 내용은 이용 약관을 참조하세요.