Can an indicator see a specific H.Line on the window?

 

Hello,

An indicator will draw a H.Line on the window. Can any indicator (same or different) see that H.Line? Is it possible to create some condition like the following?

Eg.  ***if(there is a "dotted red H.Line")  do that;  else do this.....***


Thanks for helps

 
Yedeki Au:

Hello,

An indicator will draw a H.Line on the window. Can any indicator (same or different) see that H.Line? Is it possible to create some condition like the following?

Eg.  ***if(there is a "dotted red H.Line")  do that;  else do this.....***


Thanks for helps


Yes and yes.

 
nicholishen:

Yes and yes.


Thanks for the answer. Is it possible to give some more idea/info about how to?

Thanks again.

 
Yedeki Au:


Thanks for the answer. Is it possible to give some more idea/info about how to?

Thanks again.


   for(int i=0;i<ObjectsTotal();i++)
   {
      string name = ObjectName(0,i);
      if(ObjectType(name) == OBJ_HLINE)
      {
         // do something
      }
   }
https://www.mql5.com/en/docs/objects
Documentation on MQL5: Object Functions
Documentation on MQL5: Object Functions
  • www.mql5.com
Object Functions - Reference on algorithmic/automated trading language for MetaTrader 5
 
nicholishen:

https://www.mql5.com/en/docs/objects


Thank you very much for your helps. It was very useful.

Thanks again

Reason: