//+------------------------------------------------------------------+
//| EA交易初始化函数 |
//+------------------------------------------------------------------+
void OnStart()
{
//--- 获取操作系统和程序端数据
string os_ver = TerminalInfoString(TERMINAL_OS_VERSION); // 用户的操作系统
string name = TerminalInfoString(TERMINAL_NAME); // 程序端名称
string path = TerminalInfoString(TERMINAL_PATH); // 启动程序端的文件夹
string data = TerminalInfoString(TERMINAL_DATA_PATH); // 存储程序端数据的文件夹
string common = TerminalInfoString(TERMINAL_COMMONDATA_PATH); // 计算机上安装的所有客户端的公用文件夹
//--- 将获得的数据发送到日志
PrintFormat("OS: %s\nTerminal: %s\n- Path: %s\n- Data path: %s\n- Common Data path: %s", os_ver, name, path, data, common);
/*
OS: Windows 10 build 19045
Terminal: MetaTrader 5
- Path: E:\MetaQuotes\MetaTrader 5
- Data path: E:\MetaQuotes\MetaTrader 5
- Common Data path: C:\Users\admin\AppData\Roaming\MetaQuotes\Terminal\Common
*/
}
|