MQL4命令中文详解手册 下载本文

内容发布更新时间 : 2024/5/28 11:29:36星期一 下面是文章的全部内容请认真阅读。

MQL4Reference MQL4命令手册

(本手册采用Office2007编写)

2010年2月

1

目录

MQL4 Reference ............................................................................................................................... 1 MQL4命令手册 ................................................................................................................................ 1 Basics基础 ...................................................................................................................................... 12

Syntax语法 ............................................................................................................................. 12

Comments注释 .............................................................................................................. 12 Identifiers标识符 ........................................................................................................... 12 Reserved words保留字 .................................................................................................. 13 Data types数据类型 .............................................................................................................. 13

Type casting类型转换 .................................................................................................... 14 Integer constants整数常量 ............................................................................................ 14 Literal constants字面常量 ............................................................................................. 14 Boolean constants布尔常量 .......................................................................................... 15 Floating-point number constants (double)浮点数常量(双精度) ............................. 15 String constants字符串常量 .......................................................................................... 15 Color constants颜色常数 ............................................................................................... 16 Datetime constants日期时间常数 ................................................................................ 16 Operations & Expressions操作表达式 .................................................................................. 17

Expressions表达式 ......................................................................................................... 17 Arithmetical operations算术运算 ................................................................................. 17 Assignment operation赋值操作 .................................................................................... 17 Operations of relation操作关系 .................................................................................... 18 Boolean operations布尔运算 ........................................................................................ 18 Bitwise operations位运算 .............................................................................................. 19 Other operations其他运算 ............................................................................................ 19 Precedence rules优先规则 ............................................................................................ 20 Operators操作符 ................................................................................................................... 21

Compound operator复合操作符 ................................................................................... 21 Expression operator表达式操作符 ............................................................................... 21 Break operator终止操作符 ........................................................................................... 21 Continue operator继续操作符 ...................................................................................... 22 Return operator返回操作符 .......................................................................................... 22 Conditional operator if-else条件操作符 ....................................................................... 23 Switch operator跳转操作符 .......................................................................................... 23 Cycle operator while循环操作符while ......................................................................... 24 Cycle operator for循环操作符for ................................................................................. 24 Functions函数 ........................................................................................................................ 25

Function call函数调用 ................................................................................................... 26 Special functions特殊函数 ............................................................................................ 27 Variables变量 ................................................................................................................. 27 Local variables局部变量 ................................................................................................ 28 Formal parameters形式变量 ......................................................................................... 28

2

Static variables静态变量 ............................................................................................... 29 Global variables全局变量 .............................................................................................. 29 Defining extern variables外部定义变量 ........................................................................ 30 Initialization of variables初始化变量 ............................................................................ 30 External functions definition外部函数的定义 .............................................................. 30 Preprocessor预处理 .............................................................................................................. 31

Constant declaration常量声明 ...................................................................................... 31 Controlling compilation编译控制 .................................................................................. 32 Including of files包含文件 ............................................................................................. 32 Importing of functions导入功能.................................................................................... 33

Standard constants标准常数 ......................................................................................................... 35

Series arrays系列数组 ........................................................................................................... 35 Timeframes图表周期时间 .................................................................................................... 35 Trade operations交易操作 .................................................................................................... 36 Price constants价格常数 ....................................................................................................... 36 MarketInfo市场信息识别符 .................................................................................................. 36 Drawing styles画线风格 ........................................................................................................ 37 Arrow codes预定义箭头 ....................................................................................................... 38 Wingdings宋体 ...................................................................................................................... 39 Web colors颜色常数 .............................................................................................................. 39 Indicator lines指标线 ............................................................................................................. 40 Ichimoku Kinko Hyo................................................................................................................. 41

Moving Average methods移动平均方法 .............................................................................. 41 MessageBox信息箱 ............................................................................................................... 41 Object types对象类型 ........................................................................................................... 43 Object properties对象属性 ................................................................................................... 44 Object visibility ........................................................................................................................ 45 Uninitialize reason codes撤销初始化原因代码 .................................................................... 45 Special constants特别常数 .................................................................................................... 46 Error codes错误代码 ............................................................................................................. 46 Predefined variables预定义变量 ........................................................................................... 50

Ask最新卖价 .................................................................................................................. 50 Bars柱数 ......................................................................................................................... 50 Bid最新买价 .................................................................................................................. 50 Close[]收盘价 ................................................................................................................. 51 Digits汇率小数位 ........................................................................................................... 51 High[]最高价 ................................................................................................................... 51 Low[]最低价 .................................................................................................................... 52 Open[]开盘价 ................................................................................................................. 53 Point点值 ....................................................................................................................... 53 Time[]开盘时间 .............................................................................................................. 53 Volume[]成交量 .............................................................................................................. 54

Program Run程序运行 ................................................................................................................... 56

Program Run程序运行 ........................................................................................................... 56

3