Login Page - Create Account

Support Board


Date/Time: Sat, 04 May 2024 02:49:40 +0000



issue with reloading chart and array size

View Count: 795

[2016-06-08 23:57:27]
onnb - Posts: 661
1. I am seeing this message in the log -

Opened cached Intraday file: D:\SierraChart\Data\EURUSD.scid | 2016-06-08 19:53:29

What does that message mean?

The reason I am asking is that I am troubleshooting an issue in a study. Whenever the issue happens, the above line appears in the log. Might be completely unrelated but thought it might also give clue.

2. Is it possible that sc.ArraySize gets updated while study function is processing? In other words, study function starts out with sc.ArraySize == 100 and while its still working, before returning, sc.ArraySize changes to 101?
Date Time Of Last Edit: 2016-06-09 00:13:42
[2016-06-09 01:38:19]
Sierra Chart Engineering - Posts: 104368
1. In newer versions of Sierra Chart the writing of Intraday data and the opening of Intraday data files is done on a background thread of execution. The writing is done periodically. Every 30 seconds.

The file is opened only until it needs to be. This is why you see that line.

2. The answer to this is no. The above has no effect on this at all.
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
[2016-06-09 01:38:26]
onnb - Posts: 661
I've been troubleshooting some more and am seeing something strange. Maybe you can shed some light on this?

There are many chart reloads below because that is me trying to reproduce the issue. It reproduces when I hit reload and recalculate while connected to the data feed.

In the log below, I print a bunch of stuff but what to focus on is the arraySize. That is printing sc.ArraySize
I've made in bold three prints. Notice that the array size starts at 10461, then it shrinks to 10460 and then jumps to 10462.

Last note is that this is a 15 second chart. You will see that log below and my description is around the area where a new bar forms. This seems to be consistent in that I am able to reproduce when a new bar forms.

Any thoughts on this?



