Login Page - Create Account

Support Board


Date/Time: Mon, 16 Jun 2025 10:23:56 +0000



[Programming Help] - how to identify if chart is loading or data is coming in real time

View Count: 560

[2022-09-22 14:40:24]
JohnR - User831573 - Posts: 333
I have found variables for the following, but I have not found a variable to state if the data processing is for loading a chart or if it is real time data coming in tick by tick.
sc.IsReplayRunning
sc.DownloadingHistoricalData - from reading it looks like this is only while 'downloading' data not just reading it from my drive to initially load a chart
and there seems to be some internal 'thing' that is used when creating a trading system to stop it from taking trades while a chart is loading
sc.LatestDateTimeForLastBar - set to the starting Date-Time of the very latest chart data file record which has been read into the chart

I am looking for an event I can watch for, or variable that is set that lets me know when a chart is loading / reloading. Or if there is a variable I can check to see if it is in real time tick by tick.

Please advise and educate me.
JohnR
Date Time Of Last Edit: 2022-09-22 14:47:38
[2022-09-22 14:45:51]
User431178 - Posts: 713
Maybe on or more of these can help you?

ACSIL Interface Members - Functions: sc.ChartIsDownloadingHistoricalData()

ACSIL Interface Members - Functions: sc.IsChartDataLoadingCompleteForAllCharts()
ACSIL Interface Members - Functions: sc.IsChartDataLoadingInChartbook()

ACSIL Interface Members - Variables and Arrays: sc.DataFeedActivityCounter
[2022-09-22 14:51:04]
JohnR - User831573 - Posts: 333
Thank you for your time to reply. i knew there had to be a way to do this, as most everything is possible within SC.

I looked and searched under events and variables, but did not within functions. Duuhhhhh ! ! ! (Made that mistake, hopefully not a second time)

Again, thanks for your time to reply,
JohnR
Date Time Of Last Edit: 2022-09-22 15:51:58
[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
[2022-09-24 18:06:08]
JohnR - User831573 - Posts: 333
I figured out my issue. I now have things working using sc.Close.GetArraySize() as part of my logic to determine how many bars are part of the initial loading

JohnR

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

Login

Login Page - Create Account