I am creating a rectangle with the highest and the lowest price session for the period.
I can easily do it with ihigh and ilow for the Y axis (Vertical)
But how can I set up the value datetime for the X axis (horizontal?)
I have studied the script of the example on how to create the rectangle sadly it does not specify how to use time like 7 to 9 pm broker time (x - axis coordinates).
Any advice on how I do it? thanks.
See the help for the OBJ_RECTANGLE graphic object. Pay special attention to the code that creates the rectangle:
//+------------------------------------------------------------------+ //| Create rectangle by the given coordinates | //+------------------------------------------------------------------+ bool RectangleCreate(const long chart_ID=0, // chart's ID const string name="Rectangle", // rectangle name const int sub_window=0, // subwindow index datetime time1=0, // first point time double price1=0, // first point price datetime time2=0, // second point time double price2=0, // second point price const color clr=clrRed, // rectangle color const ENUM_LINE_STYLE style=STYLE_SOLID, // style of rectangle lines const int width=1, // width of rectangle lines const bool fill=false, // filling rectangle with color const bool back=false, // in the background const bool selection=true, // highlight to move const bool hidden=true, // hidden in the object list const long z_order=0) // priority for mouse click
the variables 'time1' and 'time2' are the time coordinates.
See the help for the OBJ_RECTANGLE graphic object. Pay special attention to the code that creates the rectangle:
the variables 'time1' and 'time2' are the time coordinates.
Read here: https://www.mql5.com/en/docs/basis/types/integer/datetime
For example TimeCurrent - (TimeCurrent() % 86400) will give you 00:00 of the current day.

- www.mql5.com
Maybe you have a sample of how time1 and time2 looks like for time 1 = 7:30 and time2 is 9:00? Sorry i am new to this....
Today like a fan or tomorrow I will make such an indicator. The indicator will set two dates. Between these dates, the indicator will draw a rectangle. The rectangle is drawn by the maximum and minimum between these dates.
version "1.000". I must say right away that this version is not optimal. But it's good for an example.
this similar to mt4? I am using mt4

- Free trading apps
- Over 8,000 signals for copying
- Economic news for exploring financial markets
You agree to website policy and terms of use
I am creating a rectangle with the highest and the lowest price session for the period.
I can easily do it with ihigh and ilow for the Y axis (Vertical)
But how can I set up the value datetime for the X axis (horizontal?)
I have studied the script of the example on how to create the rectangle sadly it does not specify how to use time like 7 to 9 pm broker time (x - axis coordinates).
Any advice on how I do it? thanks.