import json

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

def print_bars(timeframe, start_time, end_time):
    with open(f"{data_dir}/ohlcv_{timeframe}.json", "r") as f:
        data = json.load(f)
    
    print(f"\n{timeframe} data for {start_time} to {end_time}:")
    for bar in data.get('bars', []):
        time_str = bar['time']
        if isinstance(time_str, int):
            # We don't have the simple string format here... 
            # let's assume it might be a timestamp or wait, M5 data might just have timestamps.
            # Actually, I'll just print out a slice.
            pass
        elif start_time <= bar['time'] <= end_time:
            print(f"{bar['time']}: O={bar['open']} H={bar['high']} L={bar['low']} C={bar['close']}")

# Check what time type is for M5
with open(f"{data_dir}/ohlcv_M5.json", "r") as f:
    m5_data = json.load(f)
if m5_data.get('bars'):
    print(type(m5_data['bars'][0]['time']))
    print(m5_data['bars'][0])
