Hi Alan1111S, very nice Ea with some pretty good ideas. I do have a question. why didn't you use a single datetime variable instead of those 6 Nyear...Nsec variables? Did you do it because if you leave Nyear ...Nday at 0 it trades every day? Just ...