Login Page - Create Account

Support Board


Date/Time: Fri, 10 Jan 2025 21:44:47 +0000



[User Discussion] - Spreadsheet feature request

View Count: 1213

[2015-01-11 06:25:57]
enemyspy - Posts: 306
would it be possible to add an option/setting to the spreadsheet study that allows you auto save the spreadsheet as text file every x amount of minutes defined by user?
[2015-01-11 19:57:57]
Sierra Chart Engineering - Posts: 104368
We will see about adding this.

Possibly what we will do is add Spreadsheets to be saved when the Chartbook is set to be auto saved.
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
[2015-01-12 01:50:53]
enemyspy - Posts: 306
That would be great. The main thing here is to be able to specify the format it is saved as so that ideally it can autosaved as a text/csv file, at which point some VBA or python script can pick it up.

Thanks.
[2015-01-12 02:56:44]
Sierra Chart Engineering - Posts: 104368
There is not going to be a way to control the format. It will be the standard Sierra Chart Spreadsheet format. The file extension for this is scss. There is no other possibility.

At some point in the future ACSIL will be able to access Spreadsheet cell data so you can use an ACSIL study to get the data and write it to your own format.
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
[2016-10-07 14:58:54]
GiantAvocado - Posts: 67
Agree on the previous requests. Is there documentation on what the .scss format is, so I can access it from C tt or Visual Basic? I have been looking for this but can't seem to find it.
[2016-10-07 17:20:48]
Sierra Chart Engineering - Posts: 104368
This documentation is not available. It is not something we have time to document.
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
[2016-10-09 22:24:42]
enemyspy - Posts: 306
You can write the base data and subgraphs to whatever file format you want via Acsil (c++).

I do a lot of data sharing between other custom apps. I pulled some of the code out of the header file I made to do this kind of stuff. Here is a very crude example which contains a custom study a custom study that will somewhat dynamically pull all of the information from the subgraphs. Basically like if you were to copy and paste you spreadsheet data.

It is kind of slow though because it keeps opening and closing the file at every index which is expensive. There are a number of ways that you can customize it to your needs and make it run a lot more efficiently. In its current state you need to input how many subgraphs are in each study By order of ID in the inputs section. If you need to use more studies modify the code to take more inputs. hope it helps get you started:


void FileOutput(const std::vector<float>& SubgraphsOut, const SCString& FilePath,bool Truncate)
{
  std::ofstream output;
  
  //Open the File Output
  if (output.is_open()) output.close();
    
    if(!Truncate) //Configured to use the Append Flag if The Study is not at the 0 index (full recalculation)
    output.open(FilePath.GetChars(), std::ofstream::out | std::ofstream::app);
    else //Uses the Truncate flag at the start of full recalculation. If you always want to append you will need to add some logic that recognizes The most recent entry, and aborts the append to avoid Dups.
    {
      output.open(FilePath.GetChars(), std::ofstream::out | std::ofstream::trunc);
      //Place a Header Writing Function here if you choose.
    }
  
  for (int i = 0; i < SubgraphsOut.size(); i++)
  {
    output << SubgraphsOut[i];
    if (i == SubgraphsOut.size() - 1) output << std::endl;
    else output << ",";
  }
  output.close();
}
SCSFExport scsf_SubGraphsToFile(SCStudyInterfaceRef sc)
{
  /*/Works for Same Chart Only.Code is Untested and Provided on an as is basis. Not Guaranteed to work and is for demonstration purposes only/**/

  SCInputRef s0 = sc.Input[0];
  SCInputRef s1 = sc.Input[1];
  SCInputRef s2 = sc.Input[2];

  if (sc.SetDefaults)
  {
    sc.GraphName = "SubGraphsToFile";
    sc.AutoLoop = 1;
    sc.FreeDLL = 0;

    s0.Name = "Study Input 0 # of subgraphs"; s0.SetInt(0);
    s1.Name = "Study Input 1 # of subgraphs"; s1.SetInt(0);
    s2.Name = "Study Input 2 # of subgraphs"; s2.SetInt(0);
    return;
  }
  
  int & StudyInputCount = (int)sc.GetPersistentInt(0);
  //int & StudyInputCount = (int)sc.GetPersistentInt(0);
  
  if (sc.Index == 0)
  {
    for (int i = 0; i < 3;i++)
    {
      if (sc.Input[i].GetInt() == 0) break;
        
      StudyInputCount++;
    }
  }

  if (sc.GetBarHasClosedStatus(sc.Index)== BHCS_BAR_HAS_CLOSED)
  {
    std::vector<float> SGInputs;
    //BaseData;
    SGInputs.push_back(sc.Open[sc.Index]);
    SGInputs.push_back(sc.High[sc.Index]);
    SGInputs.push_back(sc.Low[sc.Index]);
    SGInputs.push_back(sc.Close[sc.Index]);
    SGInputs.push_back(sc.Volume[sc.Index]);
    SGInputs.push_back(sc.BidVolume[sc.Index]);
    SGInputs.push_back(sc.AskVolume[sc.Index]);
    //Subraphs
    for (int i = 0; i < StudyInputCount; i++)
    {
      for (int j = 0; j < sc.Input[i].GetInt();j++)
      {
        SCFloatArray In;
        sc.GetStudyArrayUsingID(i, j, In);
        SGInputs.push_back(In[sc.Index]);
      }
    }
    FileOutput(SGInputs, "C:\\TradeData\\MyFile.csv",sc.Index==0);
  }

  return;
}

Date Time Of Last Edit: 2016-10-09 22:26:22
[2016-10-10 14:38:39]
GiantAvocado - Posts: 67
Hey Thanks; this looks just like what I am looking for. Steve

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

Login

Login Page - Create Account