Support Board
Date/Time: Mon, 25 Nov 2024 09:54:48 +0000
Post From: Data from study Study/Price overlay are not retrieved correctly on the first load,
[2024-03-19 10:31:04] |
User851058 - Posts: 9 |
Ok, I think I'm gonna answer myself here, for future reference by other devs in here as a lesson-learned (If I'm wrong on my solution, or there is a better way, please correct me Support :) ) So when You're using "Study/Price overlay" added on your chart1, that is referencing some custom-made Study added in other chart (chart2), a good practice is to add a subgraphed flag, say: SCSubgraphRef Subgraph_HasCalculationFinished = sc.Subgraph[0]; that you set to false at the beginning of calculation within this study, and set it to true at the end of this calculation. Then, you reference this flag (by SCSubgraphRef) in your master study in chart1 and can build a logic based on this flag - check if the value is either true of false. The good thing in Sierra Chart ACSIL is that the master study on chart1 will automatically recalculate when the referenced value changes (so the value of Subgraph_HasCalculationFinished flag). Which means, you can pretty much write something like this in pseude-code: if(Subgraph_HasCalculationFinished == false) { return; //do nothing} if(Subgraph_HasCalculationFinished true) { // do your calculation in master study in chart1 |