ASE Home Page Products Download Purchase Support About ASE
ChartDirector Support
Forum HomeForum Home   SearchSearch

Message ListMessage List     Post MessagePost Message

  Continuous Trendline across many days only visible during 1 session per day
Posted by Chuck Van Dien on Nov-21-2019 11:22
Peter,

This request may seem odd, but it does have an application/use/value.

I draw Trendlines through many bars on a 1Day chart (could span several weeks) and programmatically move these lines to the 1Hour Chart. Is there a way (without segmenting any continuous line) to have any Trendline only be visible a specific number of hours per day (on the 1Day chart)? I have several specific ranges and not all Trendlines are in every range.

Any suggestions (if this could even be done)?

Thank you,
chuck

  Re: Continuous Trendline across many days only visible during 1 session per day
Posted by Chuck Van Dien on Nov-21-2019 11:26
... I’m sorry... there was a typo...

... is there a way for any Trendline to be visible for only a range of hours per day *ON THE HOUR CHART*

In other words... a Trendline that is drawn for a Month of hours, can it be set to be visible for only a desired number of hours on the HOUR chart and yet still be expressed as a continuous line?

Thank you.
Chuck

  Re: Continuous Trendline across many days only visible during 1 session per day
Posted by Peter Kwan on Nov-21-2019 17:09
Hi Chuck Van Dien,

Yes, ChartDirector can do that. You can use x-zone colors to set the line color to be transparent in some parts of the chart, so the line is visible only on the remaining parts of the chart.

An example that uses x-zone color for a line is at:

https://www.advsofteng.com/doc/cdnet.htm#xzonecolor.htm

Note that the line is blue on the left, and is red-dashed on the right. If you set the right side color to Chart.Transparent, then the line is visible only on the left. You can cascade a second x-zone color to make part of the left side transparent too. It is like:

Dim lineColor As Integer = c.xZoneColor(10, Chart.Transparent, c.xZoneColor(20, &H333399, Chart.Transparent)

If you use the above color as the line color, the line will only appear between x is between 10 and 20.

If your "hourly chart" contains many day, you can cascade the xZoneColor further to make multiple transparent sections on the line. Alternatively, you can just add the same line multiple times, each time using a different xZoneColor so that each line appears on only certain hours of one of the days. Note that the xZoneColor has a cascade limit of around 20 levels deep, so if you have many days, you would need to use the one layer per day method.

For the x-coordinates, from your previous enquiry, you seem to be using a financial chart (something like a candlestick or OHCL chart). For a financial chart, the x-coordinates are not date/time, but are "session numbers", which is programming is just the count of the bar positions 0, 1, 2, 3, 4, .....

Hope this can help.

Regards
Peter Kwan

  Re: Continuous Trendline across many days only visible during 1 session per day
Posted by Chuck Van Dien on Nov-21-2019 23:35
Thank you Peter, this is exactly what I am after (perfect)!
Chuck