Login Page - Create Account

Support Board


Date/Time: Tue, 22 Apr 2025 08:17:21 +0000



[Programming Help] - Help with sc.GetStudySummaryCellAsString() Function

View Count: 122

[2025-01-30 20:01:29]
User716694 - Posts: 1
I'm trying to export several study cells using this function to a CSV file, but am initially just trying to get the cell values to show up in my log file. I have gone through several iterations using AI, but keep getting sent in circles when it comes to coding this in ACSIL/C++. I have several studies that I'm trying to reference, screenshot attached. I have mapped out each study's ID (in the Study Summary window), row ID and cell ID. When I run the following, I keep getting "0" values, even for the common cells like "Last".

// Begin Code

#include "sierrachart.h"

SCDLLName("Export Study Summary Cells to CSV");

SCSFExport scsf_ExportStudySummaryCellValue(SCStudyInterfaceRef sc)
{
if (sc.Index == 0)
{
sc.GraphName = "Export Study Summary Cells to CSV";
sc.AutoLoop = 0; // No auto-loop needed
sc.FreeDLL = 0; // Keep the DLL loaded
    sc.HideStudy = 1; // Hide the study (does not display on the chart)
return;
}

// Define variables
  SCString StudySummaryCellValue;
  
int RowID = 8; // Adjust this to the correct row index (e.g., 0 for the first row)
int CellID = 4; // Adjust this to the correct column index (e.g., Last Price, Volume, etc.)

// Correct function call with CellID, RowID
SCString CellValue;
  sc.GetStudySummaryCellAsString(CellID, RowID, CellValue);
  //sc.GetStudySummaryCellAsDouble(CellID, RowID, StudySummaryCellValue);

// Log the value if successfully retrieved
SCString logMessage;
  logMessage.Format("Study Summary Cell Value (RowID: %d, CellValue: %d): %f",
           RowID, CellID, CellValue);
  sc.AddMessageToLog(logMessage, 0);
}

// End Code

Any help is appreciated!
imageScreenshot 2025-01-30 125849.png / V - Attached On 2025-01-30 19:59:22 UTC - Size: 52.28 KB - 30 views
Attachment Deleted.
[2025-01-31 06:23:38]
Sierra_Chart Engineering - Posts: 19303
We have always been very suspicious of this concept of artificial intelligence. We do not believe it actually exists. Anyway, the problem is this:
logMessage.Format("Study Summary Cell Value (RowID: %d, CellValue: %d): %f",
RowID, CellID, CellValue);

Needs to be:
logMessage.Format("Study Summary Cell Value (RowID: %d, CellValue: %d): %s",
RowID, CellID, CellValue);

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, use the Teton service:
Sierra Chart Teton Futures Order Routing

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

Login

Login Page - Create Account