Chart: EURUSD [M] 15 Sec #1 | Study: Box | index 10459, barClosed true arraySize 10461 nextIndex 10459 | 2016-06-08 21:20:43
Chart: EURUSD [M] 15 Sec #1 | Study: Box | index 10460, barClosed false arraySize 10461 nextIndex 10460 | 2016-06-08 21:20:43
EURUSD [M] 15 Sec #1 | Reloading chart. | 2016-06-08 21:20:43
Chart: EURUSD [M] 15 Sec #1 | Study: Box | index 10455, barClosed true arraySize 10460 nextIndex 10455 | 2016-06-08 21:20:44
Chart: EURUSD [M] 15 Sec #1 | Study: Box | index 10456, barClosed true arraySize 10460 nextIndex 10456 | 2016-06-08 21:20:44
Chart: EURUSD [M] 15 Sec #1 | Study: Box | index 10457, barClosed true arraySize 10460 nextIndex 10457 | 2016-06-08 21:20:44
Chart: EURUSD [M] 15 Sec #1 | Study: Box | index 10458, barClosed true arraySize 10460 nextIndex 10458 | 2016-06-08 21:20:44
Chart: EURUSD [M] 15 Sec #1 | Study: Box | index 10459, barClosed false arraySize 10460 nextIndex 10459 | 2016-06-08 21:20:44
EURUSD [M] 15 Sec #1 | Reloading chart. | 2016-06-08 21:20:44
Chart: EURUSD [M] 15 Sec #1 | Study: Box | index 10455, barClosed true arraySize 10460 nextIndex 10455 | 2016-06-08 21:20:45
Chart: EURUSD [M] 15 Sec #1 | Study: Box | index 10456, barClosed true arraySize 10460 nextIndex 10456 | 2016-06-08 21:20:45
Chart: EURUSD [M] 15 Sec #1 | Study: Box | index 10457, barClosed true arraySize 10460 nextIndex 10457 | 2016-06-08 21:20:45
Chart: EURUSD [M] 15 Sec #1 | Study: Box | index 10458, barClosed true arraySize 10460 nextIndex 10458 | 2016-06-08 21:20:45
Chart: EURUSD [M] 15 Sec #1 | Study: Box | index 10459, barClosed false arraySize 10460 nextIndex 10459 | 2016-06-08 21:20:45
EURUSD [M] 15 Sec #1 | Reloading chart. | 2016-06-08 21:20:45
Chart: EURUSD [M] 15 Sec #1 | Study: Box | index 10455, barClosed true arraySize 10460 nextIndex 10455 | 2016-06-08 21:20:46
Chart: EURUSD [M] 15 Sec #1 | Study: Box | index 10456, barClosed true arraySize 10460 nextIndex 10456 | 2016-06-08 21:20:46
Chart: EURUSD [M] 15 Sec #1 | Study: Box | index 10457, barClosed true arraySize 10460 nextIndex 10457 | 2016-06-08 21:20:46
Chart: EURUSD [M] 15 Sec #1 | Study: Box | index 10458, barClosed true arraySize 10460 nextIndex 10458 | 2016-06-08 21:20:46
Chart: EURUSD [M] 15 Sec #1 | Study: Box | index 10459, barClosed false arraySize 10460 nextIndex 10459 | 2016-06-08 21:20:46
EURUSD [M] 15 Sec #1 | Reloading chart. | 2016-06-08 21:20:46
Chart: EURUSD [M] 15 Sec #1 | Study: Box | index 10455, barClosed true arraySize 10460 nextIndex 10455 | 2016-06-08 21:20:47
Chart: EURUSD [M] 15 Sec #1 | Study: Box | index 10456, barClosed true arraySize 10460 nextIndex 10456 | 2016-06-08 21:20:47
Chart: EURUSD [M] 15 Sec #1 | Study: Box | index 10457, barClosed true arraySize 10460 nextIndex 10457 | 2016-06-08 21:20:47
Chart: EURUSD [M] 15 Sec #1 | Study: Box | index 10458, barClosed true arraySize 10460 nextIndex 10458 | 2016-06-08 21:20:47
Chart: EURUSD [M] 15 Sec #1 | Study: Box | index 10459, barClosed false arraySize 10460 nextIndex 10459 | 2016-06-08 21:20:47
Chart: EURUSD [M] 15 Sec #1 | Study: Box | index 10459, barClosed true arraySize 10462 nextIndex 10459 | 2016-06-08 21:20:47
Chart: EURUSD [M] 15 Sec #1 | Study: Box | index 10460, barClosed true arraySize 10462 nextIndex 10459 | 2016-06-08 21:20:47
Chart: EURUSD [M] 15 Sec #1 | Study: Box | index 10459, barClosed true arraySize 10462 nextIndex 10459 | 2016-06-08 21:20:48
Chart: EURUSD [M] 15 Sec #1 | Study: Box | index 10460, barClosed true arraySize 10462 nextIndex 10460 | 2016-06-08 21:20:48
Date Time Of Last Edit: 2016-06-09 01:45:10
[2016-06-09 01:47:51]
Sierra Chart Engineering - Posts: 104368
We would not normally expect that to happen. Can you consistently reproduce this?
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
[2016-06-09 01:51:05]
onnb - Posts: 661
Pretty much yes, I've reproduced it at least 10-20 times in the last couple of hours. In other words, it doesn't happen every time I hit the insert button, but I can reproduce it pretty easily.
[2016-06-09 01:57:04]
Sierra Chart Engineering - Posts: 104368
OK we have reproduced it and it is very apparent why this is happening.

It is because the initial loading of data will not load the data from the temporary cache which subsequently happens during the chart "update" which is nearly immediately after. From our perspective this is not really a problem but it could be if this is not what you are expecting and have a reliance on it working as previously.
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
[2016-06-09 01:58:39]
Sierra Chart Engineering - Posts: 104368
We can greatly minimize this effect by reducing the flush time to something like 2 seconds. We really do not see that as a problem.

We do not want to go lower than 1 second though. So we are going to reduce the flush time at least down to 3 seconds for now.
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: 2016-06-09 01:59:15
[2016-06-09 04:33:47]
onnb - Posts: 661
....if this is not what you are expecting and have a reliance on it working as previously.

I ran into it with code like this breaking
bool barClosed = index < sc.ArraySize - 1;


From your description the above and any code that would access sc.ArraySize would be potential to not working. Something like this for example if(sc.Index < sc.ArraySize-1) which quite common.

Btw, related to the temporary cache, would it have made a difference if instead of the above sc.BarHasClosedStatus had been used?
[2016-06-09 04:36:51]
Sierra Chart Engineering - Posts: 104368
If a study function is designed properly, the way that this currently works should not be any problem whatsoever. There is no study within Sierra Chart itself which would be affected in any way with how this works.

Because when a chart is reloaded, the study arrays are completely cleared and any persistent variables, should be reset by the study.

After a chart reload the array size only grows in size. It never becomes smaller. Unless you were to reload the chart data, but that would not matter and should never matter.


Btw, related to the temporary cache, would it have made a difference if instead of the above sc.BarHasClosedStatus had been used?
No.
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: 2016-06-09 04:39:50
[2016-06-09 04:38:29]
Sierra Chart Engineering - Posts: 104368
Also, we do not know why this code would be affected:
bool barClosed = index < sc.ArraySize - 1;

