4.16 对象属性(Object properties) - 外汇吧
  • 首页
  • 外汇知识
    • 外汇基础知识
    • 外汇基本面分析
    • 外汇技术面分析
  • 外汇指标详解
  • 外汇交易系统
  • 外汇MT4编程
    • 3小时学会MT4编程
    • EA编程学习
    • MT4(MQL4)编程手册
  • EA下载
    • 免费工具使用及下载
    • EA指标源码
  • 外汇交易心理
  • 搜索
外汇吧
外汇知识-外汇编程-外汇指标-外汇EA-外汇交易策略
跳转至内容
  • 首页
  • 外汇知识
    • 外汇基础知识
    • 外汇基本面分析
    • 外汇技术面分析
  • 外汇指标详解
  • 外汇交易系统
  • 外汇MT4编程
    • 3小时学会MT4编程
    • EA编程学习
    • MT4(MQL4)编程手册
  • EA下载
    • 免费工具使用及下载
    • EA指标源码
  • 外汇交易心理
  • 搜索
4.16 对象属性(Object properties)
首页 文档 4.16 对象属性(Object properties)
           
   

MT4编程手册

               
  • 1 初识MQL4程序
    • 1.1 前言
    • 1.2 什么是EA
    • 1.3 人工操盘与机器操盘
    • 1.4 为什么要学习MT4 EA编程
    • 1.5 MQL4程序简介
    • 1.6 MT4程序类型
    • 1.7 如何编写MT4程序
  • 2 MQL4程序框架
    • 2.1 MT4程序框架
  • 3 MQL4语法
    • 3.1 语法
    • 3.2 注释
    • 3.3 标识符
    • 3.4 保留字(关键字)
    • 3.5 数据类型
    • 3.6 类型转换
    • 3.7 整型
    • 3.8 字符型
    • 3.9 布尔型
    • 3.10 浮点型(双精度型)
    • 3.11 字符串类型
    • 3.12 颜色型
    • 3.13 时间类型
    • 3.14 运算符和表达式
    • 3.15 运算符优先级
    • 3.16 其它操作
    • 3.17 函数
    • 3.18 函数调用
    • 3.19 形式参数
    • 3.20 特殊函数
    • 3.21 变量
    • 3.22 局部变量
    • 3.23 静态变量
    • 3.24 全局变量
    • 3.25 外部定义变量(输入变量)
    • 3.26 变量初始化
    • 3.27 外部定义函数
    • 3.28 预处理程序
    • 3.29 常数申明
    • 3.30 编译控制
    • 3.31 头文件包含
    • 3.32 函数导入
    • 3.33 数组
  • 4 MQL4标准常量
    • 4.1 标准常量说明
    • 4.2 系列数组(Series arrays)
    • 4.3 时间周期(Timeframes)
    • 4.4 交易类型(Trade operations)
    • 4.5 价格常量(Price constants)
    • 4.6 市场信息常量(MarketInfo)
    • 4.7 画线样式与风格(Drawing styles )
    • 4.8 箭头代码(Arrow codes)
    • 4.9 字体类型常数(Wingdings)
    • 4.10 颜色常数(Web colors)
    • 4.11 指标线(Indicator lines)
    • 4.12 一目均衡图(Ichimoku Kinko Hyo)
    • 4.13 移动平均线计算方法(Moving Average methods)
    • 4.14 消息框(MessageBox)
    • 4.15 对象类型(Object types)
    • 4.16 对象属性(Object properties)
    • 4.17 对象有效周期(Object visibility)
    • 4.18 初始失败化原因代码(Uninitialize reason codes)
    • 4.19 特殊常量(Special constants)
    • 4.20 错误代码(Error codes)
  • 5 MQL4预定义变量
    • 5.1 预定义变量说明
    • 5.2 Ask(做多买入价)
    • 5.3 Bid(做空买入价)
    • 5.4 Bars(K线总数)
    • 5.5 open(开盘价数组)
    • 5.6 Close(收盘价数组)
    • 5.7 High(最高价数组)
    • 5.8 Low(最低价数组)
    • 5.9 Digits(计价小数位)
    • 5.10 Point(点值)
    • 5.11 Time(时间数组)
    • 5.12 Volume(成交量数组)
    • 5.13 _Digits(计价小数位)
    • 5.14 _Point(点值)
    • 5.15 _LastError(最后一次报错的错误代码)
    • 5.16 _Period(当前图表的时间周期)
    • 5.17 _RandomSeed(伪随机数)
    • 5.18 _StopFlag(停止标志)
    • 5.19 _Symbol(当前图表货币对名称)
    • 5.20 _UninitReason(初始化失败)
  • 6 MQL4运行程序
    • 6.1 说明
    • 6.2 MQL4程序框架以及运行流程
    • 6.3 最新MQL4程序框架个更改与说明
    • 6.4 外部函数调用
    • 6.5 运行时错误
  • 7 MT4账户信息获取
    • 7.1 AccountBalance(账户余额)
    • 7.2 AccountCredit(账户信用点数)
    • 7.3 AccountCompany(账户公司名)
    • 7.4 AccountCurrency(账户使用的货币名称)
    • 7.5 AccountEquity(账户净值)
    • 7.6 AccountFreeMargin(账户可用保证金)
    • 7.7 AccountFreeMarginCheck(可用保证金检查)
    • 7.8 AccountFreeMarginMode(可用保证金计算模式)
    • 7.9 AccountLeverage(账户杠杆比率)
    • 7.10 AccountMargin(账户保证金)
    • 7.11 AccountName(账户名称)
    • 7.12 AccountNumber(账户的账号)
    • 7.13 AccountProfit(账户利润)
    • 7.14 AccountServer(服务器名字)
    • 7.15 AccountStopoutLevel(账户强制平仓位置)
    • 7.16 AccountStopoutMode(账户强制平仓计算模式)
  • 8 MQL4数组使用
    • 8.0 说明
    • 8.1 ArrayBsearch(数组二分查找)
    • 8.2 ArrayCopy(数组复制)
    • 8.3 ArrayCopyRates(复制走势信息到数组)
    • 8.4 ArrayCopySeries(复制一个系列的走势数据)
    • 8.5ArrayDimension(返回数组的维数)
    • 8.6 ArrayGetAsSeries(检查数组是否按时间序列排序的)
    • 8.7 ArrayInitialize(初始化数组)
    • 8.8 ArrayIsSeries(判断数组是否系列数组)
    • 8.9 ArrayMaximum(数组中最大值)
    • 8.10 ArrayMinimum(数组中最小值)
    • 8.11 ArrayRange(数组每个维度大小)
    • 8.12 ArrayResize(重置数组大小)
    • 8.13 ArraySetAsSeries(数组设置为系列数组)
    • 8.14 ArraySize(数组大小)
    • 8.15 ArraySort(数组排序)
  • 9 MQL4检查函数
    • 9.0 说明
    • 9.1 GetLastError(错误代码)
    • 9.2 IsStopped(程序是否终止)
    • 9.3 IsConnected(服务器是否链接)
    • 9.4 IsDemo(是否模拟账户)
    • 9.5 IsDllsAllowed(是否允许使用链接库)
    • 9.6 IsExpertEnabled(是否允许自动交易)
    • 9.7 IsLibrariesAllowed(是否允许使用数据库)
    • 9.8 IsOptimization(是否优化模式)
    • 9.9 IsTesting(是否测试中运行)
    • 9.10 IsTradeAllowed(是否允许交易)
    • 9.11 IsTradeContextBusy(是否交易繁忙)
    • 9.12 IsVisualMode(是否虚拟模式)
    • 9.13 UninitializeReason(初始化失败原因)
    • 9.14 Symbol(货币对名称)
    • 9.15 Period(时间周期)
    • 9.16 Digits(小数位数)
    • 9.17 Point(点值)
    • 9.18 TerminalCompany(平台商名称)
    • 9.19 TerminalName(客户终端名称)
    • 9.20 TerminalPath(客户终端安装目录)
  • 10 MT4客户终端信息
    • 10.0 shuoming
    • 10.1 TerminalCompany(平台上名称)
    • 10.2 TerminalName(客户终端名称)
    • 10.3 TerminalPath(客户终端安装目录)
  • 11 MT4通用函数
    • 11.0 说明
    • 11.1 Alert(警告窗口)
    • 11.2 Comment(显示信息)
    • 11.3 GetTickCount(时间标记)
    • 11.4 MarketInfo(市场信息)
    • 11.5 MessageBox(消息弹出框)
    • 11.6  PlaySound(播放声音)
    • 11.7 Print(消息输出)
    • 11.8 SendFTP(发送FTP信息)
    • 11.9 SendMail(发送邮件)
    • 11.10 Sleep(等待函数)
  • 12 MQL4转换函数
    • 12.0 说明
    • 12.1 CharToString(字符转字符串)
    • 12.2 DoubleToString(浮点转字符串)
    • 12.3 NormalizeDouble(正常化浮点数)
    • 12.4 StringToDouble(字符串转浮点)
    • 12.5 StringToInteger(字符串转整型)
    • 12.6 StringToTime(字符串转时间)
    • 12.7 TimeToString(时间转字符串)
  • 13 MT4自定义指标函数
    • 13.0 说明
    • 13.1 HideTestIndicators
    • 13.2 IndicatorSetDouble
    • 13.3 IndicatorSetInteger
    • 13.4 IndicatorSetString
    • 13.5 SetIndexBuffer
    • 13.6 IndicatorBuffers
    • 13.7 IndicatorCounted
    • 13.8 IndicatorDigits
    • 13.9 IndicatorShortName
    • 13.10 SetIndexArrow
    • 13.11 SetIndexDrawBegin
    • 13.12 SetIndexEmptyValue
    • 13.13 SetIndexLabel
    • 13.14 SetIndexShift
    • 13.15 SetIndexStyle
    • 13.16 SetLevelStyle
    • 13.17 SetLevelValue
  • 14 MT4时间类型函数
    • 14.0 说明
    • 14.1 TimeCurrent(服务器时间)
    • 14.2 TimeLocal(本机时间)
    • 14.3 Year(年)
    • 14.4 Month(月)
    • 14.5 Day(日)
    • 14.6 Hour(时)
    • 14.7 Minute(分)
    • 14.8 Seconds(秒)
    • 14.9 TimeYear(指定时间的年)
    • 14.10 TimeDay(指定时间所在月的天数)
    • 14.11 TimeHour(指定时间的小时)
    • 14.12 TimeMinute(指定时间的分钟)
    • 14.13 TimeMonth(指定时间的月)
    • 14.14 TimeSeconds(指定时间的秒)
    • 14.15 TimeDayOfYear(指定时间的天数)
    • 14.16 TimeDayOfWeek(指定时间的周数)
    • 14.17 DayOfYear(日)
    • 14.18 DayOfWeek(周)
  • 15 MQL4文件操作函数
    • 15.0 说明
    • 15.1 FileClose(关闭文件)
    • 15.2 FileDelete(删除文件)
    • 15.3 FileFlush(刷新文件)
    • 15.4 FileIsEnding(是否文件结尾)
    • 15.5 FileIsLineEnding(是否行结尾)
    • 15.6 FileOpen(打开文件)
    • 15.7 FileOpenHistory(文件打开历史)
    • 15.8 FileReadArray(读取文件到数组
    • 15.9 FileReadDouble(读取浮点数)
    • 15.10 FileReadInteger(读取整型数)
    • 15.11 FileReadNumber(读取数量)
    • 15.12 FileReadString(读取字符串)
    • 15.13 FileSeek(文件指针移动)
    • 15.14 FileSize(文件大小)
    • 15.15 FileTell(文件指针位置)
    • 15.16 FileWrite(写入文件)
    • 15.17 FileWriteArray(写入数组)
    • 15.18 FileWriteDouble(写入浮点数)
    • 15.19 FileWriteInteger(写入整型数)
    • 15.20 FileWriteString(写入字符串)
  • 16 MT4客户端全局变量
    • 16.0 说明
    • 16.1 GlobalVariableCheck(检查变量)
    • 16.2 GlobalVariableDel(删除变量)
    • 16.3 GlobalVariableGet(读取变量)
    • 16.4 GlobalVariableName(搜索变量)
    • 16.5 GlobalVariableSet(设置变量)
    • 16.6 GlobalVariableSetOnCondition(按条件设置变量)
    • 16.7 GlobalVariablesDeleteAll(删除所有变量)
    • 16.8 GlobalVariablesTotal(变量总数)
  • 17 MQL4数学和三角函数
    • 17.0 说明
    • 17.1 MathAbs(绝对值)
    • 17.2 MathArccos(反余弦)
    • 17.3 MathArcsin(反正弦)
    • 17.4 MathArctan(反正切)
    • 17.5 MathCeil(最小大于)
    • 17.6 MathCos(余弦)
    • 17.7 MathExp(e求幂)
    • 17.8 MathFloor(最大小于)
    • 17.9 MathLog(自然对数)
    • 17.10 MathMax(最大)
    • 17.11 MathMin(最小)
    • 17.12 MathMod(浮点求余)
    • 17.13 MathPow(指定数求幂)
    • 17.14 MathRand(随机数)
    • 17.15 MathRound(四舍五入)
    • 17.16 MathSin(正弦)
    • 17.17 MathSqrt(平方根)
    • 17.18 MathSrand(随机数起点)
    • 17.19 MathTan(正切)
  • 18 MQL4图表对象操作函数
    • 18.0 说明
    • 18.1 ObjectCreate(创建对象)
    • 18.2 ObjectDelete(删除对象)
    • 18.3 ObjectDescription(对象描述)
    • 18.4 ObjectFind(查找对象)
    • 18.5 ObjectGet(获取对象属性)
    • 18.6 ObjectGetFiboDescription(获取斐波那契描述)
    • 18.7 ObjectGetShiftByValue(计算索引柱值)
    • 18.8 ObjectGetValueByShift(计算返回K柱号)
    • 18.9 ObjectMove(移动对象)
    • 18.10 ObjectName(对象名)
    • 18.11 ObjectsDeleteAll(删除所有对象)
    • 18.12 ObjectSet(设置对象属性)
    • 18.13 ObjectSetFiboDescription(设置斐波那契描述)
    • 18.14 ObjectSetText(设置对象文字)
    • 18.15 ObjectsTotal(对象总数)
    • 18.16 ObjectType(对象类型)
  • 19 MQL4字符串操作函数
    • 19.0 说明
    • 19.1 StringAdd 字符串合并
    • 19.2 StringBufferLen 返回字符串申请的内存大小
    • 19.3 StringCompare 字符串对比
    • 19.4 StringConcatenate (字符串链接)
    • 19.5 StringFill (字符串填充)
    • 19.6 StringFind(字符串查找)
    • 19.7 StringGetCharacter(获取指定位置字符)
    • 19.8 StringInit(初始化字符串)
    • 19.9 StringLen(字符串长度)
    • 19.10 StringReplace 字符串替换
    • 19.11 StringSetCharacter(指定位置插入字符)
    • 19.12 StringSplit(字符串剪切)
    • 19.13 StringSubstr(子字符串)
    • 19.14 StringToLower(大写转小写)
    • 19.15 StringToUpper(小写转大写)
    • 19.16 StringTrimLeft(消除左边空格)
    • 19.17 StringTrimRight(消除右边空格)
    • 19.18 StringGetChar(获取指定位置字符)
    • 19.19 StringSetChar(设置指定位置字符)
  • 20 MT4标准指标计算函数
    • 20.0 说明
    • 20.1 iAC(震荡加速指标)
    • 20.2 iAD(离散指标)
    • 20.3 iADX
    • 20.4 iAlligator(鳄鱼指标)
    • 20.5 iAO(震荡指标)
    • 20.6 iATR(平均真实波动指标)
    • 20.7 iBands(布林带指标)
    • 20.8 iBandsOnArray
    • 20.9 iBearsPower(熊力指标)
    • 20.10 iBullsPower(牛力指标)
    • 20.11 iBWMFI(市场促进指标)
    • 20.12 iCCI(商品通道指标)
    • 20.13 iCCIOnArray
    • 20.14 iCustom(自定义指标)
    • 20.15 iDeMarker(震荡指标)
    • 20.16 iEnvelopes(包络图)
    • 20.17 iEnvelopesOnArray
    • 20.18 iForce(强力指标)
    • 20.19 iFractals(分型指标)
    • 20.20 iGator(加多摆动指标)
    • 20.21 iIchimoku(一目云图)
    • 20.22 iMA(移动平均线指标)
    • 20.23 iMACD(移动平均汇总/分离指标)
    • 20.24 iMAOnArray
    • 20.25 iMFI(资金流量指标)
    • 20.26 iMomentum(动量索引指标)
    • 20.26 iMomentumOnArray
    • 20.27 iOBV(能量潮指标)
    • 20.28 iOsMA(移动平均震荡指标)
    • 20.29 iRSI(相对强弱指标)
    • 20.30 iRSIOnArray
    • 20.31 iRVI(相对活力指标)
    • 20.32 iSAR(抛物线指标)
    • 20.33 iStdDev(标准离差指标)
    • 20.34 iStdDevOnArray
    • 20.35 iStochastic(随机震荡指标)
    • 20.36 iWPR(威廉指标)
  • 21 MT4价格数据函数
    • 21.0 说明
    • 21.1 iBars(K柱数量)
    • 21.2 iBarShift(开始柱时间)
    • 21.3 iClose(收盘价)
    • 21.4 iHigh(最高价)
    • 21.5 iHighest(一段时间内的最高价)
    • 21.6 iLow(最低价)
    • 21.7 iLowest(一段时间内的最低价)
    • 21.8 iOpen(开盘价)
    • 21.9 iTime(K柱起始时间)
    • 21.10 iVolume(成交量)
  • 22 MQL4交易函数
    • 22.0 说明
    • 22.1 运行错误代码
    • 22.2 OrderClose(平仓)
    • 22.3 OrderCloseBy(平仓并反向开仓)
    • 22.4 OrderClosePrice(平仓价)
    • 22.5 OrderCloseTime(平仓时间)
    • 22.6 OrderComment(订单注释)
    • 22.7 OrderCommission(手续费)
    • 22.8 OrderDelete(删除挂单)
    • 22.9 OrderExpiration(挂单有效期)
    • 22.10 OrderLots(订单手数)
    • 22.11 OrderMagicNumber(订单指定号码)
    • 22.12 OrderModify(修改订单)
    • 22.13 OrderOpenPrice(开仓价)
    • 22.14 OrderOpenTime(开仓时间)
    • 22.15 OrderPrint(打印订单)
    • 22.16 OrderProfit(订单浮盈)
    • 22.17 OrderSelect(选择订单)
    • 22.18 OrderSend(开仓)
    • 22.19 OrdersHistoryTotal(历史订单数)
    • 22.20 OrderStopLoss(止损)
    • 22.21 OrdersTotal(订单总数)
    • 22.22 OrderSwap(隔夜利息)
    • 22.23 OrderSymbol(订单货币对)
    • 22.24 OrderTakeProfit(止盈)
    • 22.25 OrderTicket(订单编号)
    • 22.26 OrderType(订单类型)
  • 23 MQL4图表窗口使用函数
    • 23.0 说明
    • 23.1 HideTestIndicators(隐藏指标)
    • 23.2 Period(时间周期)
    • 23.3 RefreshRates(刷新系列数组)
    • 23.4 Symbol(货币对)
    • 23.5 WindowBarsPerChart(图标可见K线)
    • 23.6 WindowExpertName(EA名字)
    • 23.7 WindowFind(查找窗口)
    • 23.8 WindowFirstVisibleBar(第一个可见K柱)
    • 23.9 WindowHandle(窗口句柄)
    • 23.10 WindowIsVisible(窗口是否可见)
    • 23.11 WindowOnDropped(被删除EA所在窗口)
    • 23.12 WindowPriceMax(窗口最大价格)
    • 23.13 WindowPriceMin(窗口最小价格)
    • 23.14 WindowPriceOnDropped
    • 23.15 WindowRedraw(刷新显示)
    • 23.16 WindowScreenShot(截屏
    • 23.17 WindowTimeOnDropped
    • 23.18 WindowsTotal(窗口数量)
    • 23.19 WindowXOnDropped
    • 23.20 WindowYOnDropped
               
  1. 主页
  2. 文档
  3. MT4编程手册
  4. 4 MQL4标准常量
  5. 4.16 对象属性(Object properties)

4.16 对象属性(Object properties)

Object Properties

Graphical objects can have various properties depending on the object type. All objects used in technical analysis are bound to the time and price coordinates: trendline, channels, Fibonacci tools, etc. But there is a number of auxiliary objects intended to improve the user interface that are bound to the always visible part of a chart (main chart windows or indicator subwindows):

ObjectIDX/YWidth/HeightDate/PriceOBJPROP_CORNEROBJPROP_ANCHOROBJPROP_ANGLE
TextOBJ_TEXT——Yes—YesYes
LabelOBJ_LABELYesYes (read only)—YesYesYes
ButtonOBJ_BUTTONYesYes—Yes——
BitmapOBJ_BITMAP—Yes (read only)Yes—Yes—
Bitmap LabelOBJ_BITMAP_LABELYesYes (read only)—YesYes—
EditOBJ_EDITYesYes—Yes——
Rectangle LabelOBJ_RECTANGLE_LABELYesYes—Yes——

The following designations are used in the table:

  • X/Y – coordinates of anchor points specified in pixels relative to a chart corner;
  • Width/Height – objects have width and height. For “read only”, the width and height values are calculated only once the object is rendered on chart;
  • Date/Price – anchor point coordinates are specified using the date and price values;
  • OBJPROP_CORNER – defines the chart corner relative to which the anchor point coordinates are specified. Can be one of the 4 values of the ENUM_BASE_CORNER enumeration;
  • OBJPROP_ANCHOR – defines the anchor point in object itself and can be one of the 9 values of the ENUM_ANCHOR_POINT enumeration. Coordinates in pixels are specified from this very point to selected chart corner;
  • OBJPROP_ANGLE – defines the object rotation angle counterclockwise.

对象值函数同ObjectGet() 和 ObjectSet() 功能一起使用。它可能是以下的任意值:

常数值类型描述
OBJPROP_TIME10datetime日期时间值设置为第一协调时间部分。
OBJPROP_PRICE11double双重值设置为第一协调价格部分。
OBJPROP_TIME22datetime日期时间值设置为第二协调时间部分。
OBJPROP_PRICE23double双重值设置为第二协调价格部分。
OBJPROP_TIME34datetime日期时间值设置为第三协调时间部分。
OBJPROP_PRICE35double双重值设置为第三协调价格部分。
OBJPROP_COLOR6color颜色值设置对象颜色。
OBJPROP_STYLE7intSTYLE_SOLID, STYLE_DASH, STYLE_DOT, STYLE_DASHDOT, STYLE_DASHDOTDOT 常数中的一个设置为对象线风格。
OBJPROP_WIDTH8int设置对象线宽度的整数值。可以从1到5。
OBJPROP_BACK9bool设定对象背景的布尔值。
OBJPROP_RAY10bool设定对象射线的布尔值。
OBJPROP_ELLIPSE11bool设置椭圆状的弧形布尔值。
OBJPROP_SCALE12double设置对象属性的双重值。
OBJPROP_ANGLE13double在级别上设置对象属性的双重值。
OBJPROP_ARROWCODE14int设置对象属性箭头代码的整数值和箭头计数 。
OBJPROP_TIMEFRAMES15int设置对象属性的时间范围一个值或者可见性对象常数 的组合值。
OBJPROP_DEVIATION16double为标准离差对象设定双重值的离差属性。
OBJPROP_FONTSIZE100int对于对象文本字体大小设定整数值。
OBJPROP_CORNER101int对标记对象设定整数值的固定装置角。必须是从0-3。
OBJPROP_XDISTANCE102int在像点设定整数值固定装置X间隔对象。
OBJPROP_YDISTANCE103int在像点设定整数值固定装置Y间隔对象。
OBJPROP_FIBOLEVELS200int设置斐波纳契对象水平数为整数值。可以从0 到32 。
OBJPROP_LEVELCOLOR201color设置对象水平颜色线的颜色值。
OBJPROP_LEVELSTYLE202intSTYLE_SOLID, STYLE_DASH, STYLE_DOT, STYLE_DASHDOT, STYLE_DASHDOTDOT 常数中的一个设置为对象线风格。
OBJPROP_LEVELWIDTH203int设置对象线宽度的整数值。可以从1到5。
OBJPROP_FIRSTLEVEL+n210+nint斐波纳契水平函数是设置n的水平函数。可

Methods of Object Binding

ENUM_ANCHOR_POINT

IDDescription
ANCHOR_LEFT_UPPERAnchor point at the upper left corner
ANCHOR_LEFTAnchor point to the left in the center
ANCHOR_LEFT_LOWERAnchor point at the lower left corner
ANCHOR_LOWERAnchor point below in the center
ANCHOR_RIGHT_LOWERAnchor point at the lower right corner
ANCHOR_RIGHTAnchor point to the right in the center
ANCHOR_RIGHT_UPPERAnchor point at the upper right corner
ANCHOR_UPPERAnchor point above in the center
ANCHOR_CENTERAnchor point strictly in the center of the object

Methods of Object Binding

ENUM_ARROW_ANCHOR

IDDescription
ANCHOR_TOPAnchor on the top side
ANCHOR_BOTTOMAnchor on the bottom side

Object Properties

For functions ObjectSetInteger() and ObjectGetInteger()

ENUM_OBJECT_PROPERTY_INTEGER

IdentifierDescriptionProperty Type
OBJPROP_COLORColorcolor
OBJPROP_STYLEStyleENUM_LINE_STYLE
OBJPROP_WIDTHLine thicknessint
OBJPROP_BACKObject in the backgroundbool
OBJPROP_ZORDERPriority of a graphical object for receiving events of clicking on a chart (CHARTEVENT_CLICK). The default zero value is set when creating an object; the priority can be increased if necessary. When objects are placed one atop another, only one of them with the highest priority will receive the CHARTEVENT_CLICK event.long
OBJPROP_HIDDENProhibit showing of the name of a graphical object in the list of objects from the terminal menu “Charts” – “Objects” – “List of objects”. The true value allows to hide an object from the list. By default, true is set to the objects that display calendar events, trading history and to the objects created from MQL4 programs. To see such graphical objects and access their properties, click on the “All” button in the “List of objects” window.bool
OBJPROP_SELECTEDObject is selectedbool
OBJPROP_READONLYAbility to edit text in the Edit objectbool
OBJPROP_TYPEObject typeENUM_OBJECT   r/o
OBJPROP_TIMETime coordinatedatetime   modifier=number of anchor point
OBJPROP_SELECTABLEObject availabilitybool
OBJPROP_CREATETIMETime of object creationdatetime    r/o
OBJPROP_LEVELSNumber of levelsint
OBJPROP_LEVELCOLORColor of the line-levelcolor   modifier=level number
OBJPROP_LEVELSTYLEStyle of the line-levelENUM_LINE_STYLE modifier=level number
OBJPROP_LEVELWIDTHThickness of the line-levelint      modifier=level number
OBJPROP_ALIGNHorizontal text alignment in the “Edit” object (OBJ_EDIT)ENUM_ALIGN_MODE
OBJPROP_FONTSIZEFont sizeint
OBJPROP_RAY_RIGHTRay goes to the rightbool
OBJPROP_ELLIPSEShowing the full ellipse of the Fibonacci Arc object (OBJ_FIBOARC)bool
OBJPROP_ARROWCODEArrow code for the Arrow objectuchar
OBJPROP_TIMEFRAMESVisibility of an object at timeframesset of flags flags
OBJPROP_ANCHORLocation of the anchor point of a graphical objectENUM_ARROW_ANCHOR (for OBJ_ARROW),ENUM_ANCHOR_POINT (for OBJ_LABEL, OBJ_BITMAP_LABEL and OBJ_TEXT)
OBJPROP_XDISTANCEThe distance in pixels along the X axis from the binding corner (see note)int
OBJPROP_YDISTANCEThe distance in pixels along the Y axis from the binding corner (see note)int
OBJPROP_DRAWLINESDisplaying lines for marking the Elliott Wavebool
OBJPROP_STATEButton state (pressed / depressed)bool
OBJPROP_XSIZEThe object’s width along the X axis in pixels. Specified for  OBJ_LABEL (read only), OBJ_BUTTON, OBJ_BITMAP, OBJ_BITMAP_LABEL, OBJ_EDIT, OBJ_RECTANGLE_LABEL objects.int
OBJPROP_YSIZEThe object’s height along the Y axis in pixels. Specified for  OBJ_LABEL (read only), OBJ_BUTTON, OBJ_BITMAP, OBJ_BITMAP_LABEL, OBJ_EDIT, OBJ_RECTANGLE_LABEL objects.int
OBJPROP_XOFFSETThe X coordinate of the upper left corner of the rectangular visible area in the graphical objects “Bitmap Label” and “Bitmap” (OBJ_BITMAP_LABEL and OBJ_BITMAP). The value is set in pixels relative to the upper left corner of the original image.int
OBJPROP_YOFFSETThe Y coordinate of the upper left corner of the rectangular visible area in the graphical objects “Bitmap Label” and “Bitmap” (OBJ_BITMAP_LABEL and OBJ_BITMAP). The value is set in pixels relative to the upper left corner of the original image.int
OBJPROP_BGCOLORThe background color for  OBJ_EDIT, OBJ_BUTTON, OBJ_RECTANGLE_LABELcolor
OBJPROP_CORNERThe corner of the chart to link a graphical objectENUM_BASE_CORNER
OBJPROP_BORDER_TYPEBorder type for the “Rectangle label” objectENUM_BORDER_TYPE
OBJPROP_BORDER_COLORBorder color for the OBJ_EDIT and OBJ_BUTTON objectscolor

For objects OBJ_BITMAP_LABEL and OBJ_BITMAP, a special mode of image display can be set programmatically. In this mode, only part of an original image (at which a rectangular visible area is applied) is displayed, while the rest of the image becomes invisible. The size of this area should be set using the properties OBJPROP_XSIZE and OBJPROP_YSIZE. The visible area can be “moved” only within the original image using the properties OBJPROP_XOFFSET and OBJPROP_YOFFSET.

For the fixed-sized objects: OBJ_BUTTON, OBJ_RECTANGLE_LABEL and OBJ_EDIT, properties OBJPROP_XDISTANCE and OBJPROP_YDISTANCE set the position of the top left point of the object relative to the chart corner (OBJPROP_CORNER), from which the X and Y coordinates will be counted in pixels.

For functions ObjectSetDouble() and ObjectGetDouble()

ENUM_OBJECT_PROPERTY_DOUBLE

IdentifierDescriptionProperty Type
OBJPROP_PRICEPrice coordinatedouble    modifier=number of anchor point
OBJPROP_LEVELVALUELevel valuedouble    modifier=level number
OBJPROP_SCALEScale (properties of Gann objects, Fibonacci Arcs and Ellipse)double
OBJPROP_ANGLEAngle.  For the objects with no angle specified, created from a program, the value is equal to EMPTY_VALUEdouble
OBJPROP_DEVIATIONDeviation for the Standard Deviation Channeldouble

For functions ObjectSetString() and ObjectGetString()

ENUM_OBJECT_PROPERTY_STRING

IdentifierDescriptionProperty Type
OBJPROP_NAMEObject namestring
OBJPROP_TEXTDescription of the object (the text contained in the object)string
OBJPROP_TOOLTIPThe text of a tooltip. If the property is not set, then the tooltip generated automatically by the terminal is shown. A tooltip can be disabled by setting the “\n” (line feed) value to itstring
OBJPROP_LEVELTEXTLevel descriptionstring    modifier=level number
OBJPROP_FONTFontstring
OBJPROP_BMPFILEThe name of BMP-file for Bitmap Label. See also Resourcesstring    modifier: 0-state ON, 1-state OFF
OBJPROP_SYMBOLSymbol for the Chart objectstring

For the OBJ_RECTANGLE_LABEL object (“Rectangle label”) one of the three design modes can be set, to which the following values of ENUM_BORDER_TYPE correspond.

ENUM_BORDER_TYPE

IdentifierDescription
BORDER_FLATFlat form
BORDER_RAISEDProminent form
BORDER_SUNKENConcave form

For the OBJ_EDIT object (“Edit”) and for the ChartScreenShot()function, you can specify the horizontal alignment type using the values of the ENUM_ALIGN_MODE enumeration.

ENUM_ALIGN_MODE

IdentifierDescription
ALIGN_LEFTLeft alignment
ALIGN_CENTERCentered (only for the Edit object)
ALIGN_RIGHTRight alignment
标签 MT4编程, MT4编程手册

标签云

Accelerator Oscillator (1)Accumulation/Distribution (1)AD (1)ADX (1)ADX指标 (1)Alligator (1)AO (1)ASCII (1)ATR (1)Average Directional Movement Index (1)Bears Power (1)BOLL (7)Bollinger Bands (1)Bulls Power (1)CCI (2)Commodity Channel Index (1)DeMarker (1)EA (44)EAM (1)Envelops (1)Fractals (1)Gator Oscillator (1)Ichimoku Kinko Hyo (1)kd (1)KDJ (5)keycode (1)K线 (1)K线从入门到精通 (1)K线入门 (1)K线定义 (1)K线知识 (1)MA (2)MACD (7)MACD指标 (1)MACD指标使用 (1)Market Facillitation Index (1)ME4 (1)MFI (1)Momentum (1)Moving Average (1)MQL (23)MQL4 (15)MT4 (33)MT4、指标 (1)MT4编程 (1)MT4自带指标 (1)OBV (2)On Balance Volume (1)Relative Strength Index (1)Relative Vigor Index (1)RSI (2)RVI (1)SAR (3)Standard Deviation (1)Stochastic Oscillator (1)Volumes (1)Williams'Percent Range (1)zigzag (1)zigzag指标使用 (1)一目平衡表 (1)主权信用评级 (2)主要货币 (1)主要货币对 (1)交易 (6)交易之外 (2)交易系统 (21)什么是外汇 (1)保证金 (1)分形指标 (1)加多摆动指标 (1)动量索引指标 (1)包络指标 (1)原理 (1)名称对照 (1)均线 (7)基本面 (1)基本面分析 (8)外汇 (98)外汇 MQL 编程 (1)外汇专业名词 (1)外汇交易 (3)外汇交易交易什么 (1)外汇交易平台 (1)外汇基本面 (7)外汇基础 (23)外汇定义 (1)外汇技术面 (4)外汇 编程 MQL (3)威廉指标 (1)学习外汇 (1)市场成分 (1)布林带 (2)平均方向移动指标 Average Directional Movement Index (1)平均真实波动范围指标 (1)平均真实波动范围指标 Average True Range (1)强力指标 (1)必知 (1)快捷键 (1)成交量 (1)技术面 (1)

推荐

  • MT4辅助操盘工具
  • MT4(MQL4)编程手册
  • 经典形态分析
  • K线从入门到精通
  • 新手如何炒外汇
  • 日内交易的好处
  • 操盘手成长之路
  • Mt4 热键(快捷键)

新手上路

  • 3小时学会MT4编程
  • 精选推荐
  • 操盘手成长之路
  • 日内交易的好处
  • 外汇MT4自带指标名称对照
  • Mt4 热键(快捷键)
  • 交易系统1-什么是交易系统
  • 新手如何炒外汇
  • MT4(MQL4)编程手册

MACD指标的使用

  • MACD
  • MACD指标图文详解-移动平均汇总/分离指标 MACD
  • MACD最佳参数设置
  • MACD指标使用方式
  • 如何使用MACD建立右侧交易系统
  • 如何使用MACD创建左侧交易系统
  • 指标2-3色MACD

标签云

ADX (1)ADX指标 (1)AO (1)ATR (1)BOLL (7)Bollinger Bands (1)CCI (2)EA (44)kd (1)KDJ (5)K线 (1)K线从入门到精通 (1)MA (2)MACD (7)MACD指标 (1)MT4 (33)OBV (2)SAR (3)zigzag (1)交易系统 (21)均线 (7)基本面 (1)外汇 (98)外汇 MQL 编程 (1)枢轴点 (1)枢轴点指标 (1)

BOLL指标(布林带)的使用

  • boll指标图文详解-布林通道 Bollinger Bands(布林带)

均线的使用

  • 均线指标图文详解-移动平均线-Moving Average-MA
  • 均线操盘
  • EA10-均线编程实例教程
广告合作
广告合作
QQ客服
  • 广告合作

近期文章

  • ASCII 码对照表
  • KDJ指标使用详解-随机震荡指标 Stochastic Oscillator
  • KDJ指标是什么
  • kdj指标三种颜色代表什么
  • boll指标图文详解-布林通道 Bollinger Bands(布林带)
  • KDJ指标金叉的使用
  • boll指标如何设置参数
  • BOLL指标二次突破如何使用
  • 如何使用BOLL指标进行交易
  • 首页
  • 外汇知识
    • 外汇基础知识
    • 外汇基本面分析
    • 外汇技术面分析
  • 外汇指标详解
  • 外汇交易系统
  • 外汇MT4编程
    • 3小时学会MT4编程
    • EA编程学习
    • MT4(MQL4)编程手册
  • EA下载
    • 免费工具使用及下载
    • EA指标源码
  • 外汇交易心理
  1. haolilai发表在新手如何炒外汇2022年4月8日

    www.waihui8.top

  2. yixia, jiao发表在键盘事件-Keycode对照表2022年1月20日

    不错的文章

Back to Top
©2021外汇编程

川公网安备 51010402000979号

蜀ICP备20016423号-1