Login Page - Create Account

Support Board


Date/Time: Tue, 22 Apr 2025 08:32:43 +0000



Post From: Help with sc.GetStudySummaryCellAsString() Function

[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.