This indicator plots a composite momentum oscillator in a separate pane, featuring a hyper wave calculation and an integrated smart money flow oscillator.
// This Pine Script� code is subject to the terms of the Mozilla Public License 2.0 at https://mozilla.org/MPL/2.0/
// � Made By Cio
//@version=5
indicator("Lux Algo - Oscillator Matrix [6.0]", shorttitle = "Lux Algo - Oscillator Matrix [6.0]", max_lines_count = 500)
dwTL = "Length of the hyper wave"
smTL = "[SMA] Smooth signal with a simple moving average\n[EMA] Smooth signal with an exponential moving average\n[Input] Length of the smooth"
dvTL = "Sensibility of the real time divergence : less sensibility = more short term divs; more sensibility = more long term divs"
cmTL = "Show confluence meter at the side of the oscillator"
caTL = "Show confluence area at the bottom/top of the oscillator"
rfTL = "More factor will return in less signals but in a stronger way, less factor will return more signal with less strength"
simple bool dW = input.bool (true , "Main Length?????? ", inline = "1 ", group = "HYPER WAVE" , tooltip = dwTL)
simple int mL = input.int (7 , " ", inline = "1 ", group = "HYPER WAVE", minval = 5, maxval = 21)
simple string sT = input.string("SMA" , "Signal ", inline = "s ", group = "HYPER WAVE", options = ["SMA", "EMA"], tooltip = smTL)
simple int sL = input.int (3 , " ", inline = "s ", group = "HYPER WAVE", minval = 2, maxval = 10)
simple color fCSS = input.color (#51B155 , "Colors?? ", inline = "css ", group = "HYPER WAVE")
simple color sCSS = input.color (#80828D , " ", inline = "css ", group = "HYPER WAVE")
simple int tCSS = input.int (80 , " ", inline = "css ", group = "HYPER WAVE", minval = 0, maxval = 100)
simple int dvT = input.int (20 , "Divergence Sensibility?? ", inline = "x ", group = "HYPER WAVE", minval = 20, maxval = 40 , tooltip = dvTL)
simple bool sDiv = input.bool (true , "Show Divergences?? ", inline = "div ", group = "HYPER WAVE")
simple color blDv = input.color (color.new(#2962ff, 20), " ", inline = "div ", group = "HYPER WAVE")
simple color brDv = input.color (color.new(#f23645, 20), " ", inline = "div ", group = "HYPER WAVE")
simple bool Smf = input.bool (true , "Money Flow Length ", inline = "mfi ", group = "SMART MONEY FLOW")
simple int mfL = input.int (35 , " ", inline = "mfi ", group = "SMART MONEY FLOW", minval = 10, maxval = 55)
simple int mfS = input.int (6 , "Smooth?????????????? ", inline = "mfx ", group = "SMART MONEY FLOW", minval = 2 , maxval = 10)
simple color mfBL = input.color (#089981 , "Money Flow Colors?????? ", inline = "mfiC", group = "SMART MONEY FLOW")
simple color mfBR = input.color (#f23645 , " ", inline = "mfiC", group = "SMART MONEY FLOW")
simple color cnBL = input.color (#089981 , "Confluence Colors??????? ", inline = "cf ", group = "CONFLUENCE")
simple color cnBR = input.color (#f23645 , " ", inline = "cf ", group = "CONFLUENCE")
simple bool sCNF = input.bool (true , "Show Confluence Meter ", inline = "zf ", group = "CONFLUENCE", tooltip = cmTL)
simple bool sCNB = input.bool (true , "Show Confluence Areas ", inline = "zx ", group = "CONFLUENCE", tooltip = caTL)
simple bool rsS = input.bool (true , "Reversal Factor???? ", inline = "rv ", group = "REVERSAL")
simple int rsF = input.int (4 , " ", inline = "rv ", group = "REVERSAL", options = [1, 2, 3, 4, 5, 6, 7, 8, 9, 10], tooltip = rfTL)
simple color rsBL = input.color (#089981 , "Reversal Colors??????????", inline = "rc ", group = "REVERSAL")
simple color rsBR = input.color (#f23645 , " ", inline = "rc ", group = "REVERSAL")
type oL
float sig
float sgD
color cO
type dP
int n
float src
float p
type smf
float mfi
color mfc
float blMFI
float brMFI
type cnf
color up
color dn
float[] blT
float[] brT
var oL osc = oL.new (na, na, na )
var dP div = dP.new (na, na, na )
var smf mf = smf.new(na, na, na, na)
var cnf cf = cnf.new(
color.rgb(54, 58, 69, 60)
, color.rgb(54, 58, 69, 60)
, array.new<float>(1, na)
, array.new<float>(1, na)
)
mfT() =>
switch
mf.mfi > 0 =>
if cf.brT.size() > 1
cf.brT.pop()
if cf.blT.size() > mfL
cf.blT.pop()
if mf.mfi > cf.blT.avg()
cf.blT.unshift(mf.mfi)
else
cf.blT.unshift(mf.mfi[mfL] > 0
? mf.mfi[mfL]
: mf.mfi
)
mf.mfi < 0 =>
if cf.blT.size() > 1
cf.blT.pop()
if cf.brT.size() > mfL
cf.brT.pop()
if mf.mfi < cf.blT.avg()
cf.brT.unshift(mf.mfi)
else
cf.brT.unshift(mf.mfi[mfL] < 0
? mf.mfi[mfL]
: mf.mfi
)
method st(simple string src, float osc, simple int len) =>
float o = switch src
"SMA" => ta.sma(osc, len)
"EMA" => ta.ema(osc, len)
method css(color x, int inv) =>
color out = inv == 1
? color.new(x, tCSS)
: color.new(x, 0 )
method transp(color x, int t) =>
color.new(x, t)
rv() =>
vMA = ta.sma(volume, 7)
rsi = ta.rsi(vMA, 7) - 50
tMj = volume > vMA * ( rsF != 10 ? 1 + (rsF / 10) : 2) ? true : false
tMn = volume > vMA * ( rsF != 10 ? 0 + (rsF / 10) : 2) and not tMj ? true : false
mjBR = tMj and osc.sig > rsF and mf.mfi > cf.blT.avg() ? true : false
mjBL = tMj and osc.sig < -rsF and mf.mfi < cf.brT.avg() ? true : false
mnBR = tMn and osc.sig > 20 and osc.sig > osc.sgD and rsi > 20 ? true : false
mnBL = tMn and osc.sig < -20 and osc.sig < osc.sgD and rsi < -20 ? true : false
[mjBL, mjBR, mnBR, mnBL]
osc(simple int len, simple int smt) =>
float hi = ta.highest( len)
float lo = ta.lowest ( len)
float av = ta.sma (hl2, len)
osc.sig := ta.ema(ta.linreg((close - math.avg(hi, lo, av)) / (hi - lo) * 100, len, 0), sL)
osc.sgD := sT.st(osc.sig, 2)
osc.cO := osc.sig > osc.sgD ? fCSS.css(1) : sCSS.css(1)
mfi() =>
mf.mfi := ta.sma(ta.mfi(hl2, mfL) - 50, mfS)
mf.mfc := mf.mfi > 0
? mfBL
: mfBR
bL = mf.mfi - 10
bR = mf.mfi + 10
mf.blMFI := mf.mfi > 0 and mf.mfi > cf.blT.avg()
? bL
: 0
mf.brMFI := mf.mfi < 0 and mf.mfi < cf.brT.avg()
? bR
: 0
cDiv() =>
mx = math.max(osc.sig, osc.sgD, osc.sig[1], osc.sgD[1])
mn = math.min(osc.sig, osc.sgD, osc.sig[1], osc.sgD[1])
mxid = mx == osc.sig[1] or mx == osc.sgD[1] ? 1 : 0
mnid = mn == osc.sig[1] or mn == osc.sgD[1] ? 1 : 0
switch
osc.sig > dvT =>
if ta.crossunder(osc.sig, osc.sgD)
switch
na(div.src) =>
div.n := bar_index - mxid
div.src := math.max(open[mxid], close[mxid])
div.p := mx
not na(div.src) =>
if math.max(open[mxid], close[mxid]) > div.src and not(osc.sig[mxid] > div.p)
line.new(x1 = div.n, x2 = bar_index - mxid, y1 = div.p, y2 = mx, color = brDv)
div.n := na
div.src := na
div.p := na
else
div.n := bar_index - mxid
div.src := math.max(open[mxid], close[mxid])
div.p := mx
osc.sig < -dvT =>
if ta.crossover (osc.sig, osc.sgD)
switch
na(div.src) =>
div.n := bar_index - mnid
div.src := math.min(open[mnid], close[mnid])
div.p := mn
not na(div.src) =>
if math.min(open[mnid], close[mnid]) < div.src and not(osc.sig[mnid] < div.p)
line.new(x1 = div.n, x2 = bar_index - mnid, y1 = div.p, y2 = mn, color = blDv)
div.n := na
div.src := na
div.p := na
else
div.n := bar_index - mnid
div.src := math.min(open[mnid], close[mnid])
div.p := mn
osc(mL, sL)
mfi()
mfT()
if sDiv
cDiv()
[mjBL, mjBR, mnBR, mnBL] = rv()
// REVERSAL SIGNAL
plotshape(mjBL and rsS ? -65 : na, location = location.absolute, color = rsBL, size = size.tiny, style = shape.triangleup)
plotshape(mjBR and rsS ? 65 : na, location = location.absolute, color = rsBR, size = size.tiny, style = shape.triangledown)
plot(mnBL and rsS ? -65 : na, color = rsBL, linewidth = 1, style = plot.style_circles)
plot(mnBR and rsS ? 65 : na, color = rsBR, linewidth = 1, style = plot.style_circles)
// HYPER WAVE
plot(ta.crossover (osc.sig, osc.sgD) and dW ? math.min(osc.sig, osc.sgD) : na, style = plot.style_circles, linewidth = 2, color = osc.cO.css(0), offset = 0)
plot(ta.crossunder(osc.sig, osc.sgD) and dW ? math.max(osc.sig, osc.sgD) : na, style = plot.style_circles, linewidth = 2, color = osc.cO.css(0), offset = 0)
pO = plot(dW ? osc.sig : na, color = osc.cO.css(0) )
iO = plot(dW ? osc.sgD : na, color = osc.cO.css(1), display = display.none)
bL = plot(0 , color = color.black )
fill(pO, iO, color = dW ? osc.cO : na)
//SMART MONEY FLOW
pmf = plot(Smf ? mf.mfi : na, color = mf.mfc )
blT = plot(mf.blMFI > 0 and mf.mfi > 0 ? mf.blMFI : 0 , color = na, display = display.none)
brT = plot(mf.brMFI < 0 and mf.mfi < 0 ? mf.brMFI : 0 , color = na, display = display.none)
fill(bL, pmf, mf.mfc.transp(Smf ? 50 : 100))
fill(bL, blT, mf.mfc.transp(Smf ? 0 : 100))
fill(bL, brT, mf.mfc.transp(Smf ? 0 : 100))
cf.up := color.rgb(54, 58, 69, 60)
cf.dn := color.rgb(54, 58, 69, 60)
switch
osc.sig > 0 and mf.mfi > 0 => cf.up := cnBL
osc.sig < 0 and mf.mfi < 0 => cf.dn := cnBR
=>
cf.dn := cnBR.transp(60)
cf.up := cnBL.transp(60)
tLv = plot( 55, color = sCNB ? cf.up : na)
bLv = plot(-55, color = sCNB ? cf.dn : na)
tfL = plot( 50, display = display.none)
dfL = plot(-50, display = display.none)
fill(tLv, tfL, color = sCNB ? cf.up : na)
fill(bLv, dfL, color = sCNB ? cf.dn : na)
plot(mf.mfi > 0 and Smf ? cf.blT.avg() : na, color = mfBL, style = plot.style_linebr)
plot(mf.mfi < 0 and Smf ? cf.brT.avg() : na, color = mfBR, style = plot.style_linebr)
//CONFLUENCE METER
if barstate.islast
line.new(x1 = last_bar_index, x2 = bar_index - 1, y1 = 20, y2 = 20, color = chart.fg_color.transp(50), style = line.style_dashed, extend = extend.right)
line.new(x1 = last_bar_index, x2 = bar_index - 1, y1 = -20, y2 = -20, color = chart.fg_color.transp(50), style = line.style_dashed, extend = extend.right)
if sCNF
var line[] ln = array.new<line>()
for j in ln
j.delete()
ln.clear()
var label lb = na
lb.delete()
lb := na
for i = 0 to 21
int id = switch i
0 => 55
1 => 50
2 => 45
3 => 40
4 => 35
5 => 30
6 => 25
7 => 20
8 => 15
9 => 10
10 => 5
11 => 0
12 => -5
13 => -10
14 => -15
15 => -20
16 => -25
17 => -30
18 => -35
19 => -40
20 => -45
21 => -50
ln.unshift(
line.new(
x1 = bar_index + 2
, x2 = bar_index + 2
, y1 = id
, y2 = id - 5
, color = color.from_gradient(id, -50, 55, cnBR, cnBL)
, width = 4
)
)
cnfP = switch
osc.sig > 0 and mf.mfi > 0 and mf.mfi > cf.blT.avg() => 40
osc.sig < 0 and mf.mfi < 0 and mf.mfi < cf.brT.avg() => -40
osc.sig > 0 and mf.mfi > 0 => 20
osc.sig < 0 and mf.mfi < 0 => -20
osc.sig > 0 and mf.mfi < 0 => 0
osc.sig < 0 and mf.mfi > 0 => 0
lb := label.new(
x = bar_index + 3
, y = cnfP
, text = "?"
, color = na
, textcolor = chart.fg_color
, size = size.small
, style = label.style_label_left
)
Overview
Lux Algo - Oscillator Matrix detects both bullish and bearish divergences using an adjustable sensitivity threshold. Additional visual tools include a confluence meter, confluence highlight areas, and reversal factor signals. Traders can customize oscillator lengths, signal smoothing using simple or exponential moving averages, and visual styling. The script provides analytical visual cues without automated trade execution.
The inputs you can change from the gear icon on the chart. Defaults are the author's.
Setting
Type
Default
Variable
Main Length??????
bool
true
dW
int
7
mL
Signal
string
SMA
sT
int
3
sL
Colors??
color
#51B155
fCSS
color
#80828D
sCSS
int
80
tCSS
Divergence Sensibility??
int
20
dvT
Show Divergences??
bool
true
sDiv
color
color.new(#2962ff, 20)
blDv
color
color.new(#f23645, 20)
brDv
Money Flow Length
bool
true
Smf
Show all 24 settings
Setting
Type
Default
Variable
int
35
mfL
Smooth??????????????
int
6
mfS
Money Flow Colors??????
color
#089981
mfBL
color
#f23645
mfBR
Confluence Colors???????
color
#089981
cnBL
color
#f23645
cnBR
Show Confluence Meter
bool
true
sCNF
Show Confluence Areas
bool
true
sCNB
Reversal Factor????
bool
true
rsS
int
4
rsF
Reversal Colors??????????
color
#089981
rsBL
color
#f23645
rsBR
Third-party code. ForexR did not write, test or endorse this script, and the summary above was generated automatically from its code and README. Indicators describe the past, and a strategy's backtest can look better than live trading, especially when a script repaints. Check it in the Strategy Tester and on a demo account before you rely on it.
Oscillator Suite plots a normalised price oscillator in a separate pane and overlays a signal line that can use SMA, EMA, WMA, HMA, RMA, VWMA, T3, ZEMA, KAMA, or GKEMA. It marks bullish and bearish divergences, a smoothed money-flow series, confluence areas an
This indicator plots the Money Flow Index in a separate pane and marks regular and hidden bullish and bearish divergences between price pivots and the oscillator. It builds the index from positive and negative money flow, then finds pivot highs and lows using
This indicator plots a smoothed Z-score of cumulative volume delta in a separate pane, showing whether buying or selling pressure is dominant and when the reading enters extreme zones. It marks spot accumulation, climax or exhaustion, and pivot-based price-vol
This indicator plots a heuristic volume-balance oscillator in a separate pane. It estimates signed volume from the close location inside each bar, multiplies that by volume, and sums the proxy over a rolling window. The sum is scaled between minus one and plus
This indicator is an oscillator suite inspired by Market Cipher B and VuManChu Cipher B that plots in a separate pane. It combines a WaveTrend oscillator, a Money Flow Index (MFI) area, and an RSI indicator with automatic divergence detection. Visual signals h
QPulse is a multi-factor indicator that draws in a separate pane to evaluate market momentum, volume flow, and volatility dynamics. It calculates volume delta, a cumulative delta proxy, advanced adaptive ATR, and a hybrid volume-weighted RSI with overbought an