Skip to content

Instantly share code, notes, and snippets.

@iCodeForBananas
Created December 17, 2022 18:15
Show Gist options
  • Select an option

  • Save iCodeForBananas/b5bfbd0c434285446b36aebcd10818b9 to your computer and use it in GitHub Desktop.

Select an option

Save iCodeForBananas/b5bfbd0c434285446b36aebcd10818b9 to your computer and use it in GitHub Desktop.
horizontal lines on trading view
//@version=5
indicator("Horizontal Lines", overlay=true)
lineColor = input(title="Line color", defval = color.new(color.blue, 50))
selectedprice = input.float(title="Starting price", defval=4000)
lineInterval = input(title="Line interval", defval=5)
for i = 0 to 25
line.new(bar_index, selectedprice+(lineInterval*i), bar_index-1, selectedprice+(lineInterval*i), extend=extend.both, color=lineColor, style=line.style_solid, width=1)
line.new(bar_index, selectedprice-(lineInterval*i), bar_index-1, selectedprice-(lineInterval*i), extend=extend.both, color=lineColor, style=line.style_solid, width=1)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment