Login Page - Create Account

Support Board


Date/Time: Sun, 11 May 2025 20:51:32 +0000



m_EveningSession from sc.GetStudyProfileInformation() always returns 0

View Count: 325

[2024-08-27 15:56:26]
Mark Lewis - Posts: 27
I'm trying to use m_EveningSession to determine if a TPO profile is an evening session. However, it always returns 0. In the following example, 0 is the first profile index and represents an intraday session. 1 profile index represents an evening session. However, the following profile_1.m_EveningSession always returns 0. I have confirmed this using the message log.


  n_ACSIL::s_StudyProfileInformation profile_1;
  sc.GetStudyProfileInformation(1, 1, profile_1);
    
  SCString Msg;
  Msg.Format("profile_1_m_EveningSession: %d", profile_1.m_EveningSession);
  sc.AddMessageToLog(Msg, 1);   

I expect m_EveningSession to return 1 if the TPO profile is an evening session. Could you verify this expected behavior and if so, reproduce my result?

Thank you for looking into this!
Mark
Date Time Of Last Edit: 2024-08-27 17:33:35
[2024-08-27 17:34:50]
Mark Lewis - Posts: 27
I updated the code for clarity by removing an irrelevant line.
[2024-08-28 14:22:52]
Sierra_Chart Engineering - Posts: 19547
The only case where this variable would be true is in the case of a Profile that is for the evening session when using this functionality:
Time Price Opportunity (TPO) Profile Charts: Displaying Separate Profiles for Day and Evening Sessions
Sierra Chart Support - Engineering Level

Your definitive source for support. Other responses are from users. Try to keep your questions brief and to the point. Be aware of support policy:
https://www.sierrachart.com/index.php?l=PostingInformation.php#GeneralInformation

For the most reliable, advanced, and zero cost futures order routing, use the Teton service:
Sierra Chart Teton Futures Order Routing
Date Time Of Last Edit: 2024-08-28 14:23:00
[2024-08-28 15:56:36]
Mark Lewis - Posts: 27
The only case where this variable would be true is in the case of a Profile that is for the evening session when using this functionality:

The variable m_EveningSession does not return true when the profile is for an evening session.
[2024-08-29 16:38:40]
Mark Lewis - Posts: 27
After further testing, I'm feeling confident that this is a bug.
[2024-08-29 21:58:14]
Mark Lewis - Posts: 27
Workaround for anyone that runs into this in the future...


  n_ACSIL::s_StudyProfileInformation profile_1;
  sc.GetStudyProfileInformation(1, 1, profile_1);

  SCDateTime profile_1_DateTime = profile_1.m_StartDateTime;

  SCDateTime StartTimeOfEveningSession;
  StartTimeOfEveningSession.SetTime(sc.StartTime2);

  if (profile_1_DateTime.GetHour() == StartTimeOfEveningSession.GetHour())
  {
    // profile_1 is an evening profile
  }

[2024-08-30 03:34:43]
Sierra_Chart Engineering - Posts: 19547
We do see that there is an issue and we will develop a solution for this. It looks like that particular variable was meant to be implemented but never was.
Sierra Chart Support - Engineering Level

Your definitive source for support. Other responses are from users. Try to keep your questions brief and to the point. Be aware of support policy:
https://www.sierrachart.com/index.php?l=PostingInformation.php#GeneralInformation

For the most reliable, advanced, and zero cost futures order routing, use the Teton service:
Sierra Chart Teton Futures Order Routing

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

Login

Login Page - Create Account