Hi,

How would I create a 7 days low for the 7 preceding days to today (so todays price is excluded from the low calculation). 

For example:

day, low

T-7  54

T-6  56

T-5  52

T-4  61

T-3  62

T-2  64

T-1  63

Today  51

In this example the value of 52 is required.

The low for the preceding 7 days is 52 - I do not want to include today's price (51) in the calculation.

I have used:

hist = self.History(self.spy,timedelta(7), Resolution.Daily)
low=min(hist("low")

But the close price for today never breaks the low suggesting to me that today is included in the calculation when I would like it excluded.

 

Any help would be very welcome

Thanks

Simon