PROTECTED SOURCE SCRIPT

AlgoRanger - Oscillator Matrix

74
/version=5
indicator("AlgoRanger - Oscillator Matrix", shorttitle="AlgoRanger Oscillator Matrix", overlay=false, max_lines_count=500)

// === USER INPUTS ===
dW = input.bool(true, "Enable Hyper Wave", group="Hyper Wave")
mL = input.int(7, "Main Length", group="Hyper Wave", minval=5, maxval=21)
sT = input.string("SMA", "Smoothing Type", group="Hyper Wave", options=["SMA", "EMA"])
sL = input.int(3, "Smoothing Length", group="Hyper Wave", minval=2, maxval=10)

// Colors
fCSS = input.color(#51B155, "Main Color", group="Hyper Wave")
sCSS = input.color(#80828D, "Secondary Color", group="Hyper Wave")

// Divergence
dvT = input.int(20, "Divergence Sensitivity", group="Divergence", minval=20, maxval=40)
sDiv = input.bool(true, "Show Divergences", group="Divergence")

// Reversal Factor
rsS = input.bool(true, "Enable Reversal Factor", group="Reversal")
rsF = input.int(4, "Reversal Strength", group="Reversal", options=[1,2,3,4,5,6,7,8,9,10])

// Money Flow
Smf = input.bool(true, "Enable Money Flow", group="Money Flow")
mfL = input.int(35, "Money Flow Length", group="Money Flow", minval=10, maxval=55)
mfS = input.int(6, "Money Flow Smoothing", group="Money Flow", minval=2, maxval=10)

// === OSCILLATOR FUNCTION ===
oscillator(len, smt) =>
float hi = ta.highest(len)
float lo = ta.lowest(len)
float av = ta.sma(hl2, len)

sig = ta.ema(ta.linreg((close - math.avg(hi, lo, av)) / (hi - lo) * 100, len, 0), smt)
sgD = sT == "SMA" ? ta.sma(sig, smt) : ta.ema(sig, smt)

[sig, sgD]

// === CALCULATE OSCILLATOR ===
[oSig, oSgD] = oscillator(mL, sL)

// === PLOTTING OSCILLATOR ===
pO = plot(oSig, color=fCSS, title="Oscillator Signal")
iO = plot(oSgD, color=sCSS, title="Oscillator Smoothed")

fill(pO, iO, color=color.new(fCSS, 80))

// === MONEY FLOW CALCULATION ===
mfVal = ta.sma(ta.mfi(hl2, mfL) - 50, mfS)
mfColor = mfVal > 0 ? color.green : color.red

// === PLOTTING MONEY FLOW ===
plot(Smf ? mfVal : na, color=mfColor, title="Money Flow")

// === REVERSAL SIGNALS ===
plotshape(oSig > 50 and rsS, location=location.absolute, color=color.blue, style=shape.triangleup, title="Reversal Up")
plotshape(oSig < -50 and rsS, location=location.absolute, color=color.red, style=shape.triangledown, title="Reversal Down")

Declinazione di responsabilità

Le informazioni ed i contenuti pubblicati non costituiscono in alcun modo una sollecitazione ad investire o ad operare nei mercati finanziari. Non sono inoltre fornite o supportate da TradingView. Maggiori dettagli nelle Condizioni d'uso.