Login Page - Create Account

Support Board


Date/Time: Wed, 22 Jan 2025 04:38:14 +0000



Post From: new version doesn't support setting sc.VolumePerBar

[2018-08-25 08:28:23]
User44804 - Posts: 7
Thank you for your reply. I am using version 1785. However, when i am using this function the chart gets into an endless loop always reloading the whole chart and never stopping. How can this be? In the older version there was no problem using sc.VolumePerBar.
Here is the code :
sc.DataStartIndex =sc.ArraySize-3;
  
  if((sc.ArraySize-2)<sc.Index)
    return;
  else
  
  
  {
  
  SCGraphData StudyData;
  sc.GetStudyArraysFromChartUsingID(Chartnumber.GetChartNumber(), Chartnumber.GetStudyID(), StudyData);
  
  // Define a reference to the first Subgraph array
SCFloatArrayRef SubgraphArray = StudyData[0];

int RefChartIndex = SubgraphArray.GetArraySize()-2;
  
  
  
  
  float NearestSubgraphValue = SubgraphArray[RefChartIndex];
  VolumeStudy[sc.Index]=SubgraphArray[RefChartIndex-1]/Divisor.GetInt();
  int a = (int) VolumeStudy[sc.Index];
  
  
  
  n_ACSIL::s_BarPeriod NewBarPeriod;
  
  sc.GetBarPeriodParameters(NewBarPeriod);
  
  NewBarPeriod.ChartDataType = INTRADAY_DATA;
  NewBarPeriod.IntradayChartBarPeriodType = IBPT_VOLUME_PER_BAR;
  NewBarPeriod.IntradayChartBarPeriodParameter1 = a;
  sc.SetBarPeriodParameters(NewBarPeriod);
  
  
  }

As already mentionend, it doesn't matter whether i use the variable a as NewBarPeriod.IntradayBarPeriodParameter1 or simply put in a constant number 1200. The chart gets reloaded endlessly.