Login Page - Create Account

Support Board


Date/Time: Mon, 25 Nov 2024 09:53:44 +0000



Post From: Data from study Study/Price overlay are not retrieved correctly on the first load,

[2024-03-19 14:46:03]
User851058 - Posts: 9
Ok, gonna give these a try.

The context is as follows:
1. On chart1, I have a study that is supposed to do some calculations / drawings / alerts based on another study that it is referencing, added to this chart1 via "Study/Price Overlay", via SCInputRef -> SetStudyID(...);
2. On chart2, I have a study that is doing some pre-calculations (because the chart has different time frame)

What I want to achieve is:
- Study on chart2 has done some precalculations and is exposing these data via SCSubgraphRef once the calculation is finished, to another studies that want to subscribe to them via this SCSubgraphRef's id.
- Study on chart1 is referencing this precalculated data via SCInputRef set on "Study/Price Overlay"- which is referencing this study on chart2
- Study on chart1, when the data it is referencing (from chart2) are calculated, is performing its own calculations (and this calculation includes the data from chart2), and based on the result, set the Alert message (sc.PlaySound(...))

chart1 and chart2 are linked to the same symbol, but they are operating on different time frame. Chart1 is main -> is supposed to perform some actions based on what comes in from calculations done on chart2.

Also, both charts work on "Associated Watch List" in Sierra Chart, so when the calculations on chart2 are not yet done, chart1 performs its calculation based on some default values and goes to next symbol in the Associated Watch List when auto-scanning is on on this list -> which ofc is also wrong.
I have tried all 3 methods, when the data on chart2 are not yet calculated: (chart2 has sc.CalculationPrecedence = STD_PREC_LEVEL (as it needs to be calculated first), chart1 has sc.CalculationPrecedence = VERY_LOW_PREC_LEVEL; (as it needs to be calculated after chart2)

sc.RecalculateChart(sc.ChartNumber);
sc.FlagFullRecalculate = true;
sc.RecalculateChartImmediate(sc.ChartNumber);

none of them forced the Associated Watch List scanning to recalculate the same symbol -> the scanning proceeds to next symbol in the Associated Watch List "abandoning" the previous symbol and not setting the Alert it would have set if all the calcualations were done.

So another question, is there a possibility to programmatically operate on the Associated Watch List / and scanning through the Associated Watch List? Because for some symbols on the Associated Watch List I end up with false Alerts / or no Alert at all when the Alert should be set
Date Time Of Last Edit: 2024-03-19 14:59:50
imageSCCalculation2.png / V - Attached On 2024-03-19 14:59:43 UTC - Size: 21.04 KB - 62 views