Support Board
Date/Time: Wed, 02 Jul 2025 05:23:49 +0000
Issues with charts opened with sc.OpenChartOrGetChartReference()
View Count: 784
[2020-12-28 10:06:09] |
BrMa - Posts: 80 |
Dear support, my study needs information of a daily-chart, so I'm opening it with sc.OpenChartOrGetChartReference(). I'm doing this in the setDefaults-section of the study because doing this later on causes a re-calculation of the study without a need for it. So far everything works fine and the calculations are done properly. After the loading of the study (which is used by two charts in the same chartbook), the windows and chartbook window show the expected content (please see WindowsAndChartbooks1.png, which is perfectly fine!). When I'm saving, closing and re-opening the chartbook the hidden referenced chart is shown there two times but with the same ID!? (please see WindowsAndChartbooks2.png). The issue is: everytime I save the chartbook (for whatever reason), another hidden chart is added with the next opening of the chartbook, causing LOTS of hidden charts but all with the same ID!? When closing the charts manually, there is a warning message for all windows saying they are referenced by chart #7 (what is true but why are ALL referenced and not only one!?). How can I prevent unused charts being created or make SierraChart use the already existing chart after a reload of the chartbook? As the settings for the hidden chart do not change, why isn't the "saved" hidden chart (in this example with ID #3) referenced? Thanks a lot in advance for your help! Regards, Markus |
![]() ![]() |
[2020-12-29 08:17:56] |
|
We are checking on 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 |
[2020-12-29 08:34:02] |
|
We have looked into this, and this is what we determined and we added this to the documentation: This function cannot be called from within the sc.SetDefaults code block. It will result in an incorrect Chart Number being used, when a Chartbook is being opened and one of the studies in the Chartbook makes a call to the sc.OpenChartOrGetChartReference() function. Therefore, it must be called below the sc.SetDefaults code block.
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 |
[2020-12-29 09:33:27] |
BrMa - Posts: 80 |
Well, calling the function afterwards causes the calling chart to be marked to be recalculated without a need for that - is there a way to work around this?
|
[2020-12-29 18:56:48] |
|
We need to look into 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 |
[2020-12-30 08:14:27] |
BrMa - Posts: 80 |
Dear support, I found out I need to specify my latest post a little bit more in detail to be more precise. The chart is marked for recalculation, if the study creating the hidden daily chart is added to a chart 1) for the first time or 2) the hidden chart is NOT saved to the chart book and the chartbook is reopened or 3) the hidden chart was removed from the chart book manually and the chartbook is saved, closed and reopened In all cases described the hidden chart marks the "calling" chart for recalculation. If the "hidden" chart was saved already, none of the charts is being marked for recalculation. However - all of this brings up another question that comes up with the chart created by sc.OpenChartOrGetChartReference(): if a futures contract is rolled over, a new daily chart is created by the function based on the latest future but leaving the previous daily chart with its own window unused (of course - it's saved in the chartbook...). This also increases the number of windows over time unnecessarily. I would be willing to close them programmatically and of course I know about sc.CloseChart() but I could not find a way determining the charts in the chartbook programmatically, meeting the "outdated" data... do I miss anything here? If yes, I would be very thankful for a hint... Thank you! |
[2020-12-30 09:03:45] |
Sierra_Chart Engineering - Posts: 20036 |
Precisely how are you coming to this conclusion?: In all cases described the hidden chart marks the "calling" chart for recalculation
If this is true, there would be a message in the Message Log indicating that a chart has been tagged for recalculation. if a futures contract is rolled over, a new daily chart is created by the function based on the latest future This is because you are causing this circumstance to occur. How you are doing that is unknown to us. This is for you to solve. It certainly does not happen on its own if you are specifying the same PriorChartNumber when calling the function.
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, use the Teton service: Sierra Chart Teton Futures Order Routing |
[2020-12-30 09:58:37] |
BrMa - Posts: 80 |
First of all thank you for the fast response. Please let me anser to your questions/remarks: If this is true, there would be a message in the Message Log indicating that a chart has been tagged for recalculation.
This is true - that's why I noticed the chart is tagged for recalculation! Please see the attached file MessageLog-TaggedForReload.png. Chart #2 and chart #7 are the charts the study is added to, chart #3 is the hidden chart created with sc.OpenChartOrGetChartReference().This is because you are causing this circumstance to occur. How you are doing that is unknown to us. This is for you to solve. It certainly does not happen on its own if you are specifying the same PriorChartNumber when calling the function.
I do understand what you're saying and I tried already calling sc.CloseChart() for the created chart remembering PriorChartNumber when sc.LastCallToFunction is set but this gives me the error in the message log that the window can't be closed as it does not exist anymore. Having this in mind - doing this and saving the chartbook programmatically is also not an option removing the referenced chart.Maybe raising the question another way leads to the proper solution: What is your recommended solution on how and by which trigger to close a referenced chart opened at sc.UpdateStartIndex == 0 in manual-looping, so that it is not saved to the chartbook? |
![]() |
[2021-01-05 08:36:29] |
Sierra_Chart Engineering - Posts: 20036 |
We need some time to work out a solution for 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, use the Teton service: Sierra Chart Teton Futures Order Routing |
[2021-01-19 22:12:18] |
|
We have developed a solution to this. There is this new variable available: s_ACSOpenChartParameters::UpdatePriorChartNumberParametersToMatch Refer to: ACSIL Interface Members - Functions: sc.OpenChartOrGetChartReference() What is your recommended solution on how and by which trigger to close a referenced chart opened at sc.UpdateStartIndex == 0 in manual-looping, so that it is not saved to the chartbook? You would use this function:ACSIL Interface Members - Functions: sc.CloseChart() However, if this is called when a Chartbook is being closed it will have no effect. 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: 2021-01-19 22:17:51
|
To post a message in this thread, you need to log in with your Sierra Chart account: