13评论

0收藏

外汇智能交易MQL4语言教程(二)

avatar EA狙击手 | 4217 人阅读 | 13 人评论 | 2012-11-13

4.固定字
MetaQuotes 4 语言使用下面的几组固定字。
1. 逻辑符号。
AND, NOT, OR.

2. MQL 4语言指令。
Array, Begin, Break, Continue, Define, Downto, Else, End, Exit, For, If, Input, Then, To, Variable, While。界定语言指令结构的固定字也叫做关键字。

3. 内置函数。
Abs, AccName, AccountName, Alert, Ceil, CloseOrder, Comment, Cos, CurTime, Day, DayOfWeek, DeleteOrder, Exp, Floor, Highest, Hour, iADX, iATR, iBANDS, iCCI, iMA, iMACD, iMFI, iMOM, iRSI, iSAR, iSTO, iWPR, IsDemo, IsIndirect, LastTradeTime, Log, Lowest, Minute, Mod, ModifyOrder, Month, MoveObject, NumberToStr, Ord, OrderValue, Period, Pow, Print, PrintTrade, Rand, Round, ServerAddress, SetArrow, SetObjectText, SetOrder, SetText, Sin, Sqrt, Srand, Symbol, Tan, TimeToStr, Year.

4. 预先设定用户变量(用户定义变量)。
Lots, StopLoss, TakeProfit, TrailingStop.

5. 预先设定交易终端变量。
AccNum, AccountNumber, Ask, Balance, Bars, Bid, Close, Credit, Equity, FreeMargin, High, Low, Margin, Open, Point, PriceAsk, PriceBid, PriceHigh, PriceLow, PriceTime, Time, TotalProfit, TotalTrades, Volume.

6. 预先设定内置函数参数(宏命令)。
MODE_CLOSE, MODE_EMA, MODE_HIGH, MODE_LOW, MODE_MAIN, MODE_MINUSDI, MODE_OPEN, MODE_PLUSDI, MODE_SIGNAL, MODE_SMA, MODE_STOPLOSS, MODE_TAKEPROFIT, MODE_VOLUME, MODE_WMA, OBJ_HLINE, OBJ_SYMBOL, OBJ_TEXT, OBJ_TRENDLINE, OBJ_VLINE, OP_BUY, OP_BUYLIMIT, OP_BUYSTOP, OP_SELL, OP_SELLLIMIT, OP_SELLSTOP, SYMBOL_ARROWDOWN, SYMBOL_ARROWUP, SYMBOL_CHECKSIGN, SYMBOL_STOPSIGN, SYMBOL_THUMBSDOWN, SYMBOL_THUMBSUP, VAL_CLOSEPRICE, VAL_CLOSETIME, VAL_COMISSION, VAL_COMMENT, VAL_LOTS, VAL_OPENPRICE, VAL_OPENTIME, VAL_PROFIT, VAL_STOPLOSS, VAL_SWAP, VAL_SYMBOL, VAL_TAKEPROFIT, VAL_TICKET, VAL_TYPE.
实际上,上述固定字为宏记录器,即语法分析程序用数值取而代之。宏记录器的引入简化了编写用户功能要求的程序:更加方便、无关联的重要词语可以用来替代一些函数参数值。同样可以用于色彩名称。
7. 色彩。AliceBlue, AntiqueWhite, Aqua, Aquamarine, Azure, Beige, Bisque, Black, BlanchedAlmond, Blue, BlueViolet, Brown, BurlyWood, CadetBlue, Chartreuse, Chocolate, Coral, CornflowerBlue, Cornsilk, Crimson, Cyan, DarkBlue, DarkCyan, DarkGoldenrod, DarkGray, DarkGreen, DarkKhaki, DarkMagenta, DarkOliveGreen, DarkOrange, DarkOrchid, DarkRed, DarkSalmon, DarkSeaGreen, DarkSlateBlue, DarkSlateGray, DarkTurquoise, DarkViolet, DeepPink, DeepSkyBlue, DimGray, DodgerBlue, FireBrick, FloralWhite, ForestGreen, Fuchsia, Gainsboro, GhostWhite, Gold, Goldenrod, Gray, Green, GreenYellow, Honeydew, HotPink, IndianRed, Indigo, Ivory, Khaki, Lavender, LavenderBlush, LawnGreen, LemonChiffon, LightBlue, LightCoral, LightCyan, LightGoldenrod, LightGreen, LightGrey, LightPink, LightSalmon, LightSeaGreen, LightSkyBlue, LightSlateGray, LightSteelBlue, LightYellow, Lime, LimeGreen, Linen, Magenta, Maroon, MediumAquamarine, MediumBlue, MediumOrchid, MediumPurple, MediumSeaGreen, MediumSlateBlue, MediumSpringGreen, MediumTurquoise, MediumVioletRed, MidnightBlue, MintCream, MistyRose, Moccasin, NavajoWhite, Navy, OldLace, Olive, OliveDrab, Orange, OrangeRed, Orchid, PaleGoldenrod, PaleGreen, PaleTurquoise, PaleVioletRed, PapayaWhip, PeachPuff, Peru, Pink, Plum, PowderBlue, Purple, Red, RosyBrown, RoyalBlue, SaddleBrown, Salmon, SandyBrown, SeaGreen, Seashell, Sienna, Silver, SkyBlue, SlateBlue, SlateGray, Snow, SpringGreen, SteelBlue, Tan, Teal, Thistle, Tomato, Turquoise, Violet, Wheat, White, WhiteSmoke, Yellow, YellowGreen.

所有的固定字均是非敏感字号,即它们可以小写也可以大写。
4.1. 智能交易系统向导
智能交易系统向导提示MQL 4允许编写智能交易系统、自编指标、自编脚本和从模板中进行编辑
预先设定参数或变量的名称,将会自动在文本编辑栏中出现参数框架。

""
还没有人打赏,支持一下

评论|共 13 个

饿狼

发表于 2012-11-13 23:46:35 | 显示全部楼层

原来这样也可以  

外汇配资

发表于 2012-11-13 23:46:35 | 显示全部楼层

刚加进这个论坛不久,热衷于EA交易  

福尔摩斯

发表于 2012-11-13 23:46:35 | 显示全部楼层

世界上那些最容易的事情中,拖延时间最不费力。  

istzq

发表于 2012-11-13 23:46:35 | 显示全部楼层

行情不好做!

云之端

发表于 2012-11-14 10:07:12 | 显示全部楼层

谢谢分享了!  

格西8023

发表于 2012-11-14 10:07:12 | 显示全部楼层

就为赚分嘛  

mgzyhq

发表于 2012-11-14 10:07:12 | 显示全部楼层

希望大家都有好运  

月蓝蓝

发表于 2012-11-14 10:07:12 | 显示全部楼层

不错 不错  比我强多了  

深圳张泳

发表于 2013-5-14 11:59:28 | 显示全部楼层

[s:138]

您需要登录后才可以回帖 登录 | 注册 微信登录

EA之家评论守则