Skip to content

TICK_HISTORY Command

Gets tick history data between two dates of a specified symbol.

Help
{
   "MSG":"HELP",
   "COMMAND":"TICK_HISTORY",
   "DESCRIPTION":"Gets tick history data between two dates of a specified symbol",
   "MANDATORY_TAGS":[
      "SYMBOL (String)",
      "FLAGS (String)",
      "FROM_DATE (String)",
      "TO_DATE (String)"
   ],
   "OPTIONAL_TAGS":[
      null
   ],
   "ERROR_ID":0,
   "ERROR_DESCRIPTION":"no error"
}

FLAGS values:

  • COPY_TICKS_INFO
  • COPY_TICKS_TRADE
  • COPY_TICKS_ALL

Example

Single Line command (necessary for MTsocketAPI):

{"MSG":"TICK_HISTORY", "SYMBOL":"EURUSD", "FLAGS":"COPY_TICKS_ALL", "FROM_DATE":"2025.09.30 20:05:00", "TO_DATE": "2025.09.30 20:10:00"}

Same command in Beauty Format:

{
   "MSG":"TICK_HISTORY",
   "SYMBOL":"EURUSD",
   "FLAGS":"COPY_TICKS_ALL",
   "FROM_DATE":"2025.09.30 20:05:00",
   "TO_DATE":"2025.09.30 20:10:00"
}

MTsocketAPI reply:

{
   "MSG":"TICK_HISTORY",
   "SYMBOL":"EURUSD",
   "RATES":[
      {
         "TIME":"2025.09.30 20:05:00",
         "ASK":1.04053,
         "HIGH":1.04158,
         "BID":1.03899,
         "FLAGS":1158,
         "LAST":0,
         "TIME_MSC":"2025.09.30 20:05:00.117",
         "VOLUME":0,
         "VOLUME_REAL":0
      }
   ],
   "ERROR_ID":0,
   "ERROR_DESCRIPTION":"The operation completed successfully"
}
Warning

Be careful with this command. If you retrieve millions of rows from MT5 the performance may worsen visibly while processing a big amount of data.

Important

If you haven't downloaded that tick data before, MT5 does not yet have the data downloaded. Then it will return an error and it will start download it. You must ask for the data again until you don't receive any error.