How to draw horizontal line on each bar?

 
Hello dear friends and traders. I recently started learning the MQL programming language and therefore wanted to ask how to draw a horizontal line on each candle in certain time frames (for example, annual, semi-annual, monthly and weekly) in open, close and min.max prices. This needs to be done better by downloading the entire history of a particular trading pair. And what is better to do this on an advisor, on an indicator or on a script? Maybe someone already has experience, tell me the right way to implement such an idea, please. Thank you for your attention.
 
o.mansurov:
Hello dear friends and traders. I recently started learning the MQL programming language and therefore wanted to ask how to draw a horizontal line on each candle in certain time frames (for example, annual, semi-annual, monthly and weekly) in open, close and min.max prices. This needs to be done better by downloading the entire history of a particular trading pair. And what is better to do this on an advisor, on an indicator or on a script? Maybe someone already has experience, tell me the right way to implement such an idea, please. Thank you for your attention.
Most programmers use line objects.  
Personally, I prefer canvas.  Less code, more features, better performance.

https://www.mql5.com/en/forum/459746/page2#comment_51489780
 
o.mansurov:
Hello dear friends and traders. I recently started learning the MQL programming language and therefore wanted to ask how to draw a horizontal line on each candle in certain time frames (for example, annual, semi-annual, monthly and weekly) in open, close and min.max prices. This needs to be done better by downloading the entire history of a particular trading pair. And what is better to do this on an advisor, on an indicator or on a script? Maybe someone already has experience, tell me the right way to implement such an idea, please. Thank you for your attention.

You can use Objects but keep in mind drawing too much objects may slow down performance of your indicator. You should consider drawing with buffers if you want to draw resource friendly lines. I have no idea about performance of canvas with 1000+ objects

 
Arpit T #:

I have no idea about performance of canvas with 1000+ objects

Of course, canvas is traditionally (including in Web development (JS)) a technology with maximum performance, since canvas is one object(It's just an array of pixels ).  Canvas works fine with more than 10,000 objects.  And if you use OpenCl for the canvas, it works without lags and with more than 100,000 objects.
Try doing something like this on objects: