0% found this document useful (0 votes)
6 views

Sup e resis 1

Uploaded by

Roberta Oliveira
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as TXT, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
6 views

Sup e resis 1

Uploaded by

Roberta Oliveira
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as TXT, PDF, TXT or read online on Scribd
You are on page 1/ 1

instrument { name = "Suportes e Resistências", icon = "indicators:ADX", overlay =

true }

support_resistance_period = input(14, "Período para Suporte e Resistência")


level_1_color = input { default = "Green", type = input.color }
level_1_width = input { default = 2, type = input.line_width }
level_2_color = input { default = "Red", type = input.color }
level_2_width = input { default = 2, type = input.line_width }

local function calculate_levels(candle)


return highest(candle.high, support_resistance_period), lowest(candle.low,
support_resistance_period)
end

sec = security(current_ticker_id, "15m")


if sec then
local highest_resistance, lowest_support = calculate_levels(sec)

plot(highest_resistance, "Resistência", level_1_color, level_1_width, 0,


style.levels, na_mode.continue)
plot(lowest_support, "Suporte", level_2_color, level_2_width, 0, style.levels,
na_mode.continue)
end

You might also like