This document defines functions to identify fractal high and low prices on a chart. It then defines inputs to control the colors, widths, and visibility of the high, low, and fill plots. The fractal high and low values are calculated and optionally plotted along with a color fill between them.
This document defines functions to identify fractal high and low prices on a chart. It then defines inputs to control the colors, widths, and visibility of the high, low, and fill plots. The fractal high and low values are calculated and optionally plotted along with a color fill between them.
This document defines functions to identify fractal high and low prices on a chart. It then defines inputs to control the colors, widths, and visibility of the high, low, and fill plots. The fractal high and low values are calculated and optionally plotted along with a color fill between them.
local res = make_series () local p = high [2] if not get_value (p) then return res end local is_fractal = high <= p and high [1] <= p and high [3] <= p and high [4] <= p res:set (iff(is_fractal, p, res[1])) return res end local function low_fractal () local res = make_series () local p = low [2] if not get_value (p) then return res end local is_fractal = low >= p and low [1] >= p and low [3] >= p and low [4] >= p res:set (iff(is_fractal, p, res[1])) return res end input_group { "front.platform.chart.high", high_color = input { default = "lime", type = input.color }, high_width = input { default = 1, type = input.line_width }, high_visible = input { default = true, type = input.plot_visibility } } input_group { "front.platform.chart.low", low_color = input { default = "red", type = input.color }, low_width = input { default = 1, type = input.line_width }, low_visible = input { default = true, type = input.plot_visibility } } input_group { "front.newind.adx.fill", fill_color = input { default = rgba(200,235,285,0.20), type = input.color }, fill_visible = input { default = true, type = input.plot_visibility } } h = high_fractal () l = low_fractal () if fill_visible then fill (l, h, "", fill_color) end if high_visible then plot (h, "High", high_color, high_width) end if low_visible then plot (l, "Low", low_color, low_width) end