Logo

    PRICE_HISTORY

    Description

    Provides history data of prices including Open, High, Low, and Close values of a specified symbol and timeframe.

    Important

    All JSON commands you send to MetaSocket should be in a single line format similar to the examples below. Additionally, example replies in this page are presented in a "beautified" format for presentation purposes. Actual replies are always returned in a single line.

    Example

    {"MSG": "PRICE_HISTORY","SYMBOL": "EURUSD","TIMEFRAME": "PERIOD_H1","FROM_DATE": "2025/08/14 00: 00: 00","TO_DATE": "2025/08/14 23: 59: 59"}

    Reply

    {
    "MSG": "PRICE_HISTORY",
    "SYMBOL": "EURUSD",
    "TIMEFRAME": "PERIOD_H1",
    "RATES": [
    {
    "TIME": "2025.08.14 23:00:00",
    "OPEN": 1.1648,
    "HIGH": 1.165,
    "LOW": 1.16442,
    "CLOSE": 1.16483,
    "REAL_VOLUME": 0,
    "TICK_VOLUME": 1302,
    "SPREAD": 0
    },
    {
    "TIME": "2025.08.14 22:00:00",
    "OPEN": 1.16413,
    "HIGH": 1.16502,
    "LOW": 1.16412,
    "CLOSE": 1.16479,
    "REAL_VOLUME": 0,
    "TICK_VOLUME": 2013,
    "SPREAD": 0
    },
    {
    "TIME": "2025.08.14 21:00:00",
    "OPEN": 1.16367,
    "HIGH": 1.16422,
    "LOW": 1.16326,
    "CLOSE": 1.16413,
    "REAL_VOLUME": 0,
    "TICK_VOLUME": 2421,
    "SPREAD": 0
    },
    {
    "TIME": "2025.08.14 20:00:00",
    "OPEN": 1.16342,
    "HIGH": 1.16433,
    "LOW": 1.1631,
    "CLOSE": 1.16364,
    "REAL_VOLUME": 0,
    "TICK_VOLUME": 2763,
    "SPREAD": 0
    },
    {
    "TIME": "2025.08.14 19:00:00",
    "OPEN": 1.16429,
    "HIGH": 1.16452,
    "LOW": 1.16306,
    "CLOSE": 1.16342,
    "REAL_VOLUME": 0,
    "TICK_VOLUME": 3836,
    "SPREAD": 0
    },
    {
    "NOTE": "REDACTED FOR BREVITY"
    },
    {
    "TIME": "2025.08.14 01:00:00",
    "OPEN": 1.17037,
    "HIGH": 1.17079,
    "LOW": 1.17036,
    "CLOSE": 1.17079,
    "REAL_VOLUME": 0,
    "TICK_VOLUME": 969,
    "SPREAD": 0
    },
    {
    "TIME": "2025.08.14 00:00:00",
    "OPEN": 1.17021,
    "HIGH": 1.17052,
    "LOW": 1.16956,
    "CLOSE": 1.17043,
    "REAL_VOLUME": 0,
    "TICK_VOLUME": 720,
    "SPREAD": 0
    }
    ],
    "ERROR_ID": 0,
    "ERROR_DESCRIPTION": "no error",
    "DEMO": "MetaSocket running in DEMO mode"
    }