Login Page - Create Account

Support Board


Date/Time: Wed, 26 Jun 2019 21:16:42 +0000



Help needed on Custom Chart Bars

Support Request:
[2019-01-10 20:50:39]
Andy Sureway - Posts: 93
Hi Sierra Chart team,

I am developing a custom chart bars study which takes account of both volume size and time.

Here is a particular scenario which I am struggling with. Say the last tick data has time stamp at 12 pm, and the next tick data is at 12:03 pm. And I want to add a series of empty bars at 1 minute interval, e.g. 12:01 and 12:02.

For the algorithm part, suppose the study is processing the tick data at 12:03 pm. At the first iteration of the IsDeterminingIfShouldStartNewBar loop, the study determines to start a new bar. Then at the next iteration of the IsFinalProcessingAfterNewOrCurrentBar loop, it creates a new bar including the 12:03 pm tick data. The issue here is, it does not give me any chance to add the empty bars before the 12:03 tick data.

At first thought, I felt the IsInsertFileRecordsProcessing loop provides this opportunity of adding empty bars. However, later through a series of debugging processes, I realized that by the time of this loop, the 12:03 tick data has already formed the next bar.

Could you please guide me on how possibly the empty bars can be added?


An additional observation is, inside the IsInsertFileRecordsProcessing loop, NewFileRecord is reset to zero. I feel that retainment of its value in this loop could be quite useful for many applications.

Thanks!
Date Time Of Last Edit: 2019-01-10 20:52:07
[2019-01-11 22:26:08]
Sierra Chart Engineering - Posts: 73217
What you need to do is in effect shift forward the data for the 12:03 bar by changing the dates of the inserted bars using the s_CustomChartBarInterface ::GetChartBarDateTime() function. Refer to the documentation for this function here:
https://www.sierrachart.com/index.php?page=doc/ACSIL_CustomChartBars.html

But just not totally sure whether altering the Date-Times would be a problem. Try it and see.

. I feel that retainment of its value in this loop could be quite useful for many applications.
You can remember this. And the chart bar data is directly accessible with the s_CustomChartBarInterface::GetChartBarValue function.
Sierra Chart Support - Engineering Level

Your definitive source for support. Other responses are from users. If possible please keep your questions brief and to the point. Please be aware of support policy:
https://www.sierrachart.com/index.php?l=PostingInformation.php#GeneralInformation

If your question/request has been answered and you do not have anything further, then it is easiest for us if you do not reply again to say thank you.
Date Time Of Last Edit: 2019-01-11 22:27:31
[2019-01-12 01:35:01]
Andy Sureway - Posts: 93
Thanks you very much for your inputs! Do you mean just modify the time of the 12:03 bar to 12:01 and make the volume fields to zero? I thought some other SC staff is strongly against this practice.

Can I ask whether the two variables NewFileRecord (even though it is an input variable) and NewRecordToInsert are free to modify? If so, then I have a solution to it by first copying NewFileRecord into NewRecordToInsert, and then setting NewRecordToInsert the empty tick at 12:01. And keeping repeating this will give an answer.


You can remember this. And the chart bar data is directly accessible with the s_CustomChartBarInterface::GetChartBarValue function.

Comparing NewFileRecord to the information obtained by s_CustomChartBarInterface::GetChartBarValue, the volume information (volume, bid volume, ask volume) can not be recovered by the latter.

Thanks!
[2019-01-12 01:40:37]
Andy Sureway - Posts: 93
BTW, I just found out "unsigned char IsNewFileRecord" is mentioned in the latest version of https://www.sierrachart.com/index.php?page=doc/ACSIL_CustomChartBars.html.

I am very much curious about this variable. How it can be used?

Thanks!

To post a message in this thread, you need to login with your Sierra Chart account:

Login

Login Page - Create Account