Support Board
Date/Time: Sun, 02 Feb 2025 14:54:59 +0000
[Programming Help] - Color Bar Based On A Range Of Data
View Count: 974
[2019-09-21 19:31:40] |
User240019 - Posts: 112 |
In order to reference a range of data within a specific Subgraph, use the format IDx.SGy[b:e] where x is the ID of the particular study, y is the Subgraph number of the study (or chart), b is the beginning data reference, and e is the ending data reference.
For example, to calculate the average of the last 10 bars for the Open of the Main Price Graph, the formula would be AVERAGE(ID0.SG1[0:-10]). When the data being referenced is part of the given chart, then it is not necessary to use the ID portion of the formula. For example, if writing a Chart alert from the Chart >> Chart Settings >> Alerts tab, and comparing the Average of the Open prices in the Main Price Graph against a constant, you could enter just the following: =AVERAGE(SG1[0:-10]) > 100 or =AVERAGE(O[0:-10]) > 100. This does not work with this formula as I'm getting a #VALUE! error. I'm trying to color a renko bar the moment my calculated values hits a certain threshold. =ID20.SG13[0:-10] >=1300 I'm referencing numbers bars calculated values of the total volume. |
[2019-09-22 16:44:48] |
Sierra Chart Engineering - Posts: 104368 |
You cannot do a comparison to an array of values. This is just not going to work. You must interpret what you are writing literally.
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 |
[2019-09-22 16:53:18] |
User240019 - Posts: 112 |
Understood. Is there any way to export the volume of the bar to a point in time and evaluate it on close that you're not evaluating an array but rather a single value just a point in time? |
[2019-09-23 15:12:34] |
Sierra Chart Engineering - Posts: 104368 |
You would have to reduce the time frame per chart bar to access the volume for that particular time and period.
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: