Object_create help

 

Im trying to figure out how to make my EA draw horizontal support, resistance and diagonal trend lines and move them as it goes to reflect current data.

Ive been reading the MQL reference documentation but im still confused on their exact implementation and use.


The intent is to produce real time visual chart analysis using support, resistance and trend.

If someone can feed me some workable examples of Object_Create, Objectmove and any other commands I might need it would be much appreciated.

 

For horizontal trends, use this in your start function to draw and update the lines. Make sure you update the SupportValue and ResistanceValue variables before calling it.


void Draw()

{

name_8="Support";
ObjectCreate(name_8,OBJ_HLINE,0,D'2000.11.01 10:30',SupportValue);
ObjectSet(name_8,OBJPROP_COLOR,Yellow);



name_8="Resistance";
ObjectCreate(name_8,OBJ_HLINE,0,D'2000.11.01 10:30',ResistanceValue);
ObjectSet(name_8,OBJPROP_COLOR,Yellow);

}
 
Very many thanks to you
 

Indeed, thanks for the response.

Does it matter what date and time I use for it ?

 
Cranium:

Indeed, thanks for the response.

Does it matter what date and time I use for it ?


a horizontal line goes from the begin of history data til the end of history data ...

at a given price - so it doesnt matter what time....

a vertical line goes from zero price til oo-price

at a given time - so it doesnt matter which price ...

reading the doc is always a very good advise