Is there a possibility to copy object settings in mql5?

 

What I'm trying to achieve is this:

1. The user creates a trendline in the client.

2. I want to duplicate this trendline with its settings.

3. Then modify the coordinates of new trendlines to fit some idea.

 

So is it possible to create an object from another? Copying it?

It it's not possible, can this account for a new feature in mql5? And if yes, how far in the future?

Thank you. 

 
void OnChartEvent(const int id,         // Event ID
                  const long& lparam,   // Parameter of type long event
                  const double& dparam, // Parameter of type double event
                  const string& sparam  // Parameter of type string events
  ) {

 

if  (id == CHARTEVENT_OBJECT_CREATE)  {

   // Here you can duplicate the object setting using ObjectGet... functions

}

}


Be aware that when user changes the name of the object then 2 events are generated: first CHARTEVENT_OBJECT_DELETE then CHARTEVENT_OBJECT_CREATE.

Actually there is a third event generated with id == 8 but this value is not documented and I have no idea what it is about.

 
khryniewiecki:
void OnChartEvent(const int id,         // Event ID
                  const long& lparam,   // Parameter of type long event
                  const double& dparam, // Parameter of type double event
                  const string& sparam  // Parameter of type string events
  ) {

 

if  (id == CHARTEVENT_OBJECT_CREATE)  {

   // Here you can duplicate the object setting using ObjectGet... functions

}

}


Be aware that when user changes the name of the object then 2 events are generated: first CHARTEVENT_OBJECT_DELETE then CHARTEVENT_OBJECT_CREATE.

Actually there is a third event generated with id == 8 but this value is not documented and I have no idea what it is about.

Thanks.

 Anyway, there will be lots of get and set commands. It would still be useful to have an ObjectCopy command, to avoid lots of get and set commands. 

 
At this moment you can write your own function or method of class which will make it for you.
Reason: