Login Page - Create Account

Support Board


Date/Time: Wed, 25 Jun 2025 17:15:22 +0000



[Programming Help] - can't get data using sc.GetStudyProfileInformation,sc.GetNumStudyProfiles,need help

View Count: 690

[2021-12-15 15:03:52]
User978306 - Posts: 4
sample code

#include "C:\SierraChart\ACS_Source\sierrachart.h"

SCDLLName("VbP DLL")


SCSFExport scsf_trying_to_get_multiple_profiles(SCStudyInterfaceRef sc)
{
  if (sc.SetDefaults)
  {
    sc.GraphName = "multiple profiles getting attempt";
    sc.GraphRegion = 0;

    sc.AutoLoop = 0;

    sc.MaintainVolumeAtPriceData = 1;
    
    return;
  }
  
  //Tried to get VbP study ID by full name('VbP - 1Days') failed, so short name
  // assigned, this works..
  std::int32_t vbp_study_id = sc.GetStudyIDByName(sc.ChartNumber, "vbp", 1);

  //returns correct StudyID, ok.
  std::int32_t vbp_count = sc.GetNumStudyProfiles(vbp_study_id);

  //sc.GetNumStudyProfiles always returns zero..
  std::int32_t profile_index = 0;
  
  //Getting the latest profile attemption
  n_ACSIL::s_StudyProfileInformation profile_info;
  std::int32_t result = sc.GetStudyProfileInformation(vbp_study_id, profile_index, profile_info);

  //Have an empty profile_info struct instance, nothing filled.
  //Return value of sc.GetStudyProfileInformation calls is always zero.
}

On my chart everything looks as as expected, what I have missed, help please.
[2021-12-15 17:16:10]
User99735 - Posts: 234
Try using SetChartStudyValues / GetChartStudyValues in inputs to select the Profile study ID, instead of GetStudyIDByName.
[2021-12-15 18:08:56]
User978306 - Posts: 4
Yes, thank you.
Solution is very simple.
One would like to use this function, ANY value should be referenced with any sc.Input..
In my case I simply defined current profile index as sc.Input[0].IntValue and have got a result.
sc.GetStudyIDByName() works fine.

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

Login

Login Page - Create Account