Login Page - Create Account

Support Board


Date/Time: Sun, 29 Dec 2024 00:18:00 +0000



Post From: Problems with sc.OpenChartOrGetChartReference()

[2016-02-10 21:08:20]
bjohnson777 (Brett Johnson) - Posts: 284
...always one more thing to test after I hit the post button...

This appears to be linked with sc.GetChartBaseData(). If I use the negative chart number (sync the charts) with the 250 days above, it loops forever. If I use the positive chart number (chart bars not sync'd), it works.

//this block of code is run in the main body of the study
for(i=0; i<pStockIndexNodeCount; i++) {
    //Safety. Skip charts that didn't load.
  if(pStockIndexArray[i].ChartNumber <= 0) {continue;}
  
  //Define a GraphData object to get the remote BaseData from the given chart.
  SCGraphData RemoteBaseData;
  sc.GetChartBaseData((-1 * pStockIndexArray[i].ChartNumber), RemoteBaseData); //LOOPS FOREVER
  //sc.GetChartBaseData(pStockIndexArray[i].ChartNumber, RemoteBaseData); //WORKS
    
  //Define a reference array to the remote array (like SC_LAST or SC_HLC).
  SCFloatArrayRef RemoteBaseArray = RemoteBaseData[pInputDataIndex];
  //Safety check.
  if(RemoteBaseArray.GetArraySize() == 0) {continue;} //nothing to do
  } //end for()

Thanks