Login Page - Create Account

Support Board


Date/Time: Wed, 15 Jan 2025 16:25:31 +0000



"Volume Weighted Average Price - Rolling" resets on Sundays.

View Count: 1875

[2017-07-11 07:18:53]
Sporken - Posts: 82
with v1580 but present in prior versions as well.

Symbol anything continuously trading, so GBPUSD or ESU17 for example. The price of the VWAP is continuous from day to day, except from Friday to Monday. Is this correct?

Study Inputs:
Input Data - Last
Base on Underlying Data "Yes"
Time Period Type "Days-24 hour period"
Time Period Length "1"
Number of Days to Calculate "1234"
Exclude Weekends in Date Look Back "No" (or "Yes")
Minimum Required Time Period as Percent "0"
[2017-07-11 17:07:16]
Sierra Chart Engineering - Posts: 104368
This study does not reset.

If there is no data or missing data on Friday, Saturday, Sunday then for bars in the chart referencing those time periods, then they will be referencing no data at all.

You probably will want to increase this percentage:

Minimum Required Time Period as Percent "0"
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
Date Time Of Last Edit: 2017-07-11 17:07:31
[2017-07-29 19:58:57]
Sporken - Posts: 82
Increasing "Minimum Required Time Period as Percent" was ineffective because I am setting "Time Period Length" to 1. This means GetIndexForStartofDayPeriodForDaysBack is called with NumDaysToInclude=1 so the function returns without iterating. MinimumRequiredTimePeriodInDayAsPercent is unreferenced.

This is the code that causes the issue. In scsf_RollingVolumeWeightedAveragePrice in studies3.cpp:758

      
else if (PeriodType == 1) // Days - 24 hour periods
{
  SCDateTime CurrentPeriodStartDateTime = sc.BaseDateTimeIn[Index] - 1 * DAYS + 1 * SECONDS;
  r_FirstIndexIncluded = sc.GetContainingIndexForSCDateTime(sc.ChartNumber, CurrentPeriodStartDateTime);

I propose the following amendment for your consideration

      
else if (PeriodType == 1) // Days - 24 hour periods
{
  SCDateTime CurrentPeriodStartDateTime = sc.BaseDateTimeIn[Index] - 1 * DAYS + 1 * SECONDS;
  if (ExcludeWeekendInDateCalc.GetYesNo() &&
    ((sc.BaseDateTimeIn[Index].GetDayOfWeek() == SUNDAY) || (sc.BaseDateTimeIn[Index].GetDayOfWeek() == MONDAY)))
  {
    CurrentPeriodStartDateTime = sc.BaseDateTimeIn[Index] - (3 * DAYS) + (1 * SECONDS);
  }
  r_FirstIndexIncluded = sc.GetContainingIndexForSCDateTime(sc.ChartNumber, CurrentPeriodStartDateTime);

This appears to correct the discontinuity on my 5min and hourly charts on both futures and forex. I also tested increasing "Time Period Length" and it appeared to be ok.

This behaviour/code is also seen on "Moving Average - Rolling High Accuracy"

A better fix might be to amend GetIndexForStartofDayPeriodForDaysBack and eliminate the sc.BaseDateTimeIn[Index] - 1 * DAYS + 1 * SECONDS calculation entirely.

I'm not very familiar with the code so there may be other ways to approach this.
Date Time Of Last Edit: 2017-07-29 20:04:49
[2017-07-31 05:05:14]
Sierra Chart Engineering - Posts: 104368
We will look this over and see what is the best solution.
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