Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- //@version=5
- indicator("Bull/Bear Levels", shorttitle="LVLS", overlay=true)
- // Input for each horizontal line value
- var line1_value = input.float(0.00, title="Inflection Point")
- var line2_value = input.float(0.00, title="Bull 1")
- var line3_value = input.float(0.00, title="Bull 2")
- var line4_value = input.float(0.00, title="Bull 3")
- var line5_value = input.float(0.00, title="Bear 1")
- var line6_value = input.float(0.00, title="Bear 2")
- var line7_value = input.float(0.00, title="Bear 3")
- // Line properties
- var line_width = input.int(4, title="Line Width")
- var yellow_color = color.yellow // Yellow color
- var bright_red_color = color.rgb(255, 0, 0) // Bright red color
- var bright_green_color = color.rgb(0, 255, 0) // Bright green color
- // Plotting the horizontal lines using the plot function
- plot(line1_value, title="Line 1", color=yellow_color, linewidth=line_width)
- plot(line2_value, title="Line 2", color=bright_red_color, linewidth=line_width)
- plot(line3_value, title="Line 3", color=bright_red_color, linewidth=line_width)
- plot(line4_value, title="Line 4", color=bright_red_color, linewidth=line_width)
- plot(line5_value, title="Line 5", color=bright_green_color, linewidth=line_width)
- plot(line6_value, title="Line 6", color=bright_green_color, linewidth=line_width)
- plot(line7_value, title="Line 7", color=bright_green_color, linewidth=line_width)
- // Extending the lines into the future by 500 bars using line.new
- var extendedBars = 500 // Number of bars to extend the lines
- line.new(x1=bar_index, y1=line1_value, x2=bar_index + extendedBars, y2=line1_value, color=yellow_color, width=line_width)
- line.new(x1=bar_index, y1=line2_value, x2=bar_index + extendedBars, y2=line2_value, color=bright_red_color, width=line_width)
- line.new(x1=bar_index, y1=line3_value, x2=bar_index + extendedBars, y2=line3_value, color=bright_red_color, width=line_width)
- line.new(x1=bar_index, y1=line4_value, x2=bar_index + extendedBars, y2=line4_value, color=bright_red_color, width=line_width)
- line.new(x1=bar_index, y1=line5_value, x2=bar_index + extendedBars, y2=line5_value, color=bright_green_color, width=line_width)
- line.new(x1=bar_index, y1=line6_value, x2=bar_index + extendedBars, y2=line6_value, color=bright_green_color, width=line_width)
- line.new(x1=bar_index, y1=line7_value, x2=bar_index + extendedBars, y2=line7_value, color=bright_green_color, width=line_width)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement