Dont understand why ObjectCreate is created only once?

 

Im trying to get the object OBJ_ARROW_THUMB_UP to appear every time the if condition is true when i test over a few days. Code as follows :

input int MaPeriod = 200;
input ENUM_MA_METHOD MaMethod = MODE_EMA;   
input ENUM_APPLIED_PRICE MaPrice = PRICE_CLOSE;

// OnTick() event handler                
void OnTick()    
{
   double close = Close[1];  
   datetime time = iTime(NULL,0,1);  
   double ma = iMA(_Symbol,_Period,MaPeriod,0,MaMethod,MaPrice,1);    

   // Buy order condition  
   if(close > ma) 
   {                             
      ObjectCreate("Buy",OBJ_ARROW_THUMB_UP,0,time,close);               
   }

   // Sell order condition
   if(close < ma)
   {
      ObjectCreate("Sell",OBJ_ARROW_THUMB_DOWN,0,time,close);
   }
} 

Im using OnTick() event handler as far as i understand this should count every tick that happens. But why does it only displays the object once on each if condition. It doesnt create the object if the condition appears again?

 
You have to specify the Object you are trying to create, if you are trying to create multiple Objects, they have to have different names.  You can have multiple Objects of the same type, just not the same names.
 
Do you think your parents could create two renzbub? You created it, with a specific name. You can't create another with the same name.
 
WHRoeder:
Do you think your parents could create two renzbub? You created it, with a specific name. You can't create another with the same name.
LOL