Sliding windows of time? e.g. 1 day bars from 2.37am to 2.37am? Possible?

Back to topics list To post a new topic, please log in or register
2ndTime 2014.03.27 08:37

Hi There

I have a need to read indicators and bars values based on a 4 hour window, but always updated to refer to a 4 hour bar ending at the latest tick. So instead of finding out the 4 hour low, high, etc only every 4 hours (12am, 4am, 8am, 12pm etc...), I need to read these values for the last 4 hour period from any arbitrary moment in time - like 2.37am. So I need a 4 hour bar ending at 2.37am, and historical indicators working also from those offset times.

How can I do this, without rewriting the bars and indicators code?


GumRai 2014.03.27 09:34 #

Find the datetime of current time - (4*60*60)

iBarShift to find the bar relating to that datetime on the M1 chart

Use iHigh and iHighest to find the high between bar0 and the shift on the M1 chart

iLow and iLowest to find the low

Back to topics list  

To add comments, please log in or register