Login Page - Create Account

Support Board


Date/Time: Sat, 28 Jun 2025 01:26:22 +0000



Post From: Accessing persistent variables from another study on recalc

[2021-09-21 12:39:32]
ForgivingComputers.com - Posts: 1072
Is this the expected behavior for sc.GetPersistentIntFromChartStudy during recalculation? i.e. Will this only return the value corresponding to the final bar on the chart?

It makes sense to me that the persistent variable on the source chart is whatever it was when last calculated, meaning the last bar. There is no history of the persistent variable unless it is also a subgraph, so the only way you are going to get something other than the last bar is to reference a subgraph with an index (or SCDateTime variable in the case of studies on other charts) to get the value associated with the bar.