Support Board
Date/Time: Fri, 27 Dec 2024 12:02:05 +0000
Post From: ACSIL - sc.CumulativeDeltaTickVolume with multiple charts failing to return data
[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? |