Download MetaTrader 5
To add comments, please log in or register
Articles have already helped many traders. Come and read them!
scott
5
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
951
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