Can an EA draw lines on a chart?

 

Does anyone know how I can code an EA to draw lines on a chart?

Thank you!

 
Use ObjectCreate and OBJ_HLINE or OBJ_VLINE as the object type. They can be used by anything be it a script, EA or indicator.
 
WhooDoo22:

Does anyone know how I can code an EA to draw lines on a chart?

Thank you!


I am thinking along the lines of some code like this...

if ( "put my parameters" ) {

  {
     draw line code
  }}

 
     // idk, something simple :)
     // Thank you!
Thank you!
 
heelflip43:
Use ObjectCreate and OBJ_HLINE or OBJ_VLINE as the object type. They can be used by anything be it a script, EA or indicator.

I will give it a shot!

I am researching the "object" documentation now!

Thank you for your post!
 
WhooDoo22:

I will give it a shot!

I am researching the "object" documentation now!

Thank you for your post!
If anyone else would like to check it out, i will place it here for you!


https://docs.mql4.com/objects


Thank you!

 
heelflip43:
Use ObjectCreate and OBJ_HLINE or OBJ_VLINE as the object type. They can be used by anything be it a script, EA or indicator.

Look what you helped me create heelflip43!

I have attached an EA that will draw a line on a chart!

Thank you!

Files:
 
Indicator type lines - my code - polyline
Reason: