Login Page - Create Account

Support Board


Date/Time: Sun, 28 Apr 2024 04:07:48 +0000



Sierra Chart Now Supports Building Custom Chart Bars Efficiently in ACSIL

View Count: 7452

[2017-12-27 23:36:13]
gomifromparis - Posts: 244
It seems
ChartBarInterface.InsertNewRecord = 1;

is missing in the sample.

The chart is starting to add bars, but still some issues.

I see the bars created in IsInsertFileRecordsProcessing being sent once, so they arrive in IsDeterminingIfShouldStartNewBar, and then in IsFinalProcessingAfterNewOrCurrentBar, but then there is a problem, IsFinalProcessingAfterNewOrCurrentBar is sent one more time instead of IsInsertFileRecordsProcessing , so the bar splitting process can't continue.

So if we add no bar, we have

IDISNB
IFPANOCB
IIFRP

IDISNB
IFPANOCB
IIFRP

IDISNB
IFPANOCB
IIFRP

but if we create a new bar in the underlined IIFRP, we get the sequence

IDISNB
IFPANOCB
IIFRP

IDISNB
IFPANOCB
IFPANOCB

IDISNB
IFPANOCB
IIFRP

IDISNB
IFPANOCB
IIFRP

but I think we may be close..
Date Time Of Last Edit: 2017-12-27 23:36:42
[2017-12-30 09:34:41]
gomifromparis - Posts: 244
Any news on this ?
[2017-12-30 09:56:52]
Sierra Chart Engineering - Posts: 104368
No, we have not yet had a chance to test. Should be getting to it in a couple of days.

Whatever you are seeing we are fairly certain this is the correct behavior though. It would have to be. It is not any different than how bars are built within Sierra Chart directly.

But we just want to go through it to make sure.
Sierra Chart Support - Engineering Level

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

For the most reliable, advanced, and zero cost futures order routing, *change* to the Teton service:
Sierra Chart Teton Futures Order Routing
Date Time Of Last Edit: 2017-12-30 09:58:34
[2017-12-30 09:58:51]
Sierra Chart Engineering - Posts: 104368
The prior post has been updated.
Sierra Chart Support - Engineering Level

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

For the most reliable, advanced, and zero cost futures order routing, *change* to the Teton service:
Sierra Chart Teton Futures Order Routing
[2017-12-30 10:41:30]
gomifromparis - Posts: 244
Please do check, you will see it is not giving the expected 10 range chart, I just checked 1678 build.

Custom Range bar : top chart of included pic
Normal working range bar : bottom chart of included pic

Thanks
Date Time Of Last Edit: 2017-12-30 10:42:05
imagesierracustomrange.png / V - Attached On 2017-12-30 10:39:23 UTC - Size: 33.14 KB - 505 views
[2018-01-02 07:53:42]
Sierra Chart Engineering - Posts: 104368
We are looking this over now.

This has already been corrected:
It seems
ChartBarInterface.InsertNewRecord = 1;

is missing in the sample.

Sierra Chart Support - Engineering Level

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

For the most reliable, advanced, and zero cost futures order routing, *change* to the Teton service:
Sierra Chart Teton Futures Order Routing
Date Time Of Last Edit: 2018-01-02 07:54:34
[2018-01-02 08:06:14]
Sierra Chart Engineering - Posts: 104368
We found the problem. We are just finishing with the testing now.

We apologize for the delay. We basically have been working nonstop over the holiday. Just getting to this now though.
Sierra Chart Support - Engineering Level

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

For the most reliable, advanced, and zero cost futures order routing, *change* to the Teton service:
Sierra Chart Teton Futures Order Routing
[2018-01-02 09:04:07]
Sierra Chart Engineering - Posts: 104368
We have released version 1679.

Update to that Prerelease version. This is an additional revision of it.

Keep in mind that the Range bars example is not the same as what is built into Sierra Chart. It is just a simplified example and is not as thorough of an implementation. So the ranges are not always going to match the setting.
Sierra Chart Support - Engineering Level

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

For the most reliable, advanced, and zero cost futures order routing, *change* to the Teton service:
Sierra Chart Teton Futures Order Routing
Date Time Of Last Edit: 2018-01-02 09:05:46
[2018-01-02 10:20:03]
gomifromparis - Posts: 244
OK works now. Thanks
[2018-01-03 20:42:32]
gomifromparis - Posts: 244
I'm doing a couple validation tests on chart replay and I have strange issues, so I tested the Range example and it exhibits the same.
I recorded an example on a 10 Custom Range chart, Fill Gap is set to all.

Market is at 13020
Market ticks from 13020 to 13034. The bar is not split so we get a big 28 tick high bar.
Then a new 13031 tick arrives, and this new tick causes the 13020-13034 bar to be split.

So the splitting arrives one tick late, we should not see a 28 tick bar, it should be split on the fly.
Date Time Of Last Edit: 2018-01-03 20:43:27
attachmentrange.mp4 - Attached On 2018-01-03 20:42:23 UTC - Size: 92.49 KB - 492 views
[2018-01-05 00:24:59]
gomifromparis - Posts: 244
This can actually be observed on a historical chart, all the bars created by a gap tick using ChartBarInterface.InsertNewRecord = 1 have the timestamp of the next tick.
imagegaptimestamp.png / V - Attached On 2018-01-05 00:24:43 UTC - Size: 50.1 KB - 439 views
[2018-01-05 00:30:33]
Sierra Chart Engineering - Posts: 104368
This does make sense. Splitting does not occur until there is a new file record read and there is certainty the existing file record is finalized.

We will see if we can easily improve upon this and split even after a single tick record immediately.
Sierra Chart Support - Engineering Level

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

For the most reliable, advanced, and zero cost futures order routing, *change* to the Teton service:
Sierra Chart Teton Futures Order Routing
[2018-01-05 00:55:34]
gomifromparis - Posts: 244
ok thanks
[2018-04-20 16:21:58]
Andy Sureway - Posts: 93
I am working on a variant of the reversal bar chart, in which the new bar starts at the most recent high/low, instead of at the tick meeting the reversal size.

For example, if the reversal size is 10. The order flow increases from price 950 to 1000 at tick i. And then it decreases continually to 999, 998, ...., and then 990 at tick j. Existing reversal bar chart starts a new bar at tick j. What I want is to start the bar at tick i.

This requires ACSIL programming to go back to the most recent high (low), e.g. tick i, and to modify its status. Do you think this is technically possible?

Thanks a lot!

BTW, Sierra Chart is amazing, and it is the only platform I ever want to use.
[2018-04-20 18:10:53]
Andy Sureway - Posts: 93
I just looked into the technical details.

The first question to me whether this kind of study processes the data tick by tick?

My guess is the statement
sc.UsesCustomChartBarFunction = 1;
changes the behavior into of iterating over ticks instead of the usual behavior of iterating of bars.

And
ChartBarInterface.CurrentBarIndex
is the index of the output bars. I guess there is no tick indexing. So my first thought of rewinding back to the most recent high/low and modifying
ChartBarInterface.StartNewBarFlag = 1
is not possible.

Then the next option is to record all the information after the most recent high (low) up to the current tick. In case of a reversal, do modification of the last generated bar, in term of the date/time, high/low, open/close, volume, ask/bid volume, (ask/bid) volume by price ...

I'd appreciate your input on this approach? Any possible hurdle or inefficiency you can see?

Thanks a lot!
[2018-04-22 23:06:51]
Sierra Chart Engineering - Posts: 104368

We will see if we can easily improve upon this and split even after a single tick record immediately.
The answer to this, is that it was not possible and was going to cause significant complications.


This requires ACSIL programming to go back to the most recent high (low), e.g. tick i, and to modify its status. Do you think this is technically possible?
What do you mean by "status"?




The first question to me whether this kind of study processes the data tick by tick?
Yes.

. In case of a reversal, do modification of the last generated bar, in term of the date/time, high/low, open/close, volume, ask/bid volume, (ask/bid) volume by price ...
We would not recommend modifying the Date-Time. Certainly you can modify these other items except the volume at price data.
Sierra Chart Support - Engineering Level

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

For the most reliable, advanced, and zero cost futures order routing, *change* to the Teton service:
Sierra Chart Teton Futures Order Routing
Date Time Of Last Edit: 2018-04-22 23:07:01
[2018-04-23 00:00:21]
Andy Sureway - Posts: 93
Thanks a lot for your reply. I just abandoned this direction because of the difficulties.
[2018-04-30 22:17:30]
Andy Sureway - Posts: 93
I just come back with another two questions while working on a custom chart bar construction.

How to access the basic data for each tick?

Such as price, volume, bid and ask information?


Is it true that the statement

ChartBarInterface.StartNewBarFlag = 1;

generates a new bar with the Next tick as the first tick data, while the current tick data as the last tick for the current bar?


[2018-05-01 02:33:43]
Andy Sureway - Posts: 93
Here is my guesses:

Method 1
ChartBarInterface.GetChartBarValue(SC_LAST, ChartBarInterface.CurrentBarIndex);
to get the current tick price.

ChartBarInterface.GetChartBarValue(SC_BID_PRICE, ChartBarInterface.CurrentBarIndex);
to get the current tick bid price.

ChartBarInterface.GetChartBarValue(SC_ASK_PRICE, ChartBarInterface.CurrentBarIndex);
to get the current tick ask price.

ChartBarInterface.GetChartBarValue(SC_VOLUME, ChartBarInterface.CurrentBarIndex) - ChartBarInterface.GetChartBarValue(SC_VOLUME, ChartBarInterface.CurrentBarIndex-1);
to get the current tick volume.


Method 2

Another approach I could think about is to write these corresponding fields of SCStudyInterfaceRef from the study function to persistent variables and then in the fp_ACSCustomChartBarFunction function, they are read out from the persistent variables.


Question 2

Please comment and advice on the above two methods! Thanks!


Also please comment whether
ChartBarInterface.StartNewBarFlag = 1;
creates a new bar from the next tick.
Date Time Of Last Edit: 2018-05-01 02:34:10
[2018-05-01 02:41:00]
Sierra Chart Engineering - Posts: 104368

How to access the basic data for each tick?

Such as price, volume, bid and ask information?

You need to use this member structure:
s_CustomChartBarInterface::NewFileRecord;

It has all the data you need. What you describe and post 43 is not the way to do this.

And:
s_CustomChartBarInterface::BidPrice;
s_CustomChartBarInterface::AskPrice;


generates a new bar with the Next tick as the first tick data, while the current tick data as the last tick for the current bar?
No, when setting ChartBarInterface.StartNewBarFlag = 1, the NewFileRecord will become part of the next new bar.
Sierra Chart Support - Engineering Level

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

For the most reliable, advanced, and zero cost futures order routing, *change* to the Teton service:
Sierra Chart Teton Futures Order Routing
Date Time Of Last Edit: 2018-05-01 04:37:54
[2018-05-01 03:58:15]
Andy Sureway - Posts: 93
Thanks!

I just updated to the latest version and see the members you just pointed to. Also I am so impressed by your speed of updating!


Is it possible to consider providing a mechanism to start a new bar at the current tick with the tick being the first of the next bar? I understand as you pointed out a few posters back that going back and modifying the data is very complicated. But in this case, it is just a matter of 1 tick data. Do you think this could be a practical improvement?

Thanks a lot for your great support!

Best,
[2018-05-01 04:14:35]
Sierra Chart Engineering - Posts: 104368
Is it possible to consider providing a mechanism to start a new bar at the current tick with the tick being the first of the next bar?
Actually, this is exactly how it currently works now that we think through this a little more.
Sierra Chart Support - Engineering Level

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

For the most reliable, advanced, and zero cost futures order routing, *change* to the Teton service:
Sierra Chart Teton Futures Order Routing
Date Time Of Last Edit: 2018-05-01 04:14:41
[2018-05-01 04:27:31]
Andy Sureway - Posts: 93
Cool! Thanks a lot!
[2018-05-02 01:20:16]
Andy Sureway - Posts: 93
One strange issue found. After add the custom bar type, Sierra Chart keeps reloading data repeatedly. Do you know what is going on? Is that because there is a possible error in code? Thanks for your input!
[2018-05-02 01:41:04]
Andy Sureway - Posts: 93
Figured it out now. It was caused by the study function and the fp_ACSCustomChartBarFunction function used the same persistent variables.
[2018-05-02 01:47:02]
Andy Sureway - Posts: 93
Well then another issue popped up. Inside the fp_ACSCustomChartBarFunction function, the persistent variables are not initialized.

I am still searching but haven't figured out a way similar to
if (sc.Index == 0)
statement yet.

BTW, I am on version 1738.
Date Time Of Last Edit: 2018-05-02 01:48:01

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

Login

Login Page - Create Account