MT4智能交易编程教程-客户端属性
有关客户端信息包含在两种函数中,TerminalInfoInteger()和TerminalInfoString()。对于参量来说,这些函数分别从ENUM_TERMINAL_INFO_INTEGER 和 ENUM_TERMINAL_INFO_STRING中接收值。
ENUM_TERMINAL_INFO_INTEGER
标识符
描述
类型
TERMINAL_BUILD
客户端构造编号
int
TERMINAL_CONNECTED
连接的交易服务器
bool
TERMINAL_DLLS_ALLOWED
使用DLL许可
bool
TERMINAL_TRADE_ALLOWED
允许交易
bool
TERMINAL_EMAIL_ENABLED
在制定终端允许使用SMTP-server 和 login发送邮件
bool
TERMINAL_FTP_ENABLED
在制定终端允许使用FTP-server 和 login发送报告
bool
TERMINAL_MAXBARS
图表中的最大字节
int
TERMINAL_CODEPAGE
在客户端建立的 语言代码页 数字
int
TERMINAL_CPU_CORES
The number of CPU cores in the system
int
TERMINAL_DISK_SPACE
Free disk space for the MQL5\Files folder of the terminal (agent), MB
int
TERMINAL_MEMORY_PHYSICAL
Physical memory in the system, MB
int
TERMINAL_MEMORY_TOTAL
Memory available to the process of the terminal (agent), MB
int
TERMINAL_MEMORY_AVAILABLE
Free memory of the terminal (agent) process, MB
int
TERMINAL_MEMORY_USED
Memory used by the terminal (agent), MB
int
TERMINAL_X64
Indication of the "64-bit terminal"
bool
TERMINAL_OPENCL_SUPPORT
The version of the supported OpenCL in the format of 0x00010002 = 1.2. "0" means that OpenCL is not supported
int
只能在两种目录下执行文件操作 ;使用TERMINAL_DATA_PATH 和 TERMINAL_COMMONDATA_PATH 要求特征包括相似路径。
ENUM_TERMINAL_INFO_STRING
标识符
描述
类型
TERMINAL_LANGUAGE
Language of the terminal
string
TERMINAL_COMPANY
公司名称
string
TERMINAL_NAME
程序端名称
string
TERMINAL_PATH
程序端文件夹启动
string
TERMINAL_DATA_PATH
程序端数据文件夹存储
string
TERMINAL_COMMONDATA_PATH
电脑中所有程序端的普通路径
string
为更好的了解路径,存储在TERMINAL_PATH, TERMINAL_DATA_PATH 和 TERMINAL_COMMONDATA_PATH参量中的属性,推荐使用脚本,它可以通过当前复制的客户端的来返回这些值。
示例:脚本返回的有关客户端路径的信息
//+------------------------------------------------------------------+
//| Check_TerminalPaths.mq5 |
//| Copyright 2009, MetaQuotes Software Corp. |
//| http://www.mql5.com |
//+------------------------------------------------------------------+
#property copyright "2009, MetaQuotes Software Corp."
#property link "http://www.mql5.com"
#property version "1.00"
//+------------------------------------------------------------------+
//| 脚本程序启动函数 |
//+------------------------------------------------------------------+
void OnStart()
{
//---
Print("TERMINAL_PATH = ",TerminalInfoString(TERMINAL_PATH));
Print("TERMINAL_DATA_PATH = ",TerminalInfoString(TERMINAL_DATA_PATH));
Print("TERMINAL_COMMONDATA_PATH = ",TerminalInfoString(TERMINAL_COMMONDATA_PATH));
} |