MQL4 Book  Appendixes  Types and Properties of Graphical Objects

Types and Properties of Graphical Objects


Graphical object type identifiers used with ObjectCreate(), ObjectsDeleteAll() and ObjectType() functions. It can be any of the following values:

Object Type
Value Description
OBJ_VLINE 0 Vertical line. Uses time part of first coordinate, price is ignored.
OBJ_HLINE 1 Horizontal line. Uses price part of first coordinate, time is ignored.
OBJ_TREND 2 Trend line. Uses 2 coordinates.
OBJ_TRENDBYANGLE 3 Trend by angle. Uses 2 coordinates or 1 coordinate and angle. To set a line angle (OBJPROP_ANGLE property) use ObjectSet() function.
OBJ_REGRESSION 4 Regression. Uses time parts of first 2 coordinates, price parts are ignored.
OBJ_CHANNEL 5 Equidistant channel. Uses 3 coordinates.
OBJ_STDDEVCHANNEL 6 Standard deviation channel. Uses time parts of first two coordinates, price parts are ignored.
OBJ_GANNLINE 7 Gann line. Uses 2 coordinates, but price part of the second coordinate is ignored. To set the ratio between the price and time scales (OBJPROP_SCALE property) use ObjectSet() function.
OBJ_GANNFAN 8 Gann fan. Uses 2 coordinates, but price part of the second coordinate is ignored. To set the ratio between the price and time scales (OBJPROP_SCALE property) use ObjectSet() function.
OBJ_GANNGRID 9 Gann grid. Uses 2 coordinates, but price part of the second coordinate is ignored. To set the ratio between the price and time scales (OBJPROP_SCALE property) use ObjectSet() function.
OBJ_FIBO 10 Fibonacci retracement. Uses 2 coordinates. To set the number of levels (OBJPROP_FIBOLEVELS property) and the values of levels (OBJPROP_FIRSTLEVEL+n property) use ObjectSet() function.
OBJ_FIBOTIMES 11 Fibonacci time zones. Uses 2 coordinates. To set the number of levels (OBJPROP_FIBOLEVELS property) and the values of levels (OBJPROP_FIRSTLEVEL+n property) use ObjectSet() function.
OBJ_FIBOFAN 12 Fibonacci fan. Uses 2 coordinates. To set the number of levels (OBJPROP_FIBOLEVELS property) and the values of levels (OBJPROP_FIRSTLEVEL+n property) use ObjectSet() function.
OBJ_FIBOARC 13 Fibonacci arcs. Uses 2 coordinates. To set the number of levels (OBJPROP_FIBOLEVELS property) and the values of levels (OBJPROP_FIRSTLEVEL+n property) use ObjectSet() function.
OBJ_EXPANSION 14 Fibonacci expansions. Uses 3 coordinates. To set the number of levels (OBJPROP_FIBOLEVELS property) and the values of levels (OBJPROP_FIRSTLEVEL+n property) use ObjectSet() function.
OBJ_FIBOCHANNEL 15 Fibonacci channel. Uses 3 coordinates. To set the number of levels (OBJPROP_FIBOLEVELS property) and the values of levels (OBJPROP_FIRSTLEVEL+n property) use ObjectSet() function.
OBJ_RECTANGLE 16 Rectangle. Uses 2 coordinates.
OBJ_TRIANGLE 17 Triangle. Uses 3 coordinates.
OBJ_ELLIPSE 18 Ellipse. Uses 2 coordinates. To set the ratio between the price and time scales (OBJPROP_SCALE property) use ObjectSet() function.
OBJ_PITCHFORK 19 Andrews pitchfork. Uses 3 coordinates.
OBJ_CYCLES 20 Time rounds (cyclic lines). Uses 2 coordinates.
OBJ_TEXT 21 Text. Uses 1 coordinate. To set the angle of the writing text (OBJPROP_ANGLE parameter) use ObjectSet() fucntion. To modify the text use ObjectSetText() fucntion.
OBJ_ARROW 22 Arrows (symbols). Uses 1 coordinate. To set the symbol code (OBJPROP_ARROWCODE parameter) use ObjectSet() function.
OBJ_LABEL 23 Text label. To set the coordinates in pixels relatively to the angle of connection (OBJPROP_CORNER, OBJPROP_XDISTANCE, OBJPROP_YDISTANCE parameters) use ObjectSet() function. To modify the text use ObjectSetText() fucntion.

Graphical object properties identifiers used with ObjectGet() и ObjectSet(), and can be any of the following values:

Object Parameters
Value Type Description
OBJPROP_TIME1 0 datetime Value to set/get first coordinate time part.
OBJPROP_PRICE1 1 double Value to set/get first coordinate price part.
OBJPROP_TIME2 2 datetime Value to set/get second coordinate time part.
OBJPROP_PRICE2 3 double Value to set/get second coordinate price part.
OBJPROP_TIME3 4 datetime Value to set/get third coordinate time part.
OBJPROP_PRICE3 5 double Value to set/get third coordinate price part.
OBJPROP_COLOR 6 color Value to set/get object color.
OBJPROP_STYLE 7 int Value to set/get line style.
OBJPROP_WIDTH 8 int Value to set/get object line width.
OBJPROP_BACK 9 bool Value to set/get background drawing flag for object.
OBJPROP_RAY 10 bool Value to set/get ray flag of objects like OBJ_TREND and alikes.
OBJPROP_ELLIPSE 11 bool Value to set/get ellipse flag for OBJ_FIBOARC object.
OBJPROP_SCALE 12 double Value to set/get scale object property.
OBJPROP_ANGLE 13 double Value to set/get angle object property in degrees for OBJ_TRENDBYANGLE obect.
OBJPROP_ARROWCODE 14 int Value or arrow enumeration to set/get arrow code property for OBJ_ARROW obect. It can be on of the wondings symbols or one of the predefined arrow codes.
OBJPROP_TIMEFRAMES 15 int Value to set/get timeframe object property. Can be one or combination of number of object visibility constants.
OBJPROP_DEVIATION 16 double Value to set/get deviation property for OBJ_STDDEVCHANNEL object.
OBJPROP_FONTSIZE 100 int Value to set/get font size for OBJ_TEXT and OBJ_LABEL objects.
OBJPROP_CORNER 101 int Value to set/get anchor corner property for OBJ_LABEL object. Must be from 0-3.
OBJPROP_XDISTANCE 102 int Value to set/get anchor X distance object property in pixels relatively to the angle of connection for OBJ_LABEL object.
OBJPROP_YDISTANCE 103 int Value to set/get anchor Y distance object property in pixels relatively to the angle of connection for OBJ_LABEL object.
OBJPROP_FIBOLEVELS 200 int Value to set/get Fibonacci object level count. Can be from 1 to 32.
OBJPROP_LEVELCOLOR 201 color Value to set/get object level line color.
OBJPROP_LEVELSTYLE 202 int Vlaue to set/get object level line style.
OBJPROP_LEVELWIDTH 203 int Value to set/get object level line width.
OBJPROP_FIRSTLEVEL+n 210+n int Value to set/get the number of the level of the object, where n is level index to set/get. Can be from 0 to 31.