LuxAlgo Oscillator Matrix 6.0
LuxAlgo Oscillator Matrix 6.0
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)
rfTL = "More factor will return in less signals but in a stronger way, less factor
will return more signal with less strength"
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
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
)
method st(simple string src, float osc, simple int len) =>
float o = switch src
"SMA" => ta.sma(osc, len)
"EMA" => ta.ema(osc, len)
rv() =>
vMA = ta.sma(volume, 7)
rsi = ta.rsi(vMA, 7) - 50
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
mfi() =>
mf.mfi := ta.sma(ta.mfi(hl2, mfL) - 50, mfS)
bL = mf.mfi - 10
bR = mf.mfi + 10
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])
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
osc(mL, sL)
mfi()
mfT()
if sDiv
cDiv()
// 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)
// 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)
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)
//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 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
lb := label.new(
x = bar_index + 3
, y = cnfP
, text = "?"
, color = na
, textcolor = chart.fg_color
, size = size.small
, style = label.style_label_left
)