Login Page - Create Account

Support Board


Date/Time: Thu, 02 May 2024 17:46:49 +0000



[Programming Help] - iterate over all charts and studies in a chartbook

View Count: 933

[2015-03-16 00:52:46]
onnb - Posts: 661
is there a way to iterate over all charts and studies in a chartbook?

As an example, say I wanted to list all the studies in a chartbook using GetStudyNameFromChart(ChartNumber, StudyID).


[2015-03-18 04:00:03]
Sierra Chart Engineering - Posts: 104368
This is not supported.

And we do not have time to add 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
Date Time Of Last Edit: 2015-03-18 04:02:44
[2020-07-25 14:30:59]
User462086 - Posts: 188
just found this old thread while looking for a way to iterate over studies on a chart. the following is working for me. might be able to use the same idea for charts too.


SCSFExport scsf_IterateStudiesOnChart(SCStudyInterfaceRef sc){
  
  SCInputRef HighestStudyIndex= sc.Input[0];
  
  if (sc.SetDefaults){
    
    sc.GraphName = "Iterate Studies";
    sc.AutoLoop = 0;

    HighestStudyIndex.Name = "Highest Study Index";
    HighestStudyIndex.SetInt(2);
    
    return;
  }
    
  // iterate over chart studies
  
  for (int idx = 1; idx <= HighestStudyIndex.GetInt(); idx++){
    
    int studyID = sc.GetStudyIDByIndex(sc.ChartNumber, idx);
    SCString studyName = sc.GetStudyNameUsingID(studyID);
    
    if (!studyName.IsEmpty()){
      
      // do something (eg, skip processing of this study!)
    }
  }
}

Date Time Of Last Edit: 2020-07-25 14:31:18

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

Login

Login Page - Create Account