ObjectCreate question

 
Hi,
i want to creat a line in indicator window.
now, in the ObjectCreate funtion i need to add the window index as a parameter. now my quetsion is how to retrive the index for the indicator window ?

thanks,
 
if your indicator is placed in the separate subwindow then you need to find that window with function WindowFind. use as parameter short name of the indicator (for instance "MACD(12,26,9)")
 
Thank you Slawa,
i tried this with

ObjectCreate("Line",OBJ_HLINE,WindowFind("Lirom 2"),Time[4],100);
nothing happend ..
did i meiss somthing ?
 
check expert log for errors. are you sure that subwindow is found? is your indicator "Lirom 2" first in some subwindow? short name "Lirom 2" is to be first in the left top corner of the indicator subwindow.
after object creating and changing You need to call ObjectsRedraw function
press ctrl + B and see objects list
and check your parameters for horizontal line in accordance with coordinate scale of the found subwindow.