Which is the best way to detect if the price has touched a trend line?

 
How do you think? For position=trendline start to threadline end (iBarShift) get trendline position (ObjectGetValueByShift) touched = H >= positiion & positiion >= L. learn to code it, or pay someone. We're not going to code it FOR you. We are willing to HELP you when you post your attempt (using SRC) and the nature of your problem.
 
tonny:
Which is the best way to detect if the price has touched or crossed a trend line

if(previous_price<previous_trendline_value and price>=trendline_value

or

previous_price>previous_trendline_value and price<=trendline_value)

then

you have a touch or a cross

Previous can be previous tick, previous bar's high/low...

 
WHRoeder:
How do you think? For position=trendline start to threadline end (iBarShift) get trendline position (ObjectGetValueByShift) touched = H >= positiion & positiion >= L. learn to code it, or pay someone. We're not going to code it FOR you. We are willing to HELP you when you post your attempt (using SRC) and the nature of your problem.


angevoyageur:

if(previous_price<previous_trendline_value and price>=trendline_value

or

previous_price>previous_trendline_value and price<=trendline_value)

then

you have a touch or a cross

Previous can be previous tick, previous bar's high/low...


Thanks angevoyageur that i know. Its the part for getting trendline_value for the bars that is a challenge like if it were low price we just use Low[...] or iLow(...). Is there such a function for trendline or maybe can it be drawn using a buffer?

 
Ive found this. https://docs.mql4.com/objects/objectgetvaluebyshift . I think its a possible solution. Thanks WHroeder for that bit but don't be rude to forum users im a coder too but its long since i read book and iv'e never done trendline before.
 
tonny:
Ive found this. https://docs.mql4.com/objects/objectgetvaluebyshift . I think its a possible solution. Thanks WHroeder for that bit but don't be rude to forum users im a coder too but its long since i read book and iv'e never done trendline before.

bravo, ....
WHRoeder:
How do you think? For position=trendline start to threadline end (iBarShift) get trendline position (ObjectGetValueByShift) touched = H >= positiion & positiion >= L. learn to code it, or pay someone. We're not going to code it FOR you. We are willing to HELP you when you post your attempt (using SRC) and the nature of your problem.

that was big help it isn't rude to say this, you didn't show any attempt how you tried

also angevoyageur has given a correct answer to your question

you had to ask also for how do i get trendline value you didn't and WHRoeder did already

 
deVries:

bravo, ....

that was big help it isn't rude to say this, you didn't show any attempt how you tried

also angevoyageur has given a correct answer to your question

you had to ask also for how do i get trendline value you didn't and WHRoeder did already

I didnt post code because its only the trendline value that was challenging so it wasnt necessary to post the entire code as i know how to work with it after i extract it thanks all for helping.
 
tonny:
WHRoeder:
How do you think? For position=trendline start to threadline end (iBarShift) get trendline position (ObjectGetValueByShift) touched = H >= positiion & positiion >= L. learn to code it, or pay someone. We're not going to code it FOR you. We are willing to HELP you when you post your attempt (using SRC) and the nature of your problem.
Thanks angevoyageur that i know. Its the part for getting trendline_value for the bars that is a challenge like if it were low price we just use Low[...] or iLow(...). Is there such a function for trendline or maybe can it be drawn using a buffer?
It's to bad you are hard of reading. And for someone that has been on this site for THREE years you really do need to RTFM
 
WHRoeder:
It's to bad you are hard of reading. And for someone that has been on this site for THREE years you really do need to RTFM
This topic is over.
Reason: