Download MetaTrader 5
To add comments, please log in or register
Find out how social trading can improve your profits
John
9
John 2014.04.21 10:31 

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;
  }
//+------------------------------------------------------------------+
SYED NAUFAL GADDAFI
1401
SYED NAUFAL GADDAFI 2014.04.21 10:38  
Where is the object properties? Get example for objectcreate and adjust/learn from there.
John
9
John 2014.04.21 11:32  
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;
  }
//+----------------------------------
Keith Watford
Moderator
7990
Keith Watford 2014.04.21 11:45  

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.

whroeder1
13644
whroeder1 2014.04.21 12:49  
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
/
To add comments, please log in or register