Does not make sense to us. Why would there be a problem with it?
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: 2016-06-09 04:38:42
[2016-06-09 06:01:43]
onnb - Posts: 661
Trying to make sense of you answer and what I might do. Maybe its something I need to do on my end?

The problem I am facing is this. I hope this makes sense to you.
Trying to keep the details to the bare minimum.

The study in question uses a reference to a 1-Tick chart to do its calculations.
So for example, we have the study applied to a 4 tick range chart and it references a 1-tick chart.

Say that I have 100 bars of data and similar to the log I sent in the original post, lets say that I reload and on the range chart I get sc.ArraySize of 98. In other words, at this time, I am not seeing the full 100 bars because of the flush you mentioned.



int localArraySize = sc.ArraySize; // lets say that this now returns 98.

SCDateTimeArray refDateTime;
sc.GetChartDateTimeArray(tickChartNum, refDateTime);

int refArraySize = refDateTime.GetArraySize(); // does the refArraySize return an index that spans the 98 bars or the 100 bars?


Is it possible that refArraySize returns the index of all the ticks available all the way up to bar 100 on the tick chart?
In other words, on one chart, I see a picture where I have data up to bar 98, and on the other chart I see a picture where I have data up to bar 100.
Is that possible at all?
[2016-06-09 19:41:45]
Sierra Chart Engineering - Posts: 104368

Is it possible that refArraySize returns the index of all the ticks available all the way up to bar 100 on the tick chart?
Yes this is the case.

Initially in this particular example on the Range bar chart, you will have 98 bars and then in less than a second later there will be 100 bars.

This will be less of an issue in the next release.

Another thing you can do is look at the Date-Time of the last bar in the 1-Trade chart and compare that to:
https://www.sierrachart.com/index.php?page=doc/doc_ACSIL_Members_Variables_And_Arrays.html#scLatestDateTimeForLastBar

In the Range bar chart and if it is ahead of it, then you need to wait.
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: 2016-06-09 19:42:36
[2016-06-09 20:27:57]
T29 Dev2 - Posts: 1
Another thing you can do is look at the Date-Time of the last bar in the 1-Trade chart and compare that to:
https://www.sierrachart.com/index.php?page=doc/doc_ACSIL_Members_Variables_And_Arrays.html#scLatestDateTimeForLastBar

In the range bar chart and if it is ahead of it, then you need to wait.

Was just pondering this approach this morning - thanks for suggesting and confirming it.

Do you want me to report back here if issue resolved for us? Not sure if it makes a difference, but at least for us, could mean that you can just leave the flush settings the way they are now.
[2016-06-09 22:14:14]
Sierra Chart Engineering - Posts: 104368
Yes, definitely let us know. We also probably should make the flush time adjustable by the user.
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
[2016-06-10 05:03:44]
onnb - Posts: 661
I've been testing this idea using LatestDateTimeForLastBar
Continuing with the 98/100 example from above...

Initially in this particular example on the Range bar chart, you will have 98 bars and then in less than a second later there will be 100 bars.

Is it possible that when we have 98 bars, the sc.LatestDateTimeForLastBar has a timestamp that goes into bar 100?
In testing, I reproduce this with 15 second bars, I see the following:
Bar 98 has a start time of 00:41:15
sc.LatestDateTimeForLastBar has a timestamp of 00:41:54:000

In the log message below is a case where the arraySize is smaller by two. A few second before that it was 5719.
The bar at index 5716 has the timestamp 00:41:15:000


Chart: EURUSD [M] 15 Sec #1 | Study: Box Fe/Ff | index 5716, barClosed false arraySize 5717 nextIndex 5716 latestDateTimeForLastBar 2016-06-10 00:41:54.000 | 2016-06-10 00:41:51
[2016-06-11 00:46:37]
Sierra Chart Engineering - Posts: 104368

Is it possible that when we have 98 bars, the sc.LatestDateTimeForLastBar has a timestamp that goes into bar 100?
Could be. Refer to the documentation. Most likely this is already documented.

We are working on a completely different approach to the problem which will not require you to do anything special. This will be out in the next release. Please allow us a few more days.
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: 2016-06-11 00:47:04
[2016-06-12 22:56:53]
onnb - Posts: 661
This will be out in the next release.

What build should I look out for?
[2016-06-12 23:05:15]
Sierra Chart Engineering - Posts: 104368
This has been released as part of prerelease version 1427.
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

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

Login

Login Page - Create Account