Login Page - Create Account

Support Board


Date/Time: Mon, 16 Jun 2025 17:59:00 +0000



Post From: how to identify if chart is loading or data is coming in real time

[2022-09-23 18:37:49]
JohnR - User831573 - Posts: 333
I'm thought I could read, but I'm starting to second guess myself. Maybe, I am misinterpretting "Loading". I am taking it to mean while my study is processing each bar during the initial starting of a chart. But after reading it some more, and seeing the results in the debugger, it looks like the "loading" of the data is happening in a different thread and all data can be "Loaded" before the chart starts to process real time data / bars.

If the latter is the case, then is there a way for me to know when all bars have been processed during the initial starting / recalculation of a chart? I think if I am suing intraday data, I can look for a change of index #, which is the same logic I use to do calculations once per bar. But if I am using Daily data, and I want to do some analysis at the end of a night, there will be no new bar until the following morning when the market opens.

I'm using the 2 lines of code below. When I step through a VS2022 debug session, I am on sc.Index = 1 and The return values of the 2 functions below are opposite of what I expected. I can always just reverse the logic to know when I am "loading a chart initially", but that is now what the docs state.
sc.IsChartDataLoadingCompleteForAllCharts(); ---> returns True
sc.IsChartDataLoadingInChartbook(); ----> returns false

// if chart is loading data and not real time data coming in -> RETURN
  bool LoadingIsComplete = sc.IsChartDataLoadingCompleteForAllCharts();
  bool ChartBookLoadingData = sc.IsChartDataLoadingInChartbook();
  if ((not LoadingIsComplete) or ChartBookLoadingData)
  {
    lastIndex = sc.Index;
    return;
  }

Please explain, so I can understand better. Is this a bug? I doubt it. I trying to learn.

Thanks in advance for any assistance.
JohnR
Date Time Of Last Edit: 2022-09-23 18:55:44
imageSC_DebugIssue_2022-09-23_14-28-51.jpg / V - Attached On 2022-09-23 18:37:29 UTC - Size: 299.37 KB - 118 views