MQL4参考 物件函数 ObjectGet

ObjectGet

Returns the value of the specified object property.

double  ObjectGet(
   string   object_name,   // object name
   int      index          // object property
   );

Parameters

object_name

[in]  Object name.

index

[in]  Object property index. It can be any of the Object properties enumeration values.

Return Value

The value of the specified object property. To check errors, one has to call the GetLastError() function.

Note

When this function is used on the current chart, this chart is accessed directly, while in order to receive the properties of an object on a different chart, a synchronous call is used. The synchronous call means that the function waits for the execution of all commands that have been enqueued for this chart prior to its call, that is why this function can be time consuming. This feature should be taken into account when working with a large number of objects on a chart.

Example:

  color oldColor=ObjectGet("hline12"OBJPROP_COLOR);

See also

ObjectSet()