Why doesn't this EA works ?

 

Hi, i'm a total beginner and i've tried to compile this following EA, but nothing appears on the screen.


#property copyright "Lool"

#property version   "1.00"
#property strict



////+------------------------------------------------------------------+
//| Expert initialization function                                   |
//+------------------------------------------------------------------+
int OnInit()
  {
//---
   
//---
   return(INIT_SUCCEEDED);
  }
//+------------------------------------------------------------------+
//| Expert deinitialization function                                 |
//+------------------------------------------------------------------+
void OnDeinit(const int reason)
  {
//---
   
  }


//+------------------------------------------------------------------+
int start()
  {
    
   datetime jour = D'04.02.2014';
   
   datetime jour2 = D'04.08.2014';
   
   for (int i = jour; i<jour2; i+60)
   {
   ObjectCreate("Lool", OBJ_ARROW_THUMB_UP, 0, i, 1.37);
   
   }
   
  
   
   return 0;
  }
//+------------------------------------------------------------------+
 
Where is the object properties? Get example for objectcreate and adjust/learn from there.
 
Okay i forgot the Objectset function, but still doesn't work...
//+------------------------------------------------------------------+
int start()
  {
    
   datetime jour = D'04.02.2014';
   
   datetime jour2 = D'04.08.2014';
   
   for (int i = jour; i<jour2; i+60)
   {
   ObjectCreate("Lool", OBJ_ARROW_THUMB_UP, 0, i, 1.37);
   ObjectSet("Lool",OBJPROP_STYLE,STYLE_SOLID);
   ObjectSet("Lool", OBJPROP_COLOR,  C'0xFF,0x00,0x00');
   
   }
   
  
   
   return 0;
  }
//+----------------------------------
 

Do you see one object created?

You are trying to create multiple objects with the same name. This cannot be done. The first object may be created, but unless you give subsequent objects a different name, you will get the error that the object has already been created.

 
JohnDoe75:
GumRai: you will get the error that the object has already been created.
And you would have know that had you checked What are Function return values ? How do I use them ? - MQL4 forum