Download MetaTrader 5
MQL5 ReferenceObject FunctionsObjectGetValueByTime 

ObjectGetValueByTime

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

double  ObjectGetValueByTime(
   long      chart_id,     // chart identifier
   string    name,         // object name
   datetime  time,         // Time
   int       line_id       // Line number
   );

Parameters

chart_id

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

name

[in]  Name of the object.

time

[in]  Time value.

line_id

[in]  Line ID.

Return Value

The price value for the specified time 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