Login Page - Create Account

Support Board


Date/Time: Sat, 12 Jul 2025 12:15:18 +0000



[Programming Help] - Mark the most recent pair

View Count: 103

[2025-06-24 22:15:31]
User14953 - Posts: 256
How to use a spreadsheet formula to plot markers on each of only the most recent pair of higher high closes?
[2025-06-25 12:31:08]
Sierra_Chart Engineering - Posts: 20184
We are marking this as programming help.
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, use the Teton service:
Sierra Chart Teton Futures Order Routing
[2025-06-25 14:43:37]
Sawtooth - Posts: 4238
How to use a spreadsheet formula to plot markers on each of only the most recent pair of higher high closes?
Try this:
- Add the Spreadsheet Study study, set the Chart Region to 1, and give it a name in the Spreadsheet Name field.
- Use these formulas in these cells:
K3: =IF(E3>K4,E3,K4) [this returns a persistent higher close]
L3: =K3<>K4 [this finds each higher close]
M3: =IF(L3=1,K3,M4) [this returns the most recent higher close]
N3: =IF(L3=1,M4,N4) [this returns the second most recent higher close]
O3: =OR(AND(L3=1,M3=M$3),AND(L3=1,M3=N$3)) [this isolates only the two most recent higher closes]
- Set all Draw Styles to Ignore, except set O(SG5) to Color Bar, or Point On High.

This uses an modification of this example:
Spreadsheet Example Formulas and Usage: Return Last Two Zig Zag Reversal Values
[2025-06-25 20:32:33]
User14953 - Posts: 256
Thank you Sawtooth.

Could something like this be done using an analysis study alert?
[2025-06-26 04:53:16]
Sawtooth - Posts: 4238
Could something like this be done using an analysis study alert?
It could be done with the Spreadsheet Formula study, and the Color Bar Based On Alert Condition study, but it would not limit the marker to the two most recent higher closes:

- Add the Spreadsheet Formula study, set the Chart Region to 1, Hide the study, and use a formula like this in its Formula field:
=IF(C>ID1.SG1[-1],C,ID1.SG1[-1])
where ID1 is this Spreadsheet Formula study.

- Add the Color Bar Based On Alert Condition study, and use a formula like this on its Alerts tab:
=ID1.SG1<>ID1.SG1[-1]

To post a message in this thread, you need to log in with your Sierra Chart account:

Login

Login Page - Create Account