Login Page - Create Account

Support Board


Date/Time: Thu, 25 Apr 2024 15:42:07 +0000



Find Max/Min within specific time range [SPREADSHEET]

View Count: 426

[2021-10-19 19:17:21]
User355030 - Posts: 163
Is there a way to grab the max and min values within specific time ranges? e.g. max value within asia markets?

@TOMGILB
[2021-10-19 21:34:07]
Sawtooth - Posts: 3976
It will require 4 Formula Columns.
Try this:

1. Put this in a Formula Column, e.g. O3:
=MROUND(A3,1/86400000)
This rounds the timestamp to the millisecond to remove any floating point imprecision.

2. Put this in another Formula Column, e.g. P3:
=IF(OR(FRACTIME(O3)>=TIMEVALUE("20:00:00"),FRACTIME(O3)<TIMEVALUE("02:00:00")),E3,0)
where the start time is 20:00:00 and the end time is 02:00:00.
This will return the Close price between the times, else 0.
(If the start time is less than the end time, replace OR with AND.)

3. Find the max in P3, e.g. in Q3:
=IF(P3>0,MAX(Q4,P3),0)
This will return the max Close price between the times.

4. Find the min in P3, e.g. in R3:
=IF(AND(P4=0,P3>0),P3,MIN(R4,P3))
This will return the min Close price between the times.

This example assumes the chart bars are time based and have bars timestamped with the chosen start and end times.

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

Login

Login Page - Create Account