Login Page - Create Account

Support Board


Date/Time: Sun, 19 May 2024 12:15:05 +0000



Post From: ACSIL QUESTION DYNAMIC HEADERS

[2015-05-22 06:06:08]
enemyspy - Posts: 304
Hi, I have made some modifications to the writebardatatofile study in order to instead output study subgraphs.

I have replaced the float references to the OHLC arrays, with the following omitting everything except the key changes:


  SCSFExport scsf_WriteSGDatatofile(SCStudyInterfaceRef sc)
{

SCInputRef Separator = sc.Input[0];
  SCInputRef UseGMTTime = sc.Input[1];
  SCInputRef DateFormat = sc.Input[2];
  SCInputRef OutputMilliseconds = sc.Input[3];
  SCInputRef StudyReference1 = sc.Input[4];
}

if(sc.SetDefaults)
  {
StudyReference1.Name = "Subgraph Input 1";
sc.Input[4].SetChartStudySubgraphValues(1,1,12);

return;
}
SCFloatArray SGInput1;
  sc.GetStudyArrayUsingID(StudyReference1.GetStudyID(),StudyReference1.GetSubgraphIndex(), SGInput1);
//These references are later used to define the string variables below in the exact same way that the original study is done


So in the Header section which I have currently modified to look like this:

SCString fileHeader;      
    switch(Separator.GetInt())
    {
    case 0:
      fileHeader = "Date Time SGInput1\r\n";
      break;
    case 1:
      fileHeader = "Date, Time, SGInput1\r\n";
      break;
    case 2:
      fileHeader = "Date\Time\SGInput1\r\n";
      break;
    }

Is there a way to make the Header references Dynamic based on references to the subgraphs in the original study that I am pulling the SG arrays from so that I do not have to customize them for every application I require this study for?




Date Time Of Last Edit: 2015-05-22 06:09:43