Download MetaTrader 5
To add comments, please log in or register
Create Forum topics and improve your rating!
Mihai Ionescu
1274
Mihai Ionescu 2010.07.05 19:05 

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. 

khryniewiecki
23
khryniewiecki 2010.07.24 07:01  
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.

Mihai Ionescu
1274
Mihai Ionescu 2010.07.24 13:46  
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. 

Alexey Da
Moderator
6613
Alexey Da 2010.07.26 10:36  
At this moment you can write your own function or method of class which will make it for you.
/
To add comments, please log in or register