Login Page - Create Account

Support Board


Date/Time: Sun, 05 May 2024 15:30:44 +0000



Post From: ACSIL How to get the time for a bar index in a second Chart?

[2015-08-13 10:32:07]
Jayturn - Posts: 15
Can someone please point me to some documentation regarding how to access the DateTime at a bar index that is from a second chart? This is an example of what I need to do:


// Define the subgraphs we will be working with.
SCGraphData secondGraph;

// Get the base data for the second chart.
sc.GetChartBaseData(2, secondGraph);

// Define the first and last bars of the session for the second chart.
secondGraphEndBar = sc.GetNearestMatchForDateTimeIndex(2, sc.Index - 1);
secondGraphStartBar = sc.GetNearestMatchForSCDateTime(2, secondGraphEndBar);

// Loop through the bars.
for (int Index = secondGraphStartBar; Index <= secondGraphEndBar; Index++)
{
  // Get the time at the current index for the second chart?
  SCDateTime currIndexTime = ???
}

I know how to convert an index/DateTime from the main graph to an index in a different chart but I'm not sure how to reverse the procedure.