ObjectGetTimeByValue

The function returns the time value for the specified price value of the specified object.

datetime  ObjectGetTimeByValue(
   long    chart_id,     // chart identifier
   string  name,         // object name
   double  value,        // Price
   int     line_id       // Line number
   );

Parameters

chart_id

[in]  Chart identifier. 0 means the current chart.

name

[in]  Name of the object.

value

[in]  Price value.

line_id

[in]  Line identifier.

Return Value

The time value for the specified price value of the specified object.

Note

The function uses a synchronous call, which 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.

An object can have several values in one price coordinate, therefore it is necessary to specify the line number. This function applies only to the following objects:

  • Trendline (OBJ_TREND)
  • Trendline by angle (OBJ_TRENDBYANGLE)
  • Gann line (OBJ_GANNLINE)
  • Equidistant channel (OBJ_CHANNEL) - 2 lines
  • Linear regression channel (OBJ_REGRESSION) - 3 lines
  • Standard deviation channel (OBJ_STDDEVCHANNEL) - 3 lines
  • Arrowed line (OBJ_ARROWED_LINE)

See also

Object Types