import json

def get_h4():
    with open('/home/aryy/.hermes/profiles/finance/backtests/xauusd_2026/hybrid/data/ohlcv_H4.json', 'r') as f:
        bars = json.load(f).get('bars', [])
    for b in bars:
        if b['time'] == '2026-07-08T01:00:00Z':
            h4_01 = b
        elif b['time'] == '2026-07-08T05:00:00Z':
            h4_05 = b
        elif b['time'] == '2026-07-08T09:00:00Z':
            h4_09 = b
    return h4_01, h4_05, h4_09

def get_m30():
    with open('/home/aryy/.hermes/profiles/finance/backtests/xauusd_2026/hybrid/data/ohlcv_M30.json', 'r') as f:
        bars = json.load(f).get('bars', [])
    m30_0330 = None
    m30_1130 = None
    for b in bars:
        if b['time'] == '2026-07-08T03:30:00Z':
            m30_0330 = b
        if b['time'] == '2026-07-08T11:30:00Z':
            m30_1130 = b
    return m30_0330, m30_1130

h4_01, h4_05, h4_09 = get_h4()
m30_0330, m30_1130 = get_m30()

print(f"H4 01:00: O:{h4_01['open']} H:{h4_01['high']} L:{h4_01['low']} C:{h4_01['close']}")
print(f"M30 03:30: O:{m30_0330['open']} H:{m30_0330['high']} L:{m30_0330['low']} C:{m30_0330['close']}")

print(f"H4 05:00: O:{h4_05['open']} H:{h4_05['high']} L:{h4_05['low']} C:{h4_05['close']}")
print(f"H4 09:00: O:{h4_09['open']} H:{h4_09['high']} L:{h4_09['low']} C:{h4_09['close']}")
print(f"M30 11:30: O:{m30_1130['open']} H:{m30_1130['high']} L:{m30_1130['low']} C:{m30_1130['close']}")

