设为首页 收藏本站 切换语言

【 mt4编程参考】把MQL4语言介绍的很全很细,做EA开发很棒的文档  

| 发表于 2020-4-15 10:01:14 | 显示全部楼层 |复制链接
语法 [Syntax]
代码格式
注释
标识符
保留字
数据类型 [Data types]
数据类型概述
Integer 类型
Literal 类型
Boolean 类型
Floating-point number 类型
String 类型
Color 类型
Datetime 类型
运算符和表达式 [Operations & Expressions]
表达式
算术运算符
赋值运算符
关系运算符
真假运算符
位逻辑运算符
其它运算符
优先级规则
操作符 [Operators]
格式和嵌套
复合操作符
表达式操作符
调用函数操作符
空操作符
停止操作符
继续操作符
返回操作符
条件操作符 if
条件操作符 if-else
选择操作符 switch
循环操作符 while
循环操作符 for
函数 [Function]
函数定义
函数调用
特殊函数 init()、deinit()和start()
变量 [Variables]
定义变量
定义基本类型
定义附加类型
定义数组类型
内部变量定义
函数参数定义
静态变量定义
全局变量定义
附加变量定义
初始化变量
基本类型
数组类型
外部函数引用
预处理程序 [Preprocessor]
定义常数
编译参数定义
嵌入文件
引入函数或其他模块
账户信息 [Account Information]
double AccountBalance()
double AccountCredit()
string AccountCompany()
string AccountCurrency()
double AccountEquity()
double AccountFreeMargin()
int AccountLeverage()
double AccountMargin()
string AccountName()
int AccountNumber()
double AccountProfit()
数组函数 [Array Functions]
int ArrayBsearch( double array[], double value, int count=WHOLE_ARRAY, int start=0, int direction=MODE_ASCEND)
int ArrayCopy( object& dest[], object source[], int start_dest=0, int start_source=0, int count=WHOLE_ARRAY)
int ArrayCopyRates( double& dest_array[], string symbol=NULL, int timeframe=0)
int ArrayCopySeries( double& array[], int series_index, string symbol=NULL, int timeframe=0)
int ArrayDimension( int array[])
bool ArrayGetAsSeries(object array[])
int ArrayInitialize( double& array[], double value)
bool ArrayIsSeries( object array[])
int ArrayMaximum( double array[], int count=WHOLE_ARRAY, int start=0)
int ArrayMinimum( double array[], int count=WHOLE_ARRAY, int start=0)
int ArrayRange( object array[], int range_index)
int ArrayResize( object& array[], int new_size)
bool ArraySetAsSeries( double& array[], bool set)
int ArraySize( object array[])
int ArraySort( double& array[], int count=WHOLE_ARRAY, int start=0, int sort_dir=MODE_ASCEND)
类型转换函数 [Conversion Functions]
string CharToStr( int char_code)
string DoubleToStr( double value, int digits)
double NormalizeDouble( double value, int digits)
double StrToDouble( string value)
int StrToInteger( string value)
datetime StrToTime( string value)
string TimeToStr( datetime value, int mode=TIME_DATE|TIME_MINUTES)
公用函数 [Common Functions]
void Alert( ... )
string ClientTerminalName()
string CompanyName()
void Comment( ... )
int GetLastError()
int GetTickCount()
void HideTestIndicators(bool hide)
bool IsConnected()
bool IsDemo()
bool IsDllsAllowed()
bool IsLibrariesAllowed()
bool IsStopped()
bool IsTesting()
bool IsTradeAllowed()
double MarketInfo( string symbol, int type)
int MessageBox( string text=NULL, string caption=NULL, int flags=EMPTY)
int Period()
void PlaySound( string filename)
void Print( ... )
bool RefreshRates()
void SendMail( string subject, string some_text)
string ServerAddress()
void Sleep( int milliseconds)
void SpeechText( string text, int lang_mode=SPEECH_ENGLISH)
string Symbol()
int UninitializeReason()
自定义指标函数 [Custom Indicator Functions]
void IndicatorBuffers(int count)
int IndicatorCounted()
void IndicatorDigits( int digits)
void IndicatorShortName( string name)
void SetIndexArrow( int index, int code)
bool SetIndexBuffer( int index, double array[])
void SetIndexDrawBegin( int index, int begin)
void SetIndexEmptyValue( int index, double value)
void SetIndexLabel( int index, string text)
void SetIndexShift( int index, int shift)
void SetIndexStyle( int index, int type, int style=EMPTY, int width=EMPTY, color clr=CLR_NONE)
日期时间函数 [Date & Time Functions]
datetime CurTime( )
int Day()
int DayOfWeek( )
int DayOfYear( )
int Hour()
datetime LocalTime()
int Minute()
int Month()
int Seconds()
int TimeDay( datetime date)
int TimeDayOfWeek( datetime date)
int TimeDayOfYear( datetime date)
int TimeHour( datetime time)
int TimeMinute( datetime time)
int TimeMonth( datetime time)
int TimeSeconds( datetime time)
int TimeYear( datetime time)
int TimeYear( datetime time)
文件处理函数 [File Functions]
void FileClose(int handle)
void FileDelete(string filename)
void FileFlush(int handle)
bool FileIsEnding(int handle)
bool FileIsLineEnding( int handle)
int FileOpen( string filename, int mode, int delimiter=';')
int FileOpenHistory( string filename, int mode, int delimiter=';')
int FileReadArray( int handle, object& array[], int start, int count)
double FileReadDouble( int handle, int size=DOUBLE_VALUE)
int FileReadInteger( int handle, int size=LONG_VALUE)
double FileReadNumber( int handle)
string FileReadString( int handle, int length=0)
bool FileSeek( int handle, int offset, int origin)
int FileSize( int handle)
int FileTell( int handle)
int FileWrite( int handle, ... )
int FileWriteArray( int handle, object array[], int start, int count)
int FileWriteDouble( int handle, double value, int size=DOUBLE_VALUE)
int FileWriteInteger( int handle, int value, int size=LONG_VALUE)
int FileWriteString( int handle, string value, int length)
全局变量函数 [Global Variables Functions]
bool GlobalVariableCheck( string name)
bool GlobalVariableDel( string name)
double GlobalVariableGet( string name)
double GlobalVariableGet( string name)
datetime GlobalVariableSet( string name, double value )
bool GlobalVariableSetOnCondition( string name, double value, double check_value)
void GlobalVariablesDeleteAll( )
数学运算函数 [Math & Trig]
double MathAbs( double value)
double MathArccos( double x)
double MathArcsin( double x)
double MathArctan( double x)
double MathCeil( double x)
double MathCos( double value)
double MathExp( double d)
double MathFloor( double x)
double MathLog( double x)
double MathMax( double value1, double value2)
double MathMin( double value1, double value2)
double MathMod( double value, double value2)
double MathPow( double base, double exponent)
int MathRand( )
double MathRound( double value)
double MathSin( double value)
double MathSqrt( double x)
void MathSrand( int seed)
double MathTan( double x)
物体函数 [Object Functions]
bool ObjectCreate( string name, int type, int window, datetime time1, double price1, datetime time2=0, double price2=0, datetime time3=0, double price3=0)
bool ObjectDelete( string name)
string ObjectDescription( string name)
int ObjectFind( string name)
double ObjectGet( string name, int index)
string ObjectGetFiboDescription( string name, int index)
int ObjectGetShiftByValue( string name, double value)
double ObjectGetValueByShift( string name, int shift)
bool ObjectMove( string name, int point, datetime time1, double price1)
string ObjectName( int index)
int ObjectsDeleteAll( int window, int type=EMPTY)
bool ObjectSet( string name, int index, double value)
bool ObjectSetFiboDescription( string name, int index, string text)
bool ObjectSetText( string name, string text, int font_size, string font=NULL, color text_color=CLR_NONE)
void ObjectsRedraw( )
int ObjectsTotal( )
int ObjectType( string name)
预定义变量 [Pre-defined Variables]
double Ask
int Bars
double Bid
double Close[]
int Digits
double High[]
double Low[]
double Open[]
double Point
datetime Time[]
double Volume[]
字符串函数 [String Functions]
string StringConcatenate( ... )
int StringFind( string text, string matched_text, int start=0)
int StringGetChar( string text, int pos)
int StringLen( string text)
string StringSetChar( string text, int pos, int value)
string StringSubstr( string text, int start, int count=EMPTY)
string StringTrimLeft( string text)
string StringTrimRight( string text)
标准常量 [Standard Constants]
Applied price enumeration价格类型枚举
Drawing shape style enumeration画图形状样式枚举
Error codes错误代码
交易服务器返回的错误
MT4返回的运行错误
Ichimoku Kinko Hyo modes enumeration Ichimoku指标模式枚举
Indicators line identifiers指标线标示符
Market information identifiers市场信息标识
MessageBox return codes消息窗口返回值
MessageBox behavior flags消息窗口行为代码
消息窗口显示图标的类型
消息窗口默认按钮设置
Moving Average method enumeration移动平均线模式枚举
Object properties enumeration物件属性枚举
Object type enumeration物件类型枚举
Object visibility enumeration物件显示枚举
Predefined Arrow codes enumeration预定义箭头代码枚举
Series array identifier系列数组标识符
Special constants特殊常量
Time frame enumeration特殊常量
Trade operation enumeration交易类型
Uninitialize reason codes末初始化理由代码
Wingdings symbols图形符号代码
技术指标调用 [Technical Indicator calls]
double iAC( string symbol, int timeframe, int shift)
double iAD( string symbol, int timeframe, int shift)
double iAlligator( string symbol, int timeframe, int jaw_period, int jaw_shift, int teeth_period, int teeth_shift, int lips_period, int lips_shift, int ma_method, int applied_price, int mode, int shift)
double iADX( string symbol, int timeframe, int period, int applied_price, int mode, int shift)
double iATR( string symbol, int timeframe, int period, int shift)
double iAO( string symbol, int timeframe, int shift)
double iBearsPower( string symbol, int timeframe, int period, int applied_price, int shift)
double iBands( string symbol, int timeframe, int period, int deviation, int bands_shift, int applied_price, int mode, int shift)
double iBandsOnArray( double array[], int total, int period, double deviation, int bands_shift, int mode, int shift)
double iBullsPower( string symbol, int timeframe, int period, int applied_price, int shift)
double iCCI( string symbol, int timeframe, int period, int applied_price, int shift)
double iCCIOnArray( double array[], int total, int period, int shift)
double iCustom( string symbol, int timeframe, string name, ... , int mode, int shift)
double iDeMarker( string symbol, int timeframe, int period, int shift)
double iEnvelopes( string symbol, int timeframe, int ma_period, int ma_method, int ma_shift, int applied_price, double deviation, int mode, int shift)
double iEnvelopesOnArray( double array[], int total, int ma_period, int ma_method, int ma_shift, double deviation, int mode, int shift)
double iForce( string symbol, int timeframe, int period, int ma_method, int applied_price, int shift)
double iFractals( string symbol, int timeframe, int mode, int shift)
double iGator( string symbol, int timeframe, int jaw_period, int jaw_shift, int teeth_period, int teeth_shift, int lips_period, int lips_shift, int ma_method, int applied_price, int mode, int shift)
double iIchimoku( string symbol, int timeframe, int tenkan_sen, int kijun_sen, int senkou_span_b, int mode, int shift)
double iBWMFI( string symbol, int timeframe, int shift)
double iMomentum( string symbol, int timeframe, int period, int applied_price, int shift)
double iMomentumOnArray( double array[], int total, int period, int shift)
double iMFI( string symbol, int timeframe, int period, int shift)
double iMA( string symbol, int timeframe, int period, int ma_shift, int ma_method, int applied_price, int shift)
double iMAOnArray( double array[], int total, int period, int ma_shift, int ma_method, int shift)
double iOsMA( string symbol, int timeframe, int fast_ema_period, int slow_ema_period, int signal_period, int applied_price, int shift)
double iMACD( string symbol, int timeframe, int fast_ema_period, int slow_ema_period, int signal_period, int applied_price, int mode, int shift)
double iOBV( string symbol, int timeframe, int applied_price, int shift)
double iSAR( string symbol, int timeframe, double step, double maximum, int shift)
double iRSI( string symbol, void timeframe, int period, int applied_price, int shift)
double iRSIOnArray( double array[], int total, int period, int shift)
double iRVI( string symbol, int timeframe, int period, int mode, int shift)
double iStdDev( string symbol, int timeframe, int ma_period, int ma_method, int ma_shift, int applied_price, int shift)
double iStdDevOnArray( double array[], int total, int ma_period, int ma_method, int ma_shift, int shift)
double iStochastic( string symbol, int timeframe, int %Kperiod, int %Dperiod, int slowing, int method, int price_field, int mode, int shift)
double iWPR( string symbol, int timeframe, int period, int shift)
int iBars( string symbol, int timeframe)
int iBarShift( string symbol, int timeframe, datetime time, bool exact=false)
double iClose( string symbol, int timeframe, int shift)
double iHigh( string symbol, int timeframe, int shift)
double iLow( string symbol, int timeframe, int shift)
double iOpen( string symbol, int timeframe, int shift)
datetime iTime( string symbol, int timeframe, int shift)
double iVolume( string symbol, int timeframe, int shift)
int Highest( string symbol, int timeframe, int type, int count=WHOLE_ARRAY, int start=0)
int Lowest( string symbol, int timeframe, int type, int count=WHOLE_ARRAY, int start=0)
交易函数 [Trading Functions]
int HistoryTotal( )
bool OrderClose( int ticket, double lots, double price, int slippage, color Color=CLR_NONE)
bool OrderCloseBy( int ticket, int opposite, color Color=CLR_NONE)
double OrderClosePrice( )
datetime OrderCloseTime( )
string OrderComment( )
double OrderCommission( )
bool OrderDelete( int ticket)
datetime OrderExpiration( )
double OrderLots( )
int OrderMagicNumber( )
bool OrderModify( int ticket, double price, double stoploss, double takeprofit, datetime expiration, color arrow_color=CLR_NONE)
double OrderOpenPrice( )
datetime OrderOpenTime( )
void OrderPrint( )
bool OrderSelect( int index, int select, int pool=MODE_TRADES)
int OrderSend( string symbol, int cmd, double volume, double price, int slippage, double stoploss, double takeprofit, string comment=NULL, int magic=0, datetime expiration=0, color arrow_color=CLR_NONE)
double OrderStopLoss( )
int OrdersTotal( )
int OrdersTotal( )
double OrderSwap( )
string OrderSymbol( )
double OrderTakeProfit( )
int OrderTicket( )
int OrderType( )
窗口函数 [Window Functions]
double PriceOnDropped( )
datetime TimeOnDropped( )
int WindowFind( string name)
int WindowHandle( string symbol, int timeframe)
bool WindowIsVisible( int index)
int WindowOnDropped( )
int WindowsTotal( )
int WindowXOnDropped( )

QQ截图20200414112210.png

mt4编程参考.doc

850.02 KB, 下载次数: 6, 下载积分: 活跃度 -5 售价: 1 H币  [记录]  [下载]

评分
  • 1
  • 2
  • 3
  • 4
  • 5
平均分:NAN    参与人数:0    我的评分:未评 下载时遇到问题?
如果有帮助,就支持一下我呗
举报

评论 使用道具

精彩评论82

luyu208
DD
| 发表于 2020-5-12 23:11:24 | 显示全部楼层
不错学习了
举报

点赞 评论 使用道具

luyu208
DD
| 发表于 2020-5-21 16:01:10 | 显示全部楼层
把MQL4语言介绍的很全很细
举报

点赞 评论 使用道具

悠悠72
C
| 发表于 2020-5-21 17:12:56 | 显示全部楼层
感谢分享,很多没看懂
举报

点赞 评论 使用道具

阳光绿猫
DDD
| 发表于 2020-6-9 05:48:59 | 显示全部楼层
感谢分享 留脚印 存币
举报

点赞 评论 使用道具

zw123456
D
| 发表于 2020-6-28 10:32:32 | 显示全部楼层

感谢分享 留脚印 存币
举报

点赞 评论 使用道具

fuyun
D
| 发表于 2020-7-2 21:54:25 | 显示全部楼层
好东西,还只能看着
举报

