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
You are missing trading opportunities:
- Free trading apps
- Over 8,000 signals for copying
- Economic news for exploring financial markets
Registration
Log in
You agree to website policy and terms of use
If you do not have an account, please register
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?
Thanks!