Login Page - Create Account

Support Board


Date/Time: Fri, 27 Dec 2024 11:02:46 +0000



ACSIL - sc.CumulativeDeltaTickVolume with multiple charts failing to return data

View Count: 1161

[2015-12-17 09:35:20]
Jayturn - Posts: 15
I am running a study on a base chart that uses a 500 Tick bar period and it loads a 405 Minute Period chart programmatically. When loading the chart using sc.GetChartBaseData(), I can access the High/Low/Close/Values correctly so there isn't an issue with the loading of the chart as far as I can tell. When I add that SCGraphData to the sc.CumulativeDeltaTickVolume() method, I get no data populated in the SCSubgraphRef provided as the SCSubgraphRef Out parameter. If I use sc.BaseDataIn I get the expected data.

The base chart (500 Tick) session start time is 00:00:00 and the end time is 23:59:59. The programmatically added chart session start time is 09:00:00 and the end time is 16:15:00. Please see my code below:


// This is the code used to generate the 405 minute chart.
int& dailyIndex = sc.GetPersistentInt(5);

// Create an object to store the chart parameters.
s_ACSOpenChartParameters OpenChartParameters;

// Set the Minute chart parameters.
OpenChartParameters.PriorChartNumber = chartNumber;
OpenChartParameters.ChartDataType = INTRADAY_DATA;
OpenChartParameters.Symbol = sc.GetRealTimeSymbol();
OpenChartParameters.IntradayBarPeriodType = IBPT_DAYS_MINS_SECS;
OpenChartParameters.IntradayBarPeriodLength = minValue * SECONDS_PER_MINUTE;
OpenChartParameters.DaysToLoad = 0;
OpenChartParameters.LoadWeekendData = 0;
OpenChartParameters.SessionStartTime.SetTimeHMS(9, 30, 00);
OpenChartParameters.SessionEndTime.SetTimeHMS(16, 15, 00);

// Open the Minute chart.
dailyIndex = sc.OpenChartOrGetChartReference(OpenChartParameters);
  

// The following code is contained within a method.
// PrevDaySessionEndBar is the last bar in the base chart between 09:00:00 and 16:15:00 the previous day.
if (PrevDaySessionEndBar < 0)
  return;

// Get the dailyIndex chart number.
int dailyIndex = sc.GetPersistentInt(5);

// Define a current bar index to be used for calculations.
int curBarIndex;
int prevBarIndex;

// Define a graph data object.
SCGraphData dailyGraphData;

// Get the base data for the Daily chart.
sc.GetChartBaseData(dailyIndex, dailyGraphData);

// If the GraphData Array is empty return.
if (dailyGraphData[SC_LAST].GetArraySize() > 0)
{
  // Store yesterday's bar index to be used for today's calculations.
  curBarIndex = sc.GetNearestMatchForDateTimeIndex(dailyIndex, PrevDaySessionEndBar);    
  prevBarIndex = curBarIndex - 1;
}
else
{
  return;
}

// Get the base values for the previous day's calculations.
// All of these values are retrieved correctly
float dHigh = dailyGraphData[SC_HIGH][prevBarIndex];
float dLow = dailyGraphData[SC_LOW][prevBarIndex];
float dClose = dailyGraphData[SC_LAST][prevBarIndex];
float dOpen = dailyGraphData[SC_OPEN][prevBarIndex];

// Define the subgraph to store the cumulative delta data.
SCSubgraphRef cdHigh = sc.Subgraph[SC_HIGH];
SCSubgraphRef cdLow = sc.Subgraph[SC_LOW];
SCSubgraphRef cdClose = sc.Subgraph[SC_LAST];

// If the GraphData Array is empty return.
if (sc.BaseData[SC_LAST].GetArraySize() > 0)
{
  // Retrieve the Cumulative Delta data for the Daily Chart.
  sc.CumulativeDeltaTickVolume(dailyGraphData, cdClose, prevBarIndex, 0);
  
  // These values always return zero values??????
  cdLow[prevBarIndex] = cdClose.Arrays[2][prevBarIndex];
  cdHigh[prevBarIndex] = cdClose.Arrays[1][prevBarIndex];
}


Can you please tell me if this is the correct way to retrieve CumulativeDeltaTickVolume from a different chart and if it is, can you please test it at your end so I know it's an issue at my end?
[2015-12-18 04:49:34]
Sierra Chart Engineering - Posts: 104368
No, this is not the correct way because the array sizes are different between the Input and Output arrays. The study has to be directly added to the other chart and you need to reference/get that study data.

Refer to this page:
https://www.sierrachart.com/index.php?page=doc/doc_ACSILRefOtherTimeFrames.php#Introduction
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: 2015-12-18 04:50:11
[2015-12-18 06:45:49]
Jayturn - Posts: 15
Thank you for the response Sierra Chart Support. So to confirm, are you saying there currently isn't a way to programmatically call the sc.CumulativeDeltaTickVolume() using the SCGraphData of another chart? The only solution is to manually add the study to the chart window?
[2015-12-18 06:51:59]
Sierra Chart Engineering - Posts: 104368
Yes this is a correct understanding. In a future version, it will be possible to programmatically add the study to the other chart but that is not supported right now.
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: 2015-12-18 09:23:59
[2015-12-18 09:14:29]
Jayturn - Posts: 15
Ok great, thanks for the information Sierra Chart Engineering. I'll look for another way to handle the handle the retrieval of data. Appreciate the assistance.
[2015-12-18 09:24:29]
Sierra Chart Engineering - Posts: 104368
We need to make a correction in the prior message from us. We meant to say:
"to programmatically add the study to the other chart"
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