Login Page - Create Account

Support Board


Date/Time: Mon, 25 Nov 2024 01:47:17 +0000



[Programming Help] - Custom study inter-op: Is it possible?

View Count: 218

[2024-04-16 17:52:34]
User275839 - Posts: 61
I'm sure this has been asked before, but...

Assuming both studies are in the same chartbook (but different charts) is it possible for a custom study in one chart to modify the subgraph values in a custom study in a different chart?
[2024-04-16 19:40:59]
JohnR - User831573 - Posts: 306
I'm not a strong SC functions, just a self coding guy. There are functions to get subgraph values from a chart so just think of it as the "different chart study will use function to 'get' the value of the first chart, and then do or not do ... then modify differents subgraph value as you desire.

Hope this helps,
JohnR
[2024-04-16 22:06:48]
ForgivingComputers.com - Posts: 960
Subgraph Values are set only by the study they are part of. Custom Studies can share data using subgraphs as inputs to other studies. They can also share persistent variables across charts and studies.
[2024-04-16 23:48:13]
User275839 - Posts: 61
Thank you all for your comments and suggestions.

I decided to just go ahead and code up a pair of custom studies to investigate: Study #1 has only subgraphs and no logic. Study #2 has logic to fetch and write values to the subgraphs in the first.

I was pleasantly surprised to find that it actually works!

I used the sc.GetStudyArraysFromChartUsingID call to fetch the target subgraph(s) in Study #1, which I can then write to from Study #2.

I love Sierra! :)


Update from OP: P.S. While this approach is interesting, it is not a 100% ideal solution for what I'm trying to accomplish. But it could definitely be useful in some use cases. Still lovin' my Sierra Chart.
Date Time Of Last Edit: 2024-04-17 17:12:17

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

Login

Login Page - Create Account