Está en la página 1de 2

instrument {

name = 'FIBONACCI: BrosgiDinero',


overlay = true
}

tf = {"1s", "5s", "10s", "15s", "30s", "1m", "2m", "5m", "10m", "15m", "30m", "1H",
"2H", "4H", "8H", "12H", "1D", "1W", "1M", "1Y"}
candle_tf2 = input(12, "Time interval", input.string_selection,tf)

input_group {
"Up Trend",
colorUp1 = input { default = "rgba(50, 205, 50, 0.3)", type = input.color },
colorUp2 = input { default = "rgba(50, 205, 50, 0.4)", type = input.color },
colorUp3 = input { default = "rgba(50, 205, 50, 0.5)", type = input.color },
colorUp4 = input { default = "rgba(50, 205, 50, 0.6)", type = input.color },
colorUp5 = input { default = "rgba(50, 205, 50, 0.7)", type = input.color },
colorUp6 = input { default = "rgba(50, 205, 50, 0.8)", type = input.color },
colorUp7 = input { default = "rgba(50, 205, 50, 0.9)", type = input.color },
widthUp = input { default = 1, type = input.line_width}
}

input_group {
"Down Trend",
colorDn1 = input { default = "rgba(255, 0, 0, 0.3)", type = input.color },
colorDn2 = input { default = "rgba(255, 0, 0, 0.4)", type = input.color },
colorDn3 = input { default = "rgba(255, 0, 0, 0.5)", type = input.color },
colorDn4 = input { default = "rgba(255, 0, 0, 0.6)", type = input.color },
colorDn5 = input { default = "rgba(255, 0, 0, 0.7)", type = input.color },
colorDn6 = input { default = "rgba(255, 0, 0, 0.8)", type = input.color },
colorDn7 = input { default = "rgba(255, 0, 0, 0.9)", type = input.color },
widthDn = input { default = 1, type = input.line_width}
}

sec = security (current_ticker_id, tf[candle_tf2])

LL = lowest(sec.low, 1)
HH = highest(sec.high, 1)
Range = abs(LL - HH)

if sec then
if (sec.close > sec.open) then
plot(HH - Range*0,"PlotUp1", colorUp1, widthUp,0, style.levels,
na_mode.continue)
plot(HH - Range*0.236,"PlotUp2", colorUp2, widthUp,0, style.levels,
na_mode.continue)
plot(HH - Range*0.382,"PlotUp3", colorUp3, widthUp,0, style.levels,
na_mode.continue)
plot(HH - Range*0.500,"PlotUp4", colorUp4, widthUp,0, style.levels,
na_mode.continue)
plot(HH - Range*0.618,"PlotUp5", colorUp5, widthUp,0, style.levels,
na_mode.continue)
plot(HH - Range*1.000,"PlotUp6", colorUp6, widthUp,0, style.levels,
na_mode.continue)
plot(HH - Range*1.618,"PlotUp7", colorUp7, widthUp,0, style.levels,
na_mode.continue)
end
if (sec.close < sec.open) then
plot(LL + Range*0,"PlotDn1", colorDn1, widthDn,0, style.levels,
na_mode.continue)
plot(LL + Range*0.236,"PlotDn2", colorDn2, widthDn,0, style.levels,
na_mode.continue)
plot(LL + Range*0.382,"PlotDn3", colorDn3, widthDn,0, style.levels,
na_mode.continue)
plot(LL + Range*0.500,"PlotDn4", colorDn4, widthDn,0, style.levels,
na_mode.continue)
plot(LL + Range*0.618,"PlotDn5", colorDn5, widthDn,0, style.levels,
na_mode.continue)
plot(LL + Range*1.000,"PlotDn6", colorDn6, widthDn,0, style.levels,
na_mode.continue)
plot(LL + Range*1.618,"PlotDn7", colorDn7, widthDn,0, style.levels,
na_mode.continue)
end

end

También podría gustarte