Support Board
Date/Time: Tue, 06 May 2025 02:54:37 +0000
Post From: sc.GetChartName performance issue
[2025-01-16 13:09:48] |
binaryduke - Posts: 378 |
I am trying to get all names in the an chartbook. Minimal code example attached. When first opening the chartbook, all charts apart from the chart that the study is applied to return a blank name, even though I'm trying to delay running this function until calculations are complete. If I recalculate the chart after opening the chartbook, all chart names are returned. SCSFExport scsf_Chartbookloadingtest(SCStudyInterfaceRef sc)
{ if (sc.SetDefaults) { sc.GraphName = "Chartbook loading test"; sc.GraphRegion = 0; sc.AutoLoop = 1; } if ((sc.IsFullRecalculation) && (sc.SetDefaults != 1) && (sc.IsChartDataLoadingCompleteForAllCharts) && (sc.Index == (sc.ArraySize - 1))) { for (int ChartNumber = 1; ChartNumber <= sc.GetHighestChartNumberUsedInChartBook(); ChartNumber++) { SCString Chartname = sc.GetChartName(ChartNumber); SCString DEBUG; DEBUG.Format("%i %s", ChartNumber, Chartname.GetChars()); sc.AddMessageToLog(DEBUG, 0); } } } Message log output when opening chartbook: 2025-01-16 07:09:54.729 | Chart: ESM24_FUT_CME 1 Min #1 | Study: Chartbook loading test | 1 ESM24_FUT_CME 1 Min #1 2025-01-16 07:09:54.729 | Chart: ESM24_FUT_CME 1 Min #1 | Study: Chartbook loading test | 2 Message log output after recalculation: 2025-01-16 07:11:48.476 | Chart: ESM24_FUT_CME[M] 1 Min #1 | Study: Chartbook loading test | 1 ESM24_FUT_CME[M] 1 Min #1 2025-01-16 07:11:48.476 | Chart: ESM24_FUT_CME[M] 1 Min #1 | Study: Chartbook loading test | 2 6AU24_FUT_CME[M] 1 Min #2 Date Time Of Last Edit: 2025-01-16 13:12:21
|