myeatrade

MQL4 Reference

MQL4 Standard constants(3)

Object types

Object type identifier constants used with ObjectCreate(), ObjectsDeleteAll() and ObjectType() functions. It can be any of the following values:

Objects can have 1-3 coordinates related to type.

Constant Value Description
OBJ_VLINE 0 Vertical line. Uses time part of first coordinate.
OBJ_HLINE 1 Horizontal line. Uses price part of first coordinate.
OBJ_TREND 2 Trend line. Uses 2 coordinates.
OBJ_TRENDBYANGLE 3 Trend by angle. Uses 1 coordinate. To set angle of line use ObjectSet() function.
OBJ_REGRESSION 4 Regression. Uses time parts of first two coordinates.
OBJ_CHANNEL 5 Channel. Uses 3 coordinates.
OBJ_STDDEVCHANNEL 6 Standard deviation channel. Uses time parts of first two coordinates.
OBJ_GANNLINE 7 Gann line. Uses 2 coordinate, but price part of second coordinate ignored.
OBJ_GANNFAN 8 Gann fan. Uses 2 coordinate, but price part of second coordinate ignored.
OBJ_GANNGRID 9 Gann grid. Uses 2 coordinate, but price part of second coordinate ignored.
OBJ_FIBO 10 Fibonacci retracement. Uses 2 coordinates.
OBJ_FIBOTIMES 11 Fibonacci time zones. Uses 2 coordinates.
OBJ_FIBOFAN 12 Fibonacci fan. Uses 2 coordinates.
OBJ_FIBOARC 13 Fibonacci arcs. Uses 2 coordinates.
OBJ_EXPANSION 14 Fibonacci expansions. Uses 3 coordinates.
OBJ_FIBOCHANNEL 15 Fibonacci channel. Uses 3 coordinates.
OBJ_RECTANGLE 16 Rectangle. Uses 2 coordinates.
OBJ_TRIANGLE 17 Triangle. Uses 3 coordinates.
OBJ_ELLIPSE 18 Ellipse. Uses 2 coordinates.
OBJ_PITCHFORK 19 Andrews pitchfork. Uses 3 coordinates.
OBJ_CYCLES 20 Cycles. Uses 2 coordinates.
OBJ_TEXT 21 Text. Uses 1 coordinate.
OBJ_ARROW 22 Arrows. Uses 1 coordinate.
OBJ_LABEL 23 Text label. Uses 1 coordinate in pixels.

Object properties

Object value index used with ObjectGet() and ObjectSet() functions. It can be any of the following values:

Constant Value Type Description
OBJPROP_TIME1 0 datetime Datetime value to set/get first coordinate time part.
OBJPROP_PRICE1 1 double Double value to set/get first coordinate price part.
OBJPROP_TIME2 2 datetime Datetime value to set/get second coordinate time part.
OBJPROP_PRICE2 3 double Double value to set/get second coordinate price part.
OBJPROP_TIME3 4 datetime Datetime value to set/get third coordinate time part.
OBJPROP_PRICE3 5 double Double value to set/get third coordinate price part.
OBJPROP_COLOR 6 color Color value to set/get object color.
OBJPROP_STYLE 7 int Value is one of STYLE_SOLID, STYLE_DASH, STYLE_DOT, STYLE_DASHDOT, STYLE_DASHDOTDOT constants to set/get object line style.
OBJPROP_WIDTH 8 int Integer value to set/get object line width. Can be from 1 to 5.
OBJPROP_BACK 9 bool Boolean value to set/get background drawing flag for object.
OBJPROP_RAY 10 bool Boolean value to set/get ray flag of object.
OBJPROP_ELLIPSE 11 bool Boolean value to set/get ellipse flag for fibo arcs.
OBJPROP_SCALE 12 double Double value to set/get scale object property.
OBJPROP_ANGLE 13 double Double value to set/get angle object property in degrees.
OBJPROP_ARROWCODE 14 int Integer value or arrow enumeration to set/get arrow code object property.
OBJPROP_TIMEFRAMES 15 int Value can be one or combination (bitwise addition) of object visibility constants to set/get timeframe object property.
OBJPROP_DEVIATION 16 double Double value to set/get deviation property for Standard deviation objects.
OBJPROP_FONTSIZE 100 int Integer value to set/get font size for text objects.
OBJPROP_CORNER 101 int Integer value to set/get anchor corner property for label objects. Must be from 0-3.
OBJPROP_XDISTANCE 102 int Integer value to set/get anchor X distance object property in pixels.
OBJPROP_YDISTANCE 103 int Integer value is to set/get anchor Y distance object property in pixels.
OBJPROP_FIBOLEVELS 200 int Integer value to set/get Fibonacci object level count. Can be from 0 to 32.
OBJPROP_LEVELCOLOR 201 color Color value to set/get object level line color.
OBJPROP_LEVELSTYLE 202 int Value is one of STYLE_SOLID, STYLE_DASH, STYLE_DOT, STYLE_DASHDOT, STYLE_DASHDOTDOT constants to set/get object level line style.
OBJPROP_LEVELWIDTH 203 int Integer value to set/get object level line width. Can be from 1 to 5.
OBJPROP_FIRSTLEVEL+n 210+n int Integer value to set/get the value of Fibonacci object level with index n. Index n can be from 0 (number of levels -1), but not larger than 31.

Object visibility

Timeframes where object may be shown. Used in ObjectSet() function to set OBJPROP_TIMEFRAMES property.

Constant Value Description
OBJ_PERIOD_M1 0x0001 Object shown is only on 1-minute charts.
OBJ_PERIOD_M5 0x0002 Object shown is only on 5-minute charts.
OBJ_PERIOD_M15 0x0004 Object shown is only on 15-minute charts.
OBJ_PERIOD_M30 0x0008 Object shown is only on 30-minute charts.
OBJ_PERIOD_H1 0x0010 Object shown is only on 1-hour charts.
OBJ_PERIOD_H4 0x0020 Object shown is only on 4-hour charts.
OBJ_PERIOD_D1 0x0040 Object shown is only on daily charts.
OBJ_PERIOD_W1 0x0080 Object shown is only on weekly charts.
OBJ_PERIOD_MN1 0x0100 Object shown is only on monthly charts.
OBJ_ALL_PERIODS 0x01FF Object shown is on all timeframes.
NULL 0 Object shown is on all timeframes.
EMPTY -1 Hidden object on all timeframes.
This article url: http://www.myeatrade.com/425/

Please login to post comment, if you haven't account you can register free