import json

data_dir = "/home/aryy/.hermes/profiles/finance/backtests/xauusd_2026/hybrid/data"

with open(f"{data_dir}/ohlcv_H4.json", "r") as f:
    h4 = json.load(f)
with open(f"{data_dir}/ohlcv_H1.json", "r") as f:
    h1 = json.load(f)

# The data format might be different. Let's print the first row to see.
print("H4 first row:", h4[0] if h4 else "Empty")
print("H1 first row:", h1[0] if h1 else "Empty")

# Now let's try to find our dates assuming the format is a list of lists or different key names.
if h4 and isinstance(h4[0], list):
    # Assuming standard format: [time, open, high, low, close, volume]
    print("\nH4 data for April 19-21:")
    for row in h4:
        # Check if time is string or int/timestamp
        if isinstance(row[0], str) and "2026-04-19" <= row[0] <= "2026-04-22":
             print(f"{row[0]}: O={row[1]} H={row[2]} L={row[3]} C={row[4]}")
        elif isinstance(row[0], (int, float)):
             # We might need to convert timestamp if it's not a string, but let's hope it's string.
             pass

    print("\nH1 data for April 21 (06:00 to 14:00):")
    for row in h1:
        if isinstance(row[0], str) and "2026-04-21T06:00" <= row[0] <= "2026-04-21T14:00":
             print(f"{row[0]}: O={row[1]} H={row[2]} L={row[3]} C={row[4]}")
