Condition to match ObjectType of OBJ_HLINE not evaluating ot ture

 

This code is evaluates to true if there is a trend line but not with horizontal line which is what I want as well.

How can it be fixed to allow both?  Thanks


void OnTick()
  {
   int obj_total=ObjectsTotal();
   for(int i=0;i<obj_total;i++)
     {
      string name=ObjectName(i);     
      if((ObjectType(name)==OBJ_TREND || ObjectType(name)==OBJ_HLINE) && StringSubstr(name, 0, 2) == "ea")
 
Can't be fixed because it's not broken. Use the debugger or print out your variables, and find out why.
Reason: