I'm working my way thru the Jackal and Tomansini book and I understand that the strategy is not profitable.
After they present the strategy as you have written above, the next step in the book is to "optimize" the "profitabe" strategy by adding a timefilter.
in the book's example they study a 4 hour trading time window shifting the starting time 30 minutes thoughout the day.
I was going to try var starttime = optimize() but some of the values can't be zero. When you use var endtime = optimize() the clock isn't linear so that won't work.
I found the hour() time variable and can make that work for a specific time period, but I'm having trouble trying to shift the starting times as they do. in the book. The only idea I have is an array with each start time and end time defined and then go thru the array 1 time period at a time. Any other ideas?

Thanks

P