MQL4参考 物件函数 ObjectSet

ObjectSet

Changes the value of the specified object property.

bool  ObjectSet(
   string   object_name,   // object name
   int      index,         // property index
   double   value          // value
   );

Parameters

object_name

[in]  Object name.

index

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

value

[in]  New value of the given property.

Returned value

If the function succeeds, the returned value will be true, otherwise it returns false. To get the detailed error information, one has to call the GetLastError() function.

Example:

  // moving the first coord to the last bar time
  ObjectSet("MyTrend", OBJPROP_TIME1, Time[0]);
  // setting the second fibo level
  ObjectSet("MyFibo", OBJPROP_FIRSTLEVEL+1, 1.234);
  // setting object visibility. object will be shown only on 15 minute and 1 hour charts
  ObjectSet("MyObject"OBJPROP_TIMEFRAMESOBJ_PERIOD_M15 | OBJ_PERIOD_H1);

See also

ObjectGet()