I have some questions about "ObjectCreate()"

 

 1. code: ObjectCreate("text_object0", OBJ_TEXT, 2,0,0,0);

when it was executed, it is complainde that "unknown subwindow number 2 for ObjectCreate function". I don';t know how to resolve this problem, and why it is; according to my memory, the max number of subwindows is 8.

2. code: ObjectCreate("text_object", OBJ_TEXT, 0, D'2004.02.20 12:30', 1.0045);

I don't know what is the result of the execution of these code; especially, what is the effect of  "D'2004.02.20 12:30" and "1.0045".

 3. what is the difference between " ObjectCreate("text_object", OBJ_TEXT, 0,0,0)" and " ObjectCreate("text_object",OBJ_LABEL,0,0,0) ".

 
vx0532:

 1. code: ObjectCreate("text_object0", OBJ_TEXT, 2,0,0,0);

when it was executed, it is complainde that "unknown subwindow number 2 for ObjectCreate function". I don';t know how to resolve this problem, and why it is; according to my memory, the max number of subwindows is 8.

2. code: ObjectCreate("text_object", OBJ_TEXT, 0, D'2004.02.20 12:30', 1.0045);

I don't know what is the result of the execution of these code; especially, what is the effect of  "D'2004.02.20 12:30" and "1.0045".

 3. what is the difference between " ObjectCreate("text_object", OBJ_TEXT, 0,0,0)" and " ObjectCreate("text_object",OBJ_LABEL,0,0,0) ".

 

1. does subwindow 2 exist ?  "Notes: The chart sub-windows (if there are sub-windows with indicators in the chart) are numbered starting from 1"

2. the datetime nd price are the coordinates of the possition where the TEXT Object will be placed on the chart.  read the documentation  ObjectCreate()  and Object Properties 

3.  OBJ_TEXT is positioned using a datetime and price,  OBJ_LABEL is positioned using pixel coordinates,  read the documentation   Object types

 
RaptorUK:

1. does subwindow 2 exist ?  "Notes: The chart sub-windows (if there are sub-windows with indicators in the chart) are numbered starting from 1"

2. the datetime nd price are the coordinates of the possition where the TEXT Object will be placed on the chart.  read the documentation  ObjectCreate()  and Object Properties 

3.  OBJ_TEXT is positioned using a datetime and price,  OBJ_LABEL is positioned using pixel coordinates,  read the documentation   Object types

Thank you very much for your reply and I am clear about them except question 1.

1.  I don;t know how I can confirm subwindow 2 exist or not? or I should "declear" some thing for them? if it is,  How?

2. "sub-windows" are numberd starting from 1 " means the default window(main-windows) is numbered as 0, yes? sub-windows are numbered from 1 to 7, yes? then what I should do before I can use subwindows.

Thanks again. 

 
vx0532:

Thank you very much for your reply and I am clear about them except question 1.

1.  I don;t know how I can confirm subwindow 2 exist or not? or I should "declear" some thing for them? if it is,  How?

2. "sub-windows" are numberd starting from 1 " means the default window(main-windows) is numbered as 0, yes? sub-windows are numbered from 1 to 7, yes? then what I should do before I can use subwindows.

Thanks again. 

Are you running an Indicator that uses subwindow 1 and subwindow 2 ?  if not then they will not exist . . . as far as I know.

You can check if a Sub Window is visible using  WindowIsVisible()

2.  yes the main window is window 0 

 
RaptorUK:

Are you running an Indicator that uses subwindow 1 and subwindow 2 ?  if not then they will not exist . . . as far as I know.

You can check if a Sub Window is visible using  WindowIsVisible()

2.  yes the main window is window 0 

 



Ok, I think I know your meaning.

The sub-window N can exist and be available only when create an Indicator in this sub-window, yes?

for example, I create 2 indicators at total, and MQL4 will arrange the first one on window 0 and the next on sub-window 1 for some properties, such as width, color and so on.

yes? 

 
vx0532:



Ok, I think I know your meaning.

The sub-window N can exist and be available only when create an Indicator in this sub-window, yes?

for example, I create 2 indicators at total, and MQL4 will arrange the first one on window 0 and the next on sub-window 1 for some properties, such as width, color and so on.

yes? 

Yes.
 
#property indicator_separate_window          //sub window


//  or   

#property indicator_chart_window              //main chart
 

Hi, I am realy amature in mq4 coding . pleaze help me. I need to an indicator code that draw a rectangle with this parameter:

time1=22:30  , value1=highest price , time2=10:30 , value2= lowest price  . highest and lowest price in the range of the two times mentioned. draw this rectangle for every single day  frome past to now . I need it for backtest . I appreciate if  you could  help me.

Reason: