- Object types and features of specifying their coordinates
- Time and price bound objects
- Objects bound to screen coordinates
- Creating objects
- Deleting objects
- Finding objects
- Overview of object property access functions
- Main object properties
- Price and time coordinates
- Anchor window corner and screen coordinates
- Defining anchor point on the object
- Managing the object state
- Priority of objects (Z-Order)
- Object display settings: color, style, and frame
- Font settings
- Rotating text at an arbitrary angle
- Determining object width and height
- Visibility of objects in the context of timeframes
- Assigning a character code to a label
- Ray properties for objects with straight lines
- Managing object pressed state
- Adjusting images in bitmap objects
- Cropping (outputting part) of an image
- Input field properties: alignment and read-only
- Standard deviation channel width
- Setting levels in level objects
- Additional properties of Gann, Fibonacci, and Elliot objects
- Chart object
- Moving objects
- Getting time or price at the specified line points
Managing the object state
Among the general properties of objects, there are several ones that control the state of objects. All such properties have a Boolean type, meaning they can be turned on (true) or off (false), and therefore require the use of the functions ObjectGetInteger and ObjectSetInteger.
Identifier |
Description |
---|---|
OBJPROP_HIDDEN |
Disable displaying the name of a graphical object in the list of objects in the relevant dialog (called from the context menu of the chart or by pressing Ctrl+B). |
OBJPROP_SELECTED |
Object selection |
OBJPROP_SELECTABLE |
Availability of an object for selection |
A value of true for OBJPROP_HIDDEN allows you to hide an unnecessary object from the user's list. By default, true is set for objects that display calendar events, the trading history, as well as for objects created from MQL programs. To see such graphical objects and access their properties, press the All button in the Object List dialog.
An object hidden in the list remains visible on the chart. To hide an object on the chart without deleting it, you can use the Visibility of objects in the context of timeframes setting.
The user cannot select and change the properties of objects for which OBJPROP_SELECTABLE is equal to false. Objects created programmatically are not allowed to be selected by default. As we saw in the ObjectCornerLabel.mq5 and ObjectAnchorLabel.mq5 scripts in the previous sections, it was necessary to explicitly set OBJPROP_SELECTABLE to true to unlock the ability to include OBJPROP_SELECTED as well. This is how we highlighted the anchor points on the object.
Usually, MQL programs allow the selection of their objects only if these objects serve as controls. For example, a trend line with a predefined name, which the user moves at will, can mean a condition for sending a trade order when the price crosses it.