How to draw Multiple vertical line on chart

 

I am learning mql4 from a while now but don't know how to draw multiple vertical line on chart in EA
I will draw it on Every Order
BTW, I don't take Vertical seriously, i just want to draw something multiple times on chart in EA.
I know how to do it in Indicator but don't know about EA.

Any help will be Really Really Appreciated.

 

I know how to do it in Indicator but don't know about EA.

If you are talking about objects and not buffers, then you draw them exactly the same way in EAs and indicators.

Topics concerning MT4 and MQL4 have their own section.

In future please post in the correct section.

I have moved your topic to the MQL4 and Metatrader 4 section.

 
Kailash Bai Mina: I am learning mql4 from a while now but don't know how to draw multiple vertical line on chart in EA. I will draw it on Every Order. BTW, I don't take Vertical seriously, i just want to draw something multiple times on chart in EA. I know how to do it in Indicator but don't know about EA. Any help will be Really Really Appreciated.

If you are using the function ObjectCreate() to place a vertical line (or any other graphical object) on a chart, then it will work in the same way irrespective of it being an Indicator, EA or a Script. To have multiple graphical objects, just name each one with an unique ID name.

Most of the time, it is also a good practice to delete the graphic objects you created when you exit an Indicator or EA during the OnDeinit() event handling.

ObjectCreate - Object Functions - MQL4 Reference
ObjectCreate - Object Functions - MQL4 Reference
  • docs.mql4.com
ObjectCreate - Object Functions - MQL4 Reference
 
Fernando Carreiro:

If you are using the function ObjectCreate() to place a vertical line (or any other graphical object) on a chart, then it will work in the same way irrespective of it being an Indicator, EA or a Script. To have multiple graphical objects, just name each one with an unique ID name.

Most of the time, it is also a good practice to delete the graphic objects you created when you exit an Indicator or EA during the OnDeinit() event handling.

I  know that
But what to do for Multiple Line 
Now I cannot put 100's of different Name

There must be something like maybe doing something with array 

 
Keith Watford:

If you are talking about objects and not buffers, then you draw them exactly the same way in EAs and indicators.

Topics concerning MT4 and MQL4 have their own section.

In future please post in the correct section.

I have moved your topic to the MQL4 and Metatrader 4 section.

How to go to MQL4 forum
It redirects me here only
and Login also redirects me here

 
Kailash Bai Mina:

How to go to MQL4 forum
It redirects me here only
and Login also redirects me here

There is no MQL4 forum, this is the MQL4 section of the MQL5 forum. I have already moved the topic.

Click on Forum at the top of the page and you will see all the sections.

 
Kailash Bai Mina: I  know that But what to do for Multiple Line Now I cannot put 100's of different Name There must be something like maybe doing something with array 

"MyEA.VLine.1", "MyEA.VLine.2" ... "MyEA.VLine.99", "MyEA.VLine.100". Was that so difficult?

You can use StringFormat() to format the names of the graphical objects based on a unique naming scheme.