common-close-0
BYDFi
Trade wherever you are!
header-more-option
header-global
header-download
header-skin-grey-0

How can I use Pine Script to create horizontal lines on cryptocurrency charts?

avatarMarc MurisonNov 24, 2021 · 3 years ago3 answers

I'm new to Pine Script and I want to know how to create horizontal lines on cryptocurrency charts using Pine Script. Can someone guide me through the process step by step?

How can I use Pine Script to create horizontal lines on cryptocurrency charts?

3 answers

  • avatarNov 24, 2021 · 3 years ago
    Sure! To create horizontal lines on cryptocurrency charts using Pine Script, you can use the `hline` function. Here's an example of how to use it: //@version=4 study(title='Horizontal Lines Example', shorttitle='HL Example', overlay=true) hline(100, color=color.red) This code will create a horizontal line at the price level of 100, displayed in red color. You can adjust the price level and color according to your preference. Hope this helps!
  • avatarNov 24, 2021 · 3 years ago
    Creating horizontal lines on cryptocurrency charts with Pine Script is quite simple. You just need to use the `hline` function and specify the desired price level and color. For example: //@version=4 study(title='Horizontal Lines Example', shorttitle='HL Example', overlay=true) hline(200, color=color.blue) This code will create a horizontal line at the price level of 200, displayed in blue color. Feel free to customize the price level and color to suit your needs. Happy charting!
  • avatarNov 24, 2021 · 3 years ago
    Using Pine Script to create horizontal lines on cryptocurrency charts is a useful feature. You can easily mark important price levels or support/resistance areas. Here's an example code: //@version=4 study(title='Horizontal Lines Example', shorttitle='HL Example', overlay=true) hline(300, color=color.green) This code will create a horizontal line at the price level of 300, displayed in green color. Pine Script offers great flexibility in customizing your charts. Give it a try!