Login Page - Create Account

Support Board


Date/Time: Tue, 06 May 2025 20:38:08 +0000



[Programming Help] - Forcing Chart Recalculation

View Count: 316

[2024-12-05 08:57:29]
User688525 - Posts: 284
Hello Sierra,
Can you confirm which should be used to force a full chart recalculation? I have developed a custom study which I am displaying on a destination chart using the Study/Price Overlay study, however, I have to manually recalculate either the source or destination charts for the study to display correctly.

sc.EarliestUpdateSubgraphDataArrayIndex = 0;
or
sc.IsFullRecalculation = true;


*Update #1: I have added logging to the study and confirm the block where both sc.EarliestUpdateSubgraphDataArrayIndex = 0; and sc.IsFullRecalculation = true; is being executed, however, on the destination chart with the Study/Price Overlay study, it still isn't displaying correctly unless I manually recalculate either the source or destination charts.

*Update #2: The study is working correctly on the source chart. The issue seems to be displaying on the destination chart with the Study/Price overlay study.


Thank you
Date Time Of Last Edit: 2024-12-05 20:04:01
[2024-12-05 14:32:08]
Tony - Posts: 569
I think it is:
sc.RecalculateChart(sc.ChartNumber);
[2024-12-05 18:37:55]
User688525 - Posts: 284
Hi Tony,
I tried this without luck.

Thanks for your help.
[2024-12-10 02:50:44]
Sierra_Chart Engineering - Posts: 19461
Are you wanting to recalculate another chart within the same Chartbook, as the chart containing the study instance the recalculate function is called from?

Or do you want to recalculate the same chart, which contains the study instance that is calling the recalculate 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
Date Time Of Last Edit: 2024-12-10 02:51:04
[2024-12-10 09:31:06]
User688525 - Posts: 284
Hi Sierra Engineering,
I have created a custom custom study which is running exclusively on a new chart (Chart #5 for example) on a specific time frame (5 minutes for example).

As other charts use different time frames (15 minutes, 60 minutes, etc.), I am using the Study/Price Overlay study to display the custom study from Chart #5 on other charts.

The custom study generates lines which display correctly on the destination charts. These lines also change color based on several conditions as intended. The problem has been that the line colors don't change on the destination charts unless a manual recalculation is done, meaning, the lines and colors display correctly on the source chart (Chart #5) without a manual recalculation, but not on the destination charts.

After using sc.EarliestUpdateSubgraphDataArrayIndex and/or sc.IsFullRecalculation both within and outside of loop without success, today I integrated parts of the built-in “scsf_PeriodicChartRecalculation” study to force a period recalculation independent of the loop. Whether this is the most efficient way of forcing a recalculation, I'm not sure, but I can now confirm that the study is now displaying correctly on the destination charts.

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

Login

Login Page - Create Account