Source code
Align M15 and H1 signals without reading an unfinished hour
A multi-timeframe rule has more than one clock. A closed M15 candle does not imply that the H1 candle containing it has closed. Correct timestamp alignment makes the strategy description match what was actually knowable at the decision time.
Map time rather than index
iBarShift finds the candle index corresponding to a time and offers exact or nearest-bar behaviour when matching history. Check a missing result before reading a buffer. An index on one timeframe is not the same timestamp on another.
Walk through an example
At 10:15, the hourly candle that began at 10:00 is still forming in a conventional hourly series. A rule requiring a completed hourly signal would use the previous completed hour. The example is about information timing, not a recommendation for a particular entry.
Log both candle times
For a few decisions, record the lower-timeframe signal time, selected hourly open time and selected buffer value. Repeat near the hourly boundary and a history gap. Review these rows alongside the chart instead of judging only the final profit.
Write a precise AI request
Specify whether the higher-timeframe value may change before its candle closes. Ask AI to make the data-ready check and timestamp selection visible. This is a small source change with a clear acceptance condition: each signal uses only the intended available candle.
Back to top












