import json

def get_ohlcv(filename, start_time, end_time):
    with open(filename, 'r') as f:
        data = json.load(f)
    return [c for c in data['bars'] if start_time <= c['time'] <= end_time]

h4_candles = get_ohlcv('/home/aryy/.hermes/profiles/finance/backtests/xauusd_2026/hybrid/data/ohlcv_H4.json', '2026-04-12T00:00:00Z', '2026-04-16T00:00:00Z')
h1_candles = get_ohlcv('/home/aryy/.hermes/profiles/finance/backtests/xauusd_2026/hybrid/data/ohlcv_H1.json', '2026-04-14T00:00:00Z', '2026-04-16T00:00:00Z')

print("H4 Candles:")
for c in h4_candles:
    print(f"{c['time']} O:{c['open']} H:{c['high']} L:{c['low']} C:{c['close']}")

print("\nH1 Candles:")
for c in h1_candles:
    print(f"{c['time']} O:{c['open']} H:{c['high']} L:{c['low']} C:{c['close']}")
