首页学院交易策略EA智能交易文章详细

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

外汇网2021-06-17 09:41:41 86
汇外网 - 全球专业的黄金外汇门户导航行情资讯网站

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_THU抵押贷款支持债券DOWN, SYMBOL_THU抵押贷款支持债券UP, VAL_CLOSEPR洲际交易所, VAL_CLOSETIME, VAL_COMISSION, VAL_COMMENT, VAL_LOTS, VAL_OPENPR洲际交易所, 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允许编撰智能交易系统、自编指标、自编脚本和从模板中执行编辑

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

标签:

随机快审展示
加入快审,优先展示

加入VIP