Download MetaTrader 5
MQL5 ReferenceObject FunctionsObjectGetTimeByValue 

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

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


Updated: 2015.12.03