expert advisor - miscellaneous questions - page 28

 

@honest_knave

I already read your great example #250 thanks a lot for that.

Now I try to use below code but I already know OnChartEvent() does not runs for(). ( If I am right )

Q:  How can I solve this issue, please? 

if(sparam=="#"+IntegerToString(OrderTicket())+" -"+"some object")

Thanks in advance. 


 

I'm sorry, I'm not quite sure what you are trying to do?

Is there an object called:

"#"+IntegerToString(OrderTicket())+" -"+"some object"

You also aren't checking the event id like in my example
 

 
honest_knave:

I'm sorry, I'm not quite sure what you are trying to do?
Is there an object called:

"#"+IntegerToString(OrderTicket())+" -"+"some object"

You also aren't checking the event id like in my example 

Yes there is object called which is I am trying to call my button object names.
I few times checked your example - it was very useful for me, but this is not drag objects this is button objects. 

 
Max Enrik:

Yes there is object called which is I am trying to call my button object names.
I few times checked your example - it was very useful for me, but this is not drag objects this is button objects. 

if(id==CHARTEVENT_OBJECT_CLICK && sparam=="#"+IntegerToString(OrderTicket())+" -"+"some object")
 
honest_knave:
if(id==CHARTEVENT_OBJECT_CLICK && sparam=="#"+IntegerToString(OrderTicket())+" -"+"some object")

I never mind it, thanks for your replies, much appreciate.
I already started to try it. 

 

OK, sorry I'm really not sure what you are trying to do.

Hope it helped ?!

 
honest_knave:

OK, sorry I'm really not sure what you are trying to do.
Hope it helped ?!

Unfortunately, I have not get good results.

So, OrderTicket() needs Order Select().
When I remove OrderTicket() it works perfect.
Also I already use " id " and " sparam " which one all of them works perfectly.

But this functions does not work with " OrderTicket() ".

Is it not possible that I can use OrderTicket() in my object names, please?

Thanks in advance.

OrderTicket - Trade Functions - MQL4 Reference
OrderTicket - Trade Functions - MQL4 Reference
  • docs.mql4.com
OrderTicket - Trade Functions - MQL4 Reference
 

Possibly your names are slightly different.

Try clicking your objects and see what they are really called:

if(id==CHARTEVENT_OBJECT_CLICK) Print(sparam);
 
honest_knave:

Possibly your names are slightly different.
Try clicking your objects and see what they are really called:

if(id==CHARTEVENT_OBJECT_CLICK) Print(sparam);

OMG!

It called right name.

2017...  USDJPY,M30: "my ea name" #********* -Object Button

Maybe I confused. So what? What is next step, please? Is it possible that I can use OrderTicket() in my object names?

Thanks for the prompt responses. 

 
Post up your code where you get the OrderTicket to make the name.
Reason: