Skip to content

Object Functions

Object Functions

This is the group of functions intended for working with graphic objects relating to any specified chart.

The functions defining the properties of graphical objects, as well as ObjectCreate() and ObjectMove() operations for creating and moving objects along the chart are actually used for sending commands to the chart. If these functions are executed successfully, the command is included in the common queue of the chart events. Visual changes in the properties of graphical objects are implemented when handling the queue of the chart events.

Thus, do not expect an immediate visual update of graphical objects after calling these functions. Generally, the graphical objects on the chart are updated automatically by the terminal following the change events - a new quote arrival, resizing the chart window, etc. Use ChartRedraw() function to forcefully update the graphical objects.

FunctionAction
ObjectCreateCreates an object of the specified type in a specified chart
ObjectNameReturns the name of an object of the corresponding type in the specified chart (specified chart subwindow)
ObjectDeleteRemoves the object with the specified name from the specified chart (from the specified chart subwindow)
ObjectsDeleteAllRemoves all objects of the specified type from the specified chart (from the specified chart subwindow)
ObjectFindSearches for an object with the specified ID by the name
ObjectGetTimeByValueReturns the time value for the specified object price value
ObjectGetValueByTimeReturns the price value of an object for the specified time
ObjectMoveChanges the coordinates of the specified object anchor point
ObjectsTotalReturns the number of objects of the specified type in the specified chart (specified chart subwindow)
ObjectGetDoubleReturns the double value of the corresponding object property
ObjectGetIntegerReturns the integer value of the corresponding object property
ObjectGetStringReturns the string value of the corresponding object property
ObjectSetDoubleSets the value of the corresponding object property
ObjectSetIntegerSets the value of the corresponding object property
ObjectSetStringSets the value of the corresponding object property
TextSetFontSets the font for displaying the text using drawing methods (Arial 20 used by default)
TextOutTransfers the text to the custom array (buffer) designed for creation of a graphical resource
TextGetSizeReturns the string’s width and height at the current font settings

Every graphical object should have a name unique within one chart, including its subwindows. Changing of a name of a graphic object generates two events: event of deletion of an object with the old name, and event of creation of an object with a new name.

After an object is created or an object property is modified it is recommended to call the ChartRedraw() function, which commands the client terminal to forcibly draw a chart (and all visible objects in it).

Last updated on