点赞 评论 使用道具

摩羯羽人
DDD
| 发表于 2020-7-13 22:36:44 | 显示全部楼层
好东东。没H币哦
举报

点赞 评论 使用道具

sgw
DD
| 发表于 2020-7-17 21:52:35 | 显示全部楼层
感谢分享,很多没看懂
举报

点赞 评论 使用道具

sunnyhaolang
DDD
| 发表于 2020-7-26 18:43:29 | 显示全部楼层
这个一定要学学
举报

点赞 评论 使用道具

348414804
DD
| 发表于 2020-7-26 19:44:48 来自手机 | 显示全部楼层
谢谢分享
举报

点赞 评论 使用道具

FarewellOC
D
| 发表于 2020-8-14 11:45:42 | 显示全部楼层
谢谢分享
举报

点赞 评论 使用道具

2357186528
D
| 发表于 2020-8-25 16:29:32 | 显示全部楼层
谢谢分享
举报

点赞 评论 使用道具

thekof32
CC
| 发表于 2021-3-1 08:46:50 | 显示全部楼层
谢谢分享
举报

点赞 评论 使用道具

fxbienhild
未及格
| 发表于 2021-4-10 14:36:36 | 显示全部楼层
多谢楼主分享,楼主好人!!!
举报

点赞 评论 使用道具

JOKEEBOSS
DD
| 发表于 2021-4-10 19:20:46 | 显示全部楼层
谢谢分享
举报

点赞 评论 使用道具

fxbienhild
未及格
| 发表于 2021-4-11 14:50:47 | 显示全部楼层
多谢咯朱分享,楼主好人!!
举报

点赞 评论 使用道具

升龙
DD
| 发表于 2021-4-29 14:20:41 | 显示全部楼层
学习学习
举报

点赞 1 评论 使用道具

daerbushen
DD
| 发表于 2021-4-29 14:27:18 | 显示全部楼层
感謝分享
举报

点赞 评论 使用道具

daerwushen
DD
| 发表于 2021-4-29 14:37:25 | 显示全部楼层
感謝分享
举报

点赞 评论 使用道具

12345下一页
发新帖
EA交易
您需要登录后才可以评论 登录 | 立即注册

天眼云VPS
简体中文
繁體中文
English(英语)
日本語(日语)
Deutsch(德语)
Русский язык(俄语)
بالعربية(阿拉伯语)
Türkçe(土耳其语)
Português(葡萄牙语)
ภาษาไทย(泰国语)
한어(朝鲜语/韩语)
Français(法语)