can draw on the chart window when something happen?

 

hi,

i want to draw lines or arrow on the chart window when something happen. can anyone tell me how to do it or which function? it must be on the chart window not separate window. i know how to create the indication on the separate window.

such as:

int start()
{
//----when something happened, draw on the chart not window not separate window.
if(Close[1]<Close[0])
Blue;
if(Close[1]>Close[0])
Red;

//----
return(0);
}

Thank you so much if help.

 
There are a whole host of Functions to do with drawing objects . . . take a look through them, any questions, ask.
 

dear raptoruk,

thanks for your quickly reply. i have got the method. as new ea maker, i started from half month ago and now can create my own ea and some indicators. all thanks for the help as from you and forum web like here. you're kind man.

regards.

 

ObjectCreate(Time[m],OBJ_RECTANGLE,0,Time[m],highestspot,Time[0],lowestspot);
ObjectSet(Time[m],OBJPROP_COLOR,FireBrick);

ObjectCreate("gallery",OBJ_RECTANGLE,0,Time[m],highestspot,Time[0],lowestspot);
ObjectSet("gallery",OBJPROP_COLOR,FireBrick);

dear raptoruk,

still now, i have another problem. i want to draw them one by one once something happen. however, it seems the name of the object can't be changed. if text such as "gallery", it just draw the first time. if variable such as Time[0], it doesn't work. please help.

 

Why are you trying to change the name ? all your Objects have to have unique names . . . If you want more than one of a type, for example horizontal line, you can just add an index number to the name and increment the index, for example . . . .

string LineName;
static int index = 0;

LineName = SringConcatenate("h_line", index);

//  create line object called LineName

index++;


LineName = SringConcatenate("h_line", index);

//  create line object called LineName
 

thank you for all help. i got it now.

Reason: