MT5 Client API quote history (OHLC)

easy direct connection to any MT4 and MT5 server

MT5 Client API quote history (OHLC)

Available 2 functions:

  • DownloadQuoteHistoryMonth(to get history for 30 days)
  • DownloadQuoteHistoryToday(to get history for last day).

If need history for more than one month need to use DownloadQuoteHistoryMonth several times.

var api = new MT5API(5005878206, "eggzbi8z", "access.metatrader5.com", 443);
api.Connect();
Console.WriteLine("Connected");
var res = api.DownloadQuoteHistoryMonth("EURUSD", 2023, 2, 1, 240);
var m5Bars = api.ConvertToTimeframe(Bars, 5);
Console.WriteLine("Press any key to quit...");
Console.ReadKey();

Leave a Reply