Support Board
Date/Time: Mon, 25 Nov 2024 10:22:13 +0000
[Programming Help] - Referencing Other Charts in Current Chart
View Count: 266
[2024-03-10 15:27:09] |
Gradient - Posts: 89 |
Hi, I'm attempting to load the BaseData from additional charts into the current chart. I've implemented the sc.GetChartBaseData example found here:sc.GetChartBaseData() The only changes I made were 1) my SCInputRef isn't "ChartNumber" it's "XLeg" 2) instead of requesting the HighArray, I'm requesting the LastArray. I then request the most accurate sc.Index from the ReferenceChart and store the most current last price in a subgraph array. However, no data is appearing from the Reference Chart. Can someone advise? Thanks Below is the code block: / Define a graph data object to get all of the base graph data SCGraphData BaseGraphData; //Note: Replaced ChartNumber with XLeg // Get the base graph data from the specified chart sc.GetChartBaseData(XLeg.GetInt(), BaseGraphData); // Define a reference to the High array (i.e. replaced High with Last) SCFloatArrayRef LastArray = BaseGraphData[SC_LAST]; // Array is empty. Nothing to do. if(LastArray.GetArraySize() == 0) return; // Get the index in the specified chart that is // nearest to current index. int RefChartIndex = sc.GetNearestMatchForDateTimeIndex(XLeg.GetInt(), sc.Index); float NearestRefChartLast = LastArray[RefChartIndex]; //store x sc.Subgraph[5][sc.Index]=NearestRefChartLast; |
[2024-03-10 16:07:46] |
Gradient - Posts: 89 |
UPDATE: After further investigation, it appears that this behavior is limited to replaying the chart. When connected to the data feed, the ReferenceChart BaseData is appearing on the current chart. How can the issue with loading the ReferenceChart during a replay backtest be resolved? Thanks |
To post a message in this thread, you need to log in with your Sierra Chart account: