The function creates an object with the specified name, type, and the initial coordinates in the specified chart subwindow of the specified chart. There are two variants of the function:
The function creates an object with the specified name, type, and the initial coordinates in the specified chart subwindow:
[in] Chart identifier.
[in] Name of the object. The name must be unique within a chart, including its subwindows.
[in] Object type. The value can be one of the values of the ENUM_OBJECT enumeration.
[in] Number of the chart subwindow. 0 means the main chart window. The specified subwindow must exist (window index must be greater or equal to 0 and less than WindowsTotal()), otherwise the function returns false.
[in] The time coordinate of the first anchor point.
[in] The price coordinate of the first anchor point.
[in] The time coordinate of the second anchor point.
[in] The price coordinate of the second anchor point.
[in] The time coordinate of the third anchor point.
[in] The price coordinate of the third anchor point.
[in] The time coordinate of the N-th anchor point.
[in] The price coordinate of the N-th anchor point.
Returns true or false depending on whether the object is created or not. To read more about the error call GetLastError(). If the object has been created already, the function tries to change its coordinates.
An object name should not exceed 63 characters. Characters not belonging to the current code page are not allowed (characters that cannot be converted from Unicode to ANSI are replaced with '?'). If programs are to be distributed among users with different code pages, we strongly recommend using Latin characters in object names.
Objects of the OBJ_LABEL type ignore the coordinates. Use the ObjectSet() function to set up the OBJPROP_XDISTANCE and OBJPROP_YDISTANCE properties. The chart sub-windows (if there are sub-windows with indicators in the chart) are numbered starting from 1. The chart main window always exists and has the 0 index. Coordinates must be passed in pairs: time and price. For example, the OBJ_VLINE object needs only time, but price (any value) must be passed, as well.