What is the equivalent of ObjectSet in MQL5?

Hello, in mql4 has the function ‘ObjectSet’

but in mql5 there is no such function?

Hi @Matheus_Mathias. The equivalent of ObjsetSet() in MQL5 is ObjectSetInteger. The function sets the value of the corresponding object property. The object property must be of the datetime, int, color, bool or char type. There are 2 variants of this function:

  1. Setting property value, without modifier
bool  ObjectSetInteger( 
   long                             chart_id,       // chart identifier 
   string                           name,           // object name 
   ENUM_OBJECT_PROPERTY_INTEGER     prop_id,        // property 
   long                             prop_value      // value 
   );
  1. Setting a property value indicating the modifier
bool  ObjectSetInteger( 
   long                             chart_id,       // chart identifier 
   string                           name,           // object name 
   ENUM_OBJECT_PROPERTY_INTEGER     prop_id,        // property 
   int                              prop_modifier,  // modifier 
   long                             prop_value      // value 
   );

As explained in the official docs, ff 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.
Examples (from official docs):

  // 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_TIMEFRAMES, OBJ_PERIOD_M15 | OBJ_PERIOD_H1);

Hope that helps :wink::+1: