Support Board
Date/Time: Sat, 15 Mar 2025 07:48:38 +0000
[Programming Help] - How to get the values of over 100 sc study in one study
View Count: 1044
[2022-07-14 05:16:51] |
User395175 - Posts: 90 |
Hi, i want to access to the values of over 100 sc study in my own study, i saw there is a way to use the ACSIL interface member function to access the value of sc study and i need to set the output subgraph for each study function, but there is limited subgraph number of 60 that i can use in one study. Is there a way to access to over 100 sc study function without setting the output subgraph (or maybe i can use other c++ array as the output subgraph rather than the sc subgraph array)? i just want to define over 100 float variables and set these variables == the value of sc study each time my study is called.
Date Time Of Last Edit: 2022-07-14 06:30:00
|
[2022-07-14 12:36:05] |
JohnR - User831573 - Posts: 320 |
Not sure if it fits within your logic, but why not have 2 studies. One with 60 subgraphs and the other with the remaining 40. You can put both in the same region. Just a thought, JohnR |
[2022-07-14 13:01:59] |
|
We will have an answer for you today on this.
Sierra Chart Support - Engineering Level Your definitive source for support. Other responses are from users. Try to keep your questions brief and to the point. Be aware of support policy: https://www.sierrachart.com/index.php?l=PostingInformation.php#GeneralInformation For the most reliable, advanced, and zero cost futures order routing, *change* to the Teton service: Sierra Chart Teton Futures Order Routing |
[2022-07-14 15:07:05] |
|
In this case you will want to use persistent variables: ACSIL Interface Members - Functions: Fast Persistent Variable Functions And refer to: ACSIL Interface Members - Functions: sc.GetPersistentFloatFromChartStudy() You can set data into persistent variables from one study and access them in another. Sierra Chart Support - Engineering Level Your definitive source for support. Other responses are from users. Try to keep your questions brief and to the point. Be aware of support policy: https://www.sierrachart.com/index.php?l=PostingInformation.php#GeneralInformation For the most reliable, advanced, and zero cost futures order routing, *change* to the Teton service: Sierra Chart Teton Futures Order Routing |
[2022-07-14 15:14:12] |
User395175 - Posts: 90 |
I think to use above method, I need to apply the study to chart first, right? But I don’t want to apply the sc study to chart, cuz there are over 100 sc study I wann use. Can I just calculate and get over 100 value of sc study inside my one study and use them?
Date Time Of Last Edit: 2022-07-14 22:24:56
|
[2022-07-14 15:31:14] |
User395175 - Posts: 90 |
Or can I use the same subgraph(for example, subgraph[0]) for all 100 sc study? I don’t need to keep these study values in memory, just need to set some variables == to the study values. When I call the next sc study function, the subgraph I used before will be re-written and used in the new study function, is it possible to do it in sc? Date Time Of Last Edit: 2022-07-14 15:48:50
|
[2022-07-15 02:26:52] |
User395175 - Posts: 90 |
And can i use vector in c++ to replace the output subgraph array used in sc study function? If so, how to define a vector that can be used to replace the subgraph array? If not, what kind of array in C++ i can use to replace the output subgraph array (i only need the array to hold study values and access the newest study value)?
Date Time Of Last Edit: 2022-07-15 02:32:03
|
[2022-07-15 13:59:08] |
JohnR - User831573 - Posts: 320 |
Looking at what you are trying to do, I think I was wrong in what you were trying to do. If you only want to keep the last value of each of the 100 sc studies from other charts or even within this chart, but a different study, then what SC support suggest is the way to go. you would just use the call for each to the 100 values you want into different variables or array elements. fdouble& GetPersistentDoubleFromChartStudy(int ChartNumber, int StudyID, int Key); example from SC docs ACSIL Interface Members - Functions: Chart Study Persistent Variable Functions SCSFExport scsf_GetStudyPersistentVariableFromChartExample(SCStudyInterfaceRef sc) { SCInputRef ChartStudyReference = sc.Input[0]; if (sc.SetDefaults) { // Set the configuration and defaults sc.GraphName = "Get Study Persistent Variable from Chart Example"; sc.AutoLoop = 1; ChartStudyReference.Name = "Chart Study Reference"; ChartStudyReference.SetChartStudyValues(1, 0); return; } //Get a reference to a persistent variable with key value 100 in the chart and study specified by the ChartStudyReference Input. float & FloatFromChartStudy = sc.GetPersistentFloatFromChartStudy(ChartStudyReference.GetChartNumber(), ChartStudyReference.GetStudyID(), 100); } To get the value of the 2nd study you want to get from another chart float & My_2nd_value = sc.GetPersistentFloatFromChartStudy(Chart_2_Num, Study_Num, Index_Num) then have a line for each of the rest of the 100 values you are trying to get into your study. Then do your calculations / compares as you wish. At leat this is my understanding, JohnR |
[2022-07-15 15:07:17] |
User395175 - Posts: 90 |
Thank you, But I don’t want to apply 100 sc study to chart first. Is there a way to direct access the value inside study?
Date Time Of Last Edit: 2022-07-15 15:28:28
|
[2022-07-15 17:41:25] |
JohnR - User831573 - Posts: 320 |
I guess I really don't understand what you are trying to do. I thought you have a chart - Let's call it Summary. On this chart you want to create a study that will access 100 values from other charts / subgraphs. If that is the case, then what SC support and I showed you is a way to access each of them by using the API 100 times to get the value of a chart / study / subgraph value into a persistent variable within "Summary" chart. You do not load 100 studies into Summary chart. Sorry if I am wasting your time. I will stand aside now. JohnR |
[2022-07-15 22:00:05] |
User395175 - Posts: 90 |
Thank you, i will have a look. Maybe i was wrong, i shouldn't expect to get all the study value in one study without attaching the study on chart.
|
To post a message in this thread, you need to log in with your Sierra Chart account: