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
Trend line detection: Anyone as done some work on it?
- JoshM
- Posts: 2195
- Joined: 20 May 2011
- Location: The Netherlands
- Has thanked: 1544 times
- Been thanked: 1565 times
- Contact:
Re: Trend line detection: Anyone as done some work on it?
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
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.
- startingPrice = TL_GetValue_s(trendLineID, TL_GetBeginDate(), TL_GetBeginTime_s());
and
endingPrice = TL_GetValue_s(trendLineID, TL_GetEndDate(), TL_GetEndTime_s());
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.
Re: Trend line detection: Anyone as done some work on it?
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.
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.