Trend line detection: Anyone as done some work on it?

Questions about MultiCharts and user contributed studies.
arjfca
Posts: 1273
Joined: 23 Nov 2010
Has thanked: 721 times
Been thanked: 222 times

Trend line detection: Anyone as done some work on it?

Postby arjfca » 08 Jun 2012

Hello

Is there a way to detect trend line that had been incorporated on a chart
I'm looking to detect
- Price, time at the start
- Price, Time at the end
- Detect if the bar is extended to the right or left

I think I could do it for an horizontal trend line, but can't figure how it could be done on a trend line with an angle

Any help or hint appreciate

Martin

User avatar
JoshM
Posts: 2084
Joined: 20 May 2011
Location: The Netherlands
Has thanked: 1525 times
Been thanked: 1483 times
Contact:

Re: Trend line detection: Anyone as done some work on it?

Postby JoshM » 09 Jun 2012

Haven't done this myself, but (in theory) you could use TL_GetActive or TL_GetFirst and TL_GetNext to get the trendline ID. Then with the trendline ID known, you could use


to retrieve the beginning and end prices (and you'll also have the beginning and end times then).

You can use TL_GetExtRight and TL_GetExtLeft to determine if the trendline extends left and/or right. As far as I know, this works the same with horizontal trendlines as with sloping trendlines.

Perhaps another user can provide you with a more concrete example. :)
These users thanked the author JoshM for the post (total 2):
TJarjfca

arjfca
Posts: 1273
Joined: 23 Nov 2010
Has thanked: 721 times
Been thanked: 222 times

Re: Trend line detection: Anyone as done some work on it?

Postby arjfca » 09 Jun 2012

Thank you Josh

I was missing the TL_GetFirst & "TL_GetNext"

Martin
"ok, ok, I see..... said the blind man"

bowlesj3
Posts: 2026
Joined: 21 Jul 2007
Has thanked: 174 times
Been thanked: 405 times

Re: Trend line detection: Anyone as done some work on it?

Postby bowlesj3 » 09 Jun 2012

TL_GetFirst and TL_GetNext

For sure these work as I have used them for Arrows (Arw_GetFirst and Arw_GetNext). I think I have also used these for Trend Lines.

TL_GetActive may create a problem. It use to be that this command worked for highlighted text, arrows and text. However it was changed and as of MC 6 Beta-3 (if I remember correctly) if you want to take a shortcut when you know the line will be highlighted you need to use MC_TL_GetActive. I have never used the TL_GetActive that works like in TS. If someone can tell me a good use for it that would be great.
These users thanked the author bowlesj3 for the post:
arjfca


Return to “MultiCharts”