Download MetaTrader 5
To add comments, please log in or register
Interested in social trading? Read the article!
Tonny Obare
1026
Tonny Obare 2013.12.12 20:14 
Which is the best way to detect if the price has touched or crossed a trend line
whroeder1
13959
whroeder1 2013.12.12 21:01  
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.
Alain Verleyen
Moderator
29607
Alain Verleyen 2013.12.12 21:18  
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...

Tonny Obare
1026
Tonny Obare 2013.12.13 07:18  
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?

Tonny Obare
1026
Tonny Obare 2013.12.13 07:41  
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.
Tjipke de Vries
6287
Tjipke de Vries 2013.12.13 08:59  
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

Tonny Obare
1026
Tonny Obare 2013.12.13 09:26  
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.
whroeder1
13959
whroeder1 2013.12.13 13:39  
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
Tonny Obare
1026
Tonny Obare 2013.12.15 14:39  
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.
/
To add comments, please log in or register