import json

with open("hybrid/data/ohlcv_M5.json", "r") as f:
    m5 = json.load(f)["bars"]

timestamps = [
    "2026-06-25T07:45:00Z",
    "2026-06-25T10:30:00Z",
    "2026-06-25T11:30:00Z"
]

for ts in timestamps:
    print(f"\n--- {ts} ---")
    for i, b in enumerate(m5):
        if b["timestamp"] >= ts:
            window = m5[max(0, i-10):i+5]
            for wb in window:
                mark = " <--" if wb["timestamp"] == ts else ""
                print(f"  {wb['timestamp']}: O={wb['open']} H={wb['high']} L={wb['low']} C={wb['close']}{mark}")
            break
