New name object after CTRL+ on graph (duplicate objects)

 

Hi guys,

I have question:

Is possible any automatic definition new name of object which made on graph after select old object, press CTRL and duplicate object.

Example:

I have objects OBJ_ARROW_RIGHT_PRICE, name "ABC", I make duplicate this object press CTRL... new name this object is "ARROW +number". I would like new name object was "ABC+something text" Is possible it? Thank you.

 
endy5: I would like new name object was "ABC+something text" Is possible it?
  1. And what would you expect would happen if you duplicated the new object? Get "ABC+something text+something text"?
  2. Not possible without code.
 

ad 1) ABC+number .th copy object, example: firsth duplicate object will be name "ABC1", other "ABC2" etc.

ad 2) yes, I know it. I can change desription of object but name?

 
You can change the name with ObjectSetString and OBJPROP_NAME
 
Ok, it is new information for me. So my problem now is "catch event" duplicate exist object on graph. Any idea?
 
endy5:
Ok, it is new information for me. So my problem now is "catch event" duplicate exist object on graph. Any idea?

You won't get duplicated object names, but you will get new objects created.

OnChartEvent

CHARTEVENT_OBJECT_CREATE

 
Hmm... It works good sometimes. Example: You have 2 objects OBJ_ARROW_RIGHT_PRICE, their names ABC1 and ABC2. When I doing duplicate object, new object will be name ARROW+any number (internal from MT). How get info which objects was duplicate? (object have the same color etc.)
 

Well, you could compare object properties with all the objects on the chart.

It would probably be better to write code to duplicate the object

Maybe store the name of the clicked object and then use a keydown event to duplicate it? 

 
I was thinkig about ... I need solution for hand duplicate object. So, maybe solution could be catch event clicked on master object and NEXT event would have to be CHARTEVENT_OBJECT_CREATE. Maybe... I try it.
 

Hmmm... I can not it :-( My idea from last post isn´t solution. Users can make a lot of other events between select master object and press CTRL key.

In addition to - after duplicate object by hand event click return name´s new object.

So - my question/problem staying: How get info (name of master object) which was duplicated?

 
endy5:

Hmmm... I can not it :-( My idea from last post isn´t solution. Users can make a lot of other events between select master object and press CTRL key.

In addition to - after duplicate object by hand event click return name´s new object.

So - my question/problem staying: How get info (name of master object) which was duplicated?

Can it be that the approach you have in mind is not an ideal one for mt4 and what it is offering?

Can you start to think of another solution?

Reason: