Dynamic Momentum Range Index (DMRI)//@version=5
indicator("Dynamic Momentum Range Index (DMRI)", shorttitle="DMRI", overlay=false)
// Inputs
n = input.int(14, title="Momentum Period", minval=1)
atrLength = input.int(14, title="ATR Length", minval=1)
maLength = input.int(20, title="Moving Average Length", minval=1)
// Calculations
pm = close - close // Price Momentum (PM)
atr = ta.atr(atrLength) // Average True Range (ATR)
va = pm / atr // Volatility Adjustment (VA)
// Moving Average and Dynamic Range Factor (DRF)
ma = ta.sma(close, maLength)
drf = math.abs(close - ma) / atr
// Dynamic Momentum Range Index (DMRI)
dmri = va * drf
// Normalization
maxVal = ta.highest(dmri, atrLength)
minVal = ta.lowest(dmri, atrLength)
dmriNormalized = (dmri - minVal) / (maxVal - minVal) * 100
// Zones for Interpretation
bullishZone = 70
bearishZone = 30
// Plotting DMRI
plot(dmriNormalized, title="DMRI", color=color.blue, linewidth=2)
hline(70, "Overbought", color=color.red)
hline(30, "Oversold", color=color.green)
hline(50, "Neutral", color=color.gray)
// Background Coloring
bgcolor(dmriNormalized > bullishZone ? color.new(color.green, 90) : na, title="Bullish Zone Highlight")
bgcolor(dmriNormalized < bearishZone ? color.new(color.red, 90) : na, title="Bearish Zone Highlight")
Pricemomentum
Dynamic Momentum Range Index (DMRI)//@version=5
indicator("Dynamic Momentum Range Index (DMRI)", shorttitle="DMRI", overlay=false)
// Inputs
n = input.int(14, title="Momentum Period", minval=1)
atrLength = input.int(14, title="ATR Length", minval=1)
maLength = input.int(20, title="Moving Average Length", minval=1)
// Calculations
pm = close - close // Price Momentum (PM)
atr = ta.atr(atrLength) // Average True Range (ATR)
va = pm / atr // Volatility Adjustment (VA)
// Moving Average and Dynamic Range Factor (DRF)
ma = ta.sma(close, maLength)
drf = math.abs(close - ma) / atr
// Dynamic Momentum Range Index (DMRI)
dmri = va * drf
// Normalization
maxVal = ta.highest(dmri, atrLength)
minVal = ta.lowest(dmri, atrLength)
dmriNormalized = (dmri - minVal) / (maxVal - minVal) * 100
// Zones for Interpretation
bullishZone = 70
bearishZone = 30
// Plotting DMRI
plot(dmriNormalized, title="DMRI", color=color.blue, linewidth=2)
hline(70, "Overbought", color=color.red)
hline(30, "Oversold", color=color.green)
hline(50, "Neutral", color=color.gray)
// Background Coloring
bgcolor(dmriNormalized > bullishZone ? color.new(color.green, 90) : na, title="Bullish Zone Highlight")
bgcolor(dmriNormalized < bearishZone ? color.new(color.red, 90) : na, title="Bearish Zone Highlight")