Login Page - Create Account

Support Board


Date/Time: Thu, 25 Apr 2024 21:53:33 +0000



Post From: Buy Alert is trigerred accurately via spreadsheet but not via ASCIL

[2022-09-29 16:12:33]
kam2001 - Posts: 65
Thanks for looking into it, but making the change as suggested has not worked.
Bar has closed but the cell value is not greater than 0 but it's still going inside 'If statement' and logging message 'Show alert here' as per code changed below.

const char *SheetCollectionName = "my-alerts";

const char *SheetName = "Sheet2";

void *SheetHandle = sc.GetSpreadsheetSheetHandleByName(SheetCollectionName, SheetName, false);

SCString CellString;
SCString MessageOut;
double CellValue = 0.0;

int status = sc.GetBarHasClosedStatus();
if(status == BHCS_BAR_HAS_CLOSED){
if (SheetHandle == nullptr) {
// sc.AddMessageToLog("Nope...", 0);
// some code for no spreadsheet

} else {
if (sc.GetSheetCellAsDouble(SheetHandle, 10, 2, CellValue)) {
if (CellValue > 0.0) {
sc.AddMessageToLog("Bar Has Closed", true);
sc.AddMessageToLog("Show Alert Here", 0);
MessageOut.Format("Cell Value = %f", CellValue);
sc.AddMessageToLog(MessageOut, 0);
sc.Subgraph[0][sc.Index] = 100;
}

// sc.AddMessageToLog(CellString, 0);
// sc.AddMessageToLog(CellString, 0);
}
// some different code for spreadsheet found
}
}

Date Time Of Last Edit: 2022-09-29 16:15:37