Support Board
Date/Time: Sun, 11 May 2025 21:01:55 +0000
[Programming Help] - Referencing Studies Across Charts with Different Timeframes
View Count: 298
[2024-08-07 19:54:24] |
Gradient - Posts: 122 |
Hi, I'm attempting to reference studies on one chart (i.e. Daily) on a different chart (i.e. 30 minute) within the same chartbook. I've implemented the sc.GetStudyArraysFromChartUsingID() method but found that these charts must have the same timeframes in order to reference the study. How can I reference the output of a study with a different timeframe than my main chart? These values don't need to be updated every bar, just sampled initially and persist in the main chart throughout the session. I tried a manually implementation of this by checking the current time and then referencing the other chart and storing the data point in a persistent variable, but this didn't work. Thanks |
[2024-08-07 20:12:44] |
Gradient - Posts: 122 |
I developed a solution. I had to attach a spreadsheet to one chart (i.e. Daily). This stores all of the studies. I then, on the secondary chart, could use the sc.GetSheet.....methods referenced here:ACSIL Interface Members - Functions: sc.GetSheetCellAsDouble() I can now get studies between different timeframes. |
[2024-08-30 16:05:59] |
OctoPi - Posts: 41 |
Shoulda skipped all this pain and gotten our Octopi Trader Plugin. Reads any study value from any chart, including past and present values. All can be used for signals to enter, exit, modify, etc. /shameless advertising |
[2024-08-30 16:46:40] |
User719512 - Posts: 310 |
See sc.GetChartDateTimeArray
to get the date/time for the bars on the other chartSee also sc.GetContainingIndexForSCDateTime and sc.GetNearestMatchForSCDateTime
Just how GetStudyArraysFromChartUsingID gets you the values, GetChartDateTimeArray gets you the datetime for those bars. When dealing with different timeframes, you need to decide how to handle matching bars/times/signals. |
To post a message in this thread, you need to log in with your Sierra Chart account: