邮箱:service@fxzht.com ;QQ:1799734181

微信公众号
手机版
郑重声明

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

2019-05-24 12:09:36 投稿人 : 佚名 阅读 : 评论

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允许编写智能交易系统、自编指标、自编脚本和从模板中进行编辑

预先设定参数或变量的名称,将会自动在文本编辑栏中出现参数框架。


相关文章

【版权声明】

本文仅代表作者观点,不代表本站立场。中汇通外汇财经网对文中陈述、观点判断保持中立,不对所包含内容的准确性、可靠性或完整性提供任何明示或暗示的保证,且不构成任何投资建议,请读者仅作参考,并自行承担全部风险与责任。中汇通外汇财经网作为信息内容发布平台,页面展示内容的目的在于传播更多信息,不代表中汇通外汇财经网立场;本站会员及自媒体人所发的稿件所载明的信息与本网无关,如文章涉及版权,请联系本站处理。

【风险提示】
请通过正规渠道参与外汇保证金交易。目前通过网络平台提供、参与外汇保证金交易均属非法。请提高意识,谨防损失!外汇、贵金属和差价合约(OTC场外交易)是杠杆产品,存在较高的风险,可能会导致亏损您的投资本金,请理性投资。