Trouble drawing horizontal lines in indicator

 

Hey,

 I am trying to draw horizontal lines in an indicator. Attached is a simple example program of how I am trying to do that. Basically, I am calling "ObjectCreate(chartId, "line", OBJ_HLINE, 0,0,price[n]) to create a horizontal line. But when testing the indicator, I do not see any lines.

 Any hint why?

 

Thanks!

Nathan 

Documentation on MQL5: Standard Constants, Enumerations and Structures / Objects Constants / Object Types
Documentation on MQL5: Standard Constants, Enumerations and Structures / Objects Constants / Object Types
  • www.mql5.com
Standard Constants, Enumerations and Structures / Objects Constants / Object Types - Documentation on MQL5
Files:
 

Do you know that price[i], for i=0 to 5, are price from the past ? In mql5, by default, timeseries are indexed from past (0) to present (rates_total-1).

Your lines are drawn, but you don't see it.

 
Yes, thank you very much.
Reason: