If upper/lower >= 1 + (ghost_threshold / 100)īox.set_top(ghostObject,upper-(upper * (ghost_threshold / 500)))īox.set_bottom(ghostObject,lower+(lower * (ghost_threshold / 500))) is considered a ghost zone, which we will draw.Īrray.sort(unique_prices, scending) if there is >= ghost_threshold difference in price, then the gap between the levels Now loop over the stored level values and check for % difference t_xy2(lineObject, bar_index, level_value) t_xy1(lineObject, bar_index - 1, level_value) If not array.includes(prices, level_value)Ĭolor transparentColor = color.new(lineColor, level_opacity / opacity_mulp) Level_pos_neg = str.tostring(array.get(level_parts, 2)) Level_opacity = str.tonumber(array.get(level_parts, 1)) Level_value = str.tonumber(array.get(level_parts, 0)) Var float unique_prices = array.new_float()į_trim_array(codes) // Remove empty values ![]() New array to store prices (for level values) Var string codes = str.split(i_codes_input, " ") Opacity_mulp = math.max(input.float(1.5, "Opacity", 0), 0.5)į_new_line() => line.new(na, na, na, na, extend=extend.both, style=line.style_solid)į_new_label() => label.new(na, na, "", textcolor=color.white, style=label.style_none, size=size.normal)į_new_GZ() => box.new(na, na, na, na, bgcolor=color.new(ay, 80), border_width=0) I_codes_input = input.string("", "Input Code") Ghost_threshold = input.float(1, "Percentage difference between levels to plot ghost zone") I_col_neutral = lor(color.white, "Neutral Levels") I_col_res = lor(color.red, "Negative Levels") This source code is subject to the terms of the Mozilla Public License 2.0 at This is a one time step and wouldn't be required after the first time. Once you hit save, please click on "Add to Chart" - an indicator will be added to your chart, but it will be blank for now. ![]() Copy and paste the following code in the editor, name the script "Tradytics Levels", and hit save.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |