如何在不使用 [MetaTrader 终端] 的情况下从任何 [MetaTrader 服务器] 获取交易账户的历史记录?

How to get a trading account's history from any [ MetaTrader Server ] without using a [ MetaTrader Terminal ]?

有没有办法在没有 MT 终端的情况下从 C# 中的任何 MT 服务器获取交易账户的历史记录?

我们有:

如果您有经理帐户,您应该使用经理 API 来获取它,您可以创建自己的包装器或使用现有包装器之一,例如 MetaTrader4.Manager.Wrapper。对于 MT5,您可以从 metaquotes 获得官方的。

如果您有客户账户,则没有官方途径获取,您必须打开 MT4 终端,但是,也有一些项目可能对您有所帮助,例如。 nj4x

实际上是的,您可以像您提到的那样直接获取它,而无需任何 API。
只需发送一个套接字到 MT4 服务器即可。
这是来自官方支持网站的功能。

USERHISTORY - receiving of history of user's account.

Format:
USERHISTORY-login=_login_|password=_password_|from=_from_|to=_to_


Description:
The command is intended for receiving history of operations made within a given timeframe.

Parameters:
login - account number;
password - user's password;
from - the start of the requested timeframe in Unix timestamp format;
to - the end of the requested timeframe in Unix timestamp format.

Example:

// 1. Start Session.
$ptr=fsockopen('192.168.0.1',443);
// error check
if (!$ptr){
  echo "Connection error";
  exit;
}
// 2. Send request to MT4
fputs($ptr,"WUSERHISTORY-login=55555|password=55555|from=1117551473|to=1120143473\nQUIT\n");
// 3. Reading and processing server responses
while(!feof($ptr))
  {
   // read line of symbols
   $line=fgets($ptr,128); 
   // the symbol of the end of result transfer
   if($line=="end\r\n") break; 
   // process
   print $line; 
   $buf .= $line; 
  }
// 4. Session completion
  fclose($ptr);