Hopefully an easy for the programmers out there but something I cannot figure out.
I want to be able to manually draw a non-horizontal trend line on a chart and then use the value of that line that corresponds to the current time.
For example, a line is drawn below a typical flag setup and named "MyLine". I want to know the value of the line at the current time so that I can write an EA to sell when the price closes below that value.
Allow the use of cookies to log in to the MQL5.com website.
Please enable the necessary setting in your browser, otherwise you will not be able to log in.
You are signed in. Two-factor authentication has been disabled. Set it up again and scan a new QR code, or continue with two-factor authentication disabled.
Hi all
Hopefully an easy for the programmers out there but something I cannot figure out.
I want to be able to manually draw a non-horizontal trend line on a chart and then use the value of that line that corresponds to the current time.
For example, a line is drawn below a typical flag setup and named "MyLine". I want to know the value of the line at the current time so that I can write an EA to sell when the price closes below that value.
This code returns a 0:
LowerLine = ObjectGet(MyLine, OBJPROP_PRICE);
This code returns the start price of the line:
LowerLine = ObjectGet(MyLine, OBJPROP_PRICE1);
This code returns the end price of the line:
LowerLine = ObjectGet(MyLine, OBJPROP_PRICE2);
How do I return the current price of the line?
Regards,
Krooza