|
financial charts: How to make custom timeStamps AND correct intraday labels |
Posted by albruno on Jun-18-2009 23:30 |
|
Financial charts use the seconds timeStamps
python
conversion of my date time is done in this fashion and appears to be good
chartTime(yy,mm,dd,hh,mn,00)
for my needs
I am only plotting 180 bars/points per chart
as well plotting intraday i.e. 15, 30, 60 minutes
daily weekly and monthly bars or points
thus the displayed time should be a static segment of values... range wise
though i have no problem with plotting data....
Day, Week, Monthly the labels are perfect
Two requests:
1. 60 min i would like to add another label between dates i.e. 1200
or can I just build labels on my own like the other chart methods?
2. Intraday for 30 min and 15 min are converting to 60 min
timeStamps and data with 24 segments between date labels
whereas 30 min should be-- 48 bars and 15 min --96 points or bars between dates
It is rolling-up the smaller data to make 60 minute charts...
I am sure that i am missing the concept...here
Want to take advantage of this feature by controlling it.
If so, How do I manage this?
I would like to hard-code the fix as opposed to dynamic > or < ever changing start-end
date values
thanks in advance to any pointers! |
Re: financial charts: How to make custom timeStamps AND correct intraday labels |
Posted by Peter Kwan on Jun-19-2009 02:22 |
|
Hi albruno,
Since you mentioned "30 min should be 48 bars", I assume the market in your case is 24 hours non-stop (not a stock chart - may be a forex chart).
Currently, I think ChartDirector should automatically insert a label at the first session of each day. Is it not the case?
You mention you want to "add another label between dates". I am not sure exactly what is "between dates" mean. Do you mean the first session of each day, which is at 00:00 if it is a 24 hour chart? If this is the case, I think ChartDirector should already added such a label. If you want to configure the label format, you may use FinanceChart.setDateLabelFormat.
If ChartDirector does not automatically add such a label, would you mind to attach the chart you get so far?
If you are using 30 min data (each value in your timeStamps are 30 minutes or 15 minutes apart), the chart should be a 30 min chart, with 48 bars per day (assuming a 24 hour day).
Note that the labels on the x-axis are not related to whether you are plotting a 30 min or 60 min chart. They are determined by your chart size and date range. If you have a small size chart, ChartDirector will put less labels on the axis, and vice versa. It is configurable by using FinanceChart.setDateLabelSpacing. No matter how many labels are on the x-axis, the chart content should always show 48 bars per day for a 30 min chart on a 24-hour day.
Again, if the above is not the case, would you mind to attach the chart you get so far?
Regards
Peter Kwan |
Re: financial charts: How to make custom timeStamps AND correct intraday labels |
Posted by albruno on Jun-19-2009 03:13 |
|
i am laughing because now at least i have the correct bars...
but am not sure what i changed.
if chartdirector cannot natively roll or combine
EX: 15min data into 60 min data
then it was my error between loading data and descriptions.
~~~~~~
Labels
However ,I would still like to adust the labels
The 15 min chart is perfect! -- ignore my text chart comment.
How can i add the same type labels or intraday labels every ---6 hours for 30 min
sample of what i mean attached
for 60 every ---12 hours a time label
...I will try below thanks
Peter Kwan wrote:
edited
You mention you want to "add another label between dates".
If you want to configure the label format, you may use FinanceChart.setDateLabelFormat.
They are determined by your chart size and date range.
It is configurable by using FinanceChart.setDateLabelSpacing.
|
Re: financial charts: How to make custom timeStamps AND correct intraday labels |
Posted by Peter Kwan on Jun-19-2009 19:09 |
|
Hi albruno,
You may try to use FinanceChart.setDateLabelSpacing to control the label density for auto-labelling. I think if you use a small label spacing, ChartDirector may eventually put hourly labels on the chart.
If you would like to control the labelling yourself, you can also use Axis.setLabels on the first chart in your FinanceChart. For example, assuming your main price chart is the first chart in your FinanceChart, the code is like:
myFinanceChart.setData(.......)
mainPriceChart = myFinanceChart.addMainChart(......)
mainPriceChart.xAxis().setLabels(myLabels)
Hope this can help.
Regards
Peter Kwan |
Re: financial charts: How to make custom timeStamps AND correct intraday labels |
Posted by albruno on Jun-19-2009 19:42 |
|
Thank you!
up to the financial charts i was making my own labels with no problem
but i see the wisdom in the converting to seconds logic
so i converted my code too...
in an effort to make my studies or indicators generic with lableling..
i want keep the second timestamp
it appears also ... that the canned studies that you provide need the
seconds timestamp to produce labels.
i am reading (your words)
that i can do this with the current timestamp (in seconds) method ??
Peter Kwan wrote:
Hi albruno,
You may try to use FinanceChart.setDateLabelSpacing to control the label density for auto-labelling. I think if you use a small label spacing, ChartDirector may eventually put hourly labels on the chart.
If you would like to control the labelling yourself, you can also use Axis.setLabels on the first chart in your FinanceChart. For example, assuming your main price chart is the first chart in your FinanceChart, the code is like:
myFinanceChart.setData(.......)
mainPriceChart = myFinanceChart.addMainChart(......)
mainPriceChart.xAxis().setLabels(myLabels)
Hope this can help.
Regards
Peter Kwan
|
Re: financial charts: How to make custom timeStamps AND correct intraday labels |
Posted by Peter Kwan on Jun-19-2009 23:20 |
|
Hi albruno,
In a standard financial chart, the x-axis represent trading session, not date/time. The date/time values are for human reading only and has no other purpose. These values are not needed to plot anything in the chart, other than to label the x-axis. (You can treat the timeStamps as "names".) If you look at the definitions of the technical indicators, none of them use any date/time values.
If you pass the timeStamps to ChartDirector, ChartDirector will use a subset of them to label the axis. If you want to label the axis yourself, you can use Axis.setLabels. You can also do both - pass the timeStamps to ChartDirector and use Axis.setLabels.
Hope this can help.
Regards
Peter Kwan |
Re: financial charts: How to make custom timeStamps AND correct intraday labels |
Posted by albruno on Jun-19-2009 23:24 |
|
thank you for your help! |
Re: financial charts: How to make custom timeStamps AND correct intraday labels |
Posted by john on Jul-06-2013 13:58 |
|
hi,
i want to change timestamps in financechart.it default displays jan2013 &time in x axis.i
wish to display only dates(like july1,july2 .....)in x axis.plz help me.
albruno wrote:
thank you for your help!
|
Re: financial charts: How to make custom timeStamps AND correct intraday labels |
Posted by Peter Kwan on Jul-09-2013 03:46 |
|
Hi John,
The label format can be configured FinanceChart.setDateLabelFormat. For example, you can set the argument for "firstHourFormat" to {value|d mmm}. In this way, the first label for a day will show the date only, not the time. And you may set "otherHourFormat" to "-", which remove other intraday labels.
Hope this can help.
Regards
Peter Kwan |
|