Reflex
// This source code is subject to the terms of the Mozilla Public License 2.0 at https://mozilla.org/MPL/2.0/
// © jacobfabris

//@version=4
study("Reflex_version2",overlay=true)
pico = highest(high, 4990)
piso = 0.00001
cuelum = 1.618*pico

range_total = cuelum - piso
l1 = range_total*0.786+piso
l2 = range_total*0.618+piso
lm = range_total*0.5+piso
l3 = range_total*0.386+piso
l4 = range_total*0.214+piso

range_topo = cuelum-l1
l11 = range_topo*0.786+l1
l12 = range_topo*0.618+l1
l1m = range_topo*0.5+l1
l13 = range_topo*0.386+l1
l14 = range_topo*0.214+l1


range_meioss = l1-l2
l21 = range_meioss*0.786+l2
l22 = range_meioss*0.618+l2
l2m = range_meioss*0.5+l2
l23 = range_meioss*0.386+l2
l24 = range_meioss*0.214+l2

range_meios = l2-lm
l31 = range_meios*0.786+lm
l32 = range_meios*0.618+lm
l3m = range_meios*0.5+lm
l33 = range_meios*0.386+lm
l34 = range_meios*0.214+lm

range_meioi = lm-l3
l41 = range_meioi*0.786+l3
l42 = range_meioi*0.618+l3
l4m = range_meioi*0.5+l3
l43 = range_meioi*0.386+l3
l44 = range_meioi*0.214+l3

range_meioii = l3-l4
l51 = range_meioii*0.786+l4
l52 = range_meioii*0.618+l4
l5m = range_meioii*0.5+l4
l53 = range_meioii*0.386+l4
l54 = range_meioii*0.214+l4

range_fundo = l4-piso
l61 = range_fundo*0.786+piso
l62 = range_fundo*0.618+piso
l6m = range_fundo*0.5+piso
l63 = range_fundo*0.386+piso
l64 = range_fundo*0.214+piso

plot(cuelum,color=color.white,linewidth=4)

plot(l11)
plot(l12)
plot(l1m)
plot(l13)
plot(l14)

plot(l1,color=color.green,linewidth=3)

plot(l21)
plot(l22)
plot(l2m)
plot(l23)
plot(l24)

plot(l2,color=color.teal,linewidth=3)

plot(l31)
plot(l32)
plot(l3m)
plot(l33)
plot(l34)

plot(lm,color=color.silver,linewidth=3)

plot(l41)
plot(l42)
plot(l4m)
plot(l43)
plot(l44)

plot(l3,color=color.orange,linewidth=3)

plot(l51)
plot(l52)
plot(l5m)
plot(l53)
plot(l54)

plot(l4,color=color.red,linewidth=3)

plot(l61)
plot(l62)
plot(l6m)
plot(l63)
plot(l64)

plot(piso,color=color.gray,linewidth=4)

