Login Page - Create Account

Support Board


Date/Time: Wed, 27 Nov 2024 23:28:07 +0000



Post From: ACSIL accessing persistent variables in another study on same chart

[2023-07-01 04:42:44]
William O - Posts: 16
I want to access the persistent variable values bar by bar of another study on the same chart during a recalculation . Is this possible?

In other words here is the sequence I'm trying to achieve in a recalculation:
Study A is called for sc.Index = 0 and sets the persistent int to 10
Study B is called for sc.Index = 0 and accesses Study A's persistent int with the current value of 10
Study A is called for sc.Index = 1 and sets the persistent int to 20
Study B is called for sc.Index = 1 and accesses Study A's persistent int with the current value of 20
etc...

Do studies under the same chart recalculate this way, sequentially called bar by bar?

I'm attempting to do it using automatic looping where Study B accesses Study A's persistent pointer variables using sc.GetPersistentPointerFromChartStudy.

However, study B is only getting the final value of Study A's persistent pointer. It seems all bars are processed in Study A then Study B's bars are all processed.

Thank you