//@version=5 indicator("DIMIS Trend Reversal Indicator", overlay=true, max_labels_count=500) rsiLength = input.int(14, "RSI Length") volumeLength = input.int(20, "Volume Average Length") volumeSpikeMultiple = input.float(1.5, "Volume Spike Multiple", minval=1.0, step=0.1) extremeLength = input.int(20, "Price Extreme Length") rsi = ta.rsi(close, rsiLength) volAvg = ta.sma(volume, volumeLength) volSpike = volume > volAvg * volumeSpikeMultiple lowExtreme = low <= ta.lowest(low, extremeLength)[1] highExtreme = high >= ta.highest(high, extremeLength)[1] bullMomentum = ta.crossover(rsi, 30) or (low < low[1] and rsi > rsi[1]) bearMomentum = ta.crossunder(rsi, 70) or (high > high[1] and rsi < rsi[1]) macroFilter = input.bool(true, "Macro / GLI filter supportive") bullReversal = lowExtreme and volSpike and bullMomentum and macroFilter bearReversal = highExtreme and volSpike and bearMomentum and macroFilter plotshape(bullReversal, title="Bullish Reversal", style=shape.triangleup, location=location.belowbar, color=color.lime, size=size.small, text="DIMIS Bull") plotshape(bearReversal, title="Bearish Reversal", style=shape.triangledown, location=location.abovebar, color=color.red, size=size.small, text="DIMIS Bear") alertcondition(bullReversal, "Bullish Reversal", "DIMIS bullish reversal: {{ticker}} {{interval}}") alertcondition(bearReversal, "Bearish Reversal", "DIMIS bearish reversal: {{ticker}} {{interval}}")