I want indicator to display buy and sell arrows at high and low point of given period (m15). It seems to work when I use OBJ_HLINE but when I use arrows as graphical it runs with no errors but I get nothing showing up on chart. Sorry if there is a simple explanation - I am very new to coding!
(I tried with arrow_up and arrow_down also)
First problem: you cannot have more than 1 object with the same name.
Your code will try to create "arrowdown" and "arrowup" each tick.
It will probably succeed on the first attempt (but you should check the return value of ObjectCreate to be sure) but then fail from that point onwards.
You probably didn't notice this behaviour with OBJ_HLINE because a horizontal line spans all times.
Second problem: you are drawing your arrows at the start of time (01 January 1970 as far as MQL4 is concerned)
Again, you probably didn't notice this behaviour with OBJ_HLINE because a horizontal line spans all times.
thanks for help knave! few questions tho...
What do you mean the same name, one is titled 'arrowup' and the other 'arrowdown' and the are both different objects...?
Also, how do I make sure it is the latest 15min period only, as OBJ_HLINE uses latest period and I am changing nothing but the object type...?