MQL4参考 物件函数 ObjectGetTimeByValue

ObjectGetTimeByValue

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

datetime  ObjectGetTimeByValue(
   long     chart_id,      // chart ID
   string   object_name,   // object name
   double   value,         // price
   int      line_id=0      // line identifier
   );

Parameters

chart_id

[in]  Chart identifier.

object_name

[in]  Name of the object.

value

[in]  Price value.

line_id=0

[in]  Line identifier.

Return Value

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

Note

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

See also

Object Types