How to set the 2nd point of OBJ_TRENDBYANGLE just by angle and its price?

 

I want to draw an OBJ_TRENDBYANGLE trend line.

My goal is to draw a slanted short line starting from point 1 (no problem here) and end to the price X (a lower price) by -45 degree.


and the mode OBJPROP_RAY_RIGHT is set as false.


the problem is, It seems in short line ( not the ray mode), it doesn't accept the 2nd price and works with 2nd time.

there is a complete script here but actually I couldn't find the answer there.


How to set the end point of a trend line just by angle and its price?


Thanks


Edited:

The reason why I need this is, I have some rectangles on the chart which show me some zones. I need to fill some of them with slanted lines like this:


This one is drew manually but I did the same in the codes using OBJ_TREND, the problem is if I use OBJ_TREND they change by scale changes, and getting close to vertical or horizontal lines and that's not good because I fill other rectangles with vertical and horizontal lines.

Then I need to use the angle of 45 (-45). 

** Can I use the pixels for OBJ_TREND ?


If you have any other suggestion, please let me know.

Thanks

OBJ_TRENDBYANGLE - Object Types - Objects Constants - Constants, Enumerations and Structures - MQL4 Reference
OBJ_TRENDBYANGLE - Object Types - Objects Constants - Constants, Enumerations and Structures - MQL4 Reference
  • docs.mql4.com
The following script creates and moves the trend line on the chart. Special functions have been developed to create and change graphical object's properties. You can use these functions "as is" in your own applications. //| Create a trend line by angle                                     |               time=0,            ...
 

Well, after passing 4 days nobody replied to my question.

Then I'm asking the same question in other words.

Hopefully somebody help me to find the answer.


How to draw a slanted line with specific angle (45 or -45) starting from point A (time of Bar_A, price A) to point B (Just specific price).

OBJ_TREND:

Doesn't accept the angle

Doesn't accept the starting or ending point between two bars


OBJ_TRENDBYANGLE:

Does accept the angle

Doesn't accept the starting or ending point between two bars, this make my line shorter or longer than what I need. I want to end my line somewhere between to bars, where the line hits some price.


I appreciate any help

Thanks


 
Reza nasimi:
...

OBJ_TRENDBYANGLE:

Does accept the angle

Doesn't accept the starting or ending point between two bars, this make my line shorter or longer than what I need. I want to end my line somewhere between to bars, where the line hits some price.


You can't. MT4 doesn't allow that.

 
Alain Verleyen:

You can't. MT4 doesn't allow that.

Thank you  Alain Verleyen 

Reason: