check object color with if loop - possible?

 

Hi, i have the following code and was wondering if this is the right way to check the colors, since i couldn't find something similar:

color result1=ObjectGet("rule1", OBJPROP_COLOR);
   color result2=ObjectGet("rule2", OBJPROP_COLOR);
   color result3=ObjectGet("rule3", OBJPROP_COLOR);
   if (result1==Orange&&result2==Lime&&result3==Lime&&usealert==true) 
   {
    if (TimeCurrent() > allowAlert){ allowAlert=TimeCurrent()+ 240*60; Alert("BUY Alert! Place BUY stop orders for "+Symbol());}
   }
   if (result1==Orange&&result2==Red&&result3==Red&&usealert==true) 
   {
    if (TimeCurrent() > allowAlert){ allowAlert=TimeCurrent()+ 240*60; Alert("SELL Alert! Place SELL stop orders for "+Symbol());}
   }

Would this code work, or do i have to check on a different way? And the TimeCurrent()+240*60 is for 1 alert in 4 hours right? Can anyone confirm this ?

Reason: