Download MetaTrader 5

Understanding ObjectCreate() function.

To add comments, please log in or register
MQL5 Reference is available in 8 languages. Learn MQL5 in the language that suits you best!
scott
12
scott 2016.02.01 19:23 
if(iRSI5 <= 10)
         {
            //Up Arrow;
            bool ObjectCreate(NULL,"Buy Arrow",OBJ_ARROW_BUY,0,Close[1],Low[1]);
         }

I'm having trouble getting this to work. I am very new to programming and would love some guidance in terms of understanding the ObjectCreate() function and its requirements in terms of code. 

 Please don't just link the objectCreate() section of the book ObjectCreate()  as I've read through and I'm still having trouble.

Thank you in advance to all here!  

honest_knave
Moderator
2192
honest_knave 2016.02.01 19:43  

A few things that might help:

Don't declare ObjectCreate as a bool - MQL4 has already defined it as a function returning a bool.

Close is a price, not a time. You'll need to use Time[] instead

if(iRSI5 <= 10)
         {
            //Up Arrow;
            ObjectCreate(0,"Buy Arrow",OBJ_ARROW_BUY,0,Time[0],Low[1]);
         }

 

 Hope that helps

To add comments, please log in or register