Login Page - Create Account

Support Board


Date/Time: Sun, 12 Jan 2025 14:03:14 +0000



NewPeriodAtBothSessionStarts parameter

View Count: 703

[2017-03-04 13:44:49]
DabbaDo - Posts: 148
The documentation at http://www.sierrachart.com/index.php?page=doc/ACSIL_Members_Functions.html#scGetStartOfPeriodForDateTime doesn't cover this parameter. But I think it means to report a new StartOfPeriod when passing each session boundary when using two sessions.
But I'm confused by your code in Studies8.cpp L5911 (scsf_CumulativeDeltaBarsVolume):

if (Index == 0)
  Reset = true;
else if (ResetAtBothSessionStarts.GetYesNo() != 0 )
{
  SCDateTime PriorStartOfPeriod = sc.GetStartOfPeriodForDateTime(sc.BaseDateTimeIn[Index - 1], TIME_PERIOD_LENGTH_UNIT_DAYS ,1,0,1);
  SCDateTime StartOfPeriod = sc.GetStartOfPeriodForDateTime(sc.BaseDateTimeIn[Index], TIME_PERIOD_LENGTH_UNIT_DAYS ,1,0,1);
  if (StartOfPeriod != PriorStartOfPeriod)
  {
    Reset = true;
  }
}
else if (ResetAtSessionStart.GetYesNo() != 0 )
{
  SCDateTime PriorStartOfPeriod = sc.GetStartOfPeriodForDateTime(sc.BaseDateTimeIn[Index - 1], TIME_PERIOD_LENGTH_UNIT_DAYS ,1,0, 0);
  SCDateTime StartOfPeriod = sc.GetStartOfPeriodForDateTime(sc.BaseDateTimeIn[Index], TIME_PERIOD_LENGTH_UNIT_DAYS ,1,0,0);
  if (StartOfPeriod != PriorStartOfPeriod)
  {
    Reset = true;
  }
}
Note that the condition for both of the "else if" statements is the same, and only the NewPeriodAtBothSessionStarts parameter is different. I don't understand the intent of this logic, so I'm concerned I may not understand how NewPeriodAtBothSessionStarts works.

Cheers,
Dale
[2017-03-04 21:12:15]
Sierra Chart Engineering - Posts: 104368
We will document that parameter.

Note that the condition for both of the "else if" statements is the same,
Look closely at the code again and you will see this is not correct.
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, *change* to 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