Support Board
Date/Time: Fri, 07 Feb 2025 15:22:05 +0000
Summation and Color bar based on alert condition issue
View Count: 888
[2022-03-24 15:05:44] |
AndyB - Posts: 105 |
I am using 'color bar based on alert condition' to print specific values in a chart im using. using input data when condition is true and evaluating on bar close. then, i am using the summation study to sum these values. this works fine looking backwards and when i refresh the chart, but not when it runs live uninterrupted. the summation study is continuously adding values from the 'color bar based on alert condition' study, regardless of if the study ends up even printing anything. almost as if the summation is using the earliest values instead of the last values. I need it to sum the final printed values in real time, not just when i refresh the chart. attached are two screenshots. because this summation is done on a tick chart, I overlaid it to a 1 minute chart so you can see more clearly what im referring to. the first image is before i refreshed the source chart to "reset" that summation, and the second is after i refreshed. https://www.sierrachart.com/image.php?Image=1648133797537.png https://www.sierrachart.com/image.php?Image=1648134060356.png finally, here is the source chart where you can see the two summation studies adding to themselves with no prints, leaving erroneous values. I hope my explanation makes sense https://www.sierrachart.com/image.php?Image=1648134156908.png |
[2022-03-24 16:57:35] |
John - SC Support - Posts: 37810 |
We are not sure exactly the setup you using, so it would be easiest for us to take a look at the chart and see how it is setup. To get us a chartbook with just the one chart follow these instructions: Support Board Posting Information: Providing Chartbook with Only a Single Chart For the most reliable, advanced, and zero cost futures order routing, use the Teton service: Sierra Chart Teton Futures Order Routing |
[2022-03-24 17:16:48] |
AndyB - Posts: 105 |
I included the higher time frame chart with overlays of the summations so you can observe more easily what im talking about. I also swapped out the color bar based on alert condition study for the spreadsheet formula study, and am still getting the same result.
|
![]() Attachment Deleted. |
[2022-03-24 22:20:13] |
John - SC Support - Posts: 37810 |
The issue is that the data is changing within the current bar, but it is getting added to the summation before it changes. In the end, this is due to the fact that you are looking at a 1 trade chart, but there is a minimum value for the Chart Update Interval, so the values are not exact for the current bar since the studies have not all been updated at every tick. The solution is to look back by 1 bar so that the data for that previous bar has been properly updated when the Spreadsheet Formula is invoked for the current bar. To do this, you would need to change your formulas to look like the following: =IF(ID6.SG1[-1]>0,ID6.SG1[-1],0) Note that you do not need the "0+ID6.SG1", just having "ID6.SG1" is enough. The [-1] indicates to use the bar just before the last bar. For the most reliable, advanced, and zero cost futures order routing, use the Teton service: Sierra Chart Teton Futures Order Routing |
[2022-03-24 22:23:26] |
AndyB - Posts: 105 |
wonderful! thank you. not sure how the 0+xyz got in there, must have been copied from a spreadsheet attempting to do the same thing in a roundabout way. this is good to know, thanks John!
|
To post a message in this thread, you need to log in with your Sierra Chart account: