Download MetaTrader 5

Extend Rectangle with Time Length

To add comments, please log in or register

Hello, i'm new here and still trying to learn mql4 coding.

Currently need help in drawing this rectangle.

The problem is how can i measure the Length B to get the date at point 3 which it extends 10 times from the Length A ?

Any help will be great appreciated. Thanks

double price1=ObjectGet("Trendline",OBJPROP_PRICE1);
double price2=ObjectGet("Trendline",OBJPROP_PRICE2);
double time1=ObjectGet("Trendline",OBJPROP_TIME1);
double time2=ObjectGet("Trendline",OBJPROP_TIME2);

double time3=(Length A*10) //Not sure how to calculate this. (time1 + time2) does not work. Please help 

ObjectCreate("Box", OBJ_RECTANGLE, 0, time1, price1, time3, price2); //I want the rectangle to extend until point 3 based on (length A*10)
ObjectSet("Box", OBJPROP_COLOR, BoxColor);
ObjectSet("Box", OBJPROP_BACK, FillColor);
To add comments, please log in or register