Is it possible to Comment at trade close in MT5.

 

Dear Friends,


I know we can comment during opening new trade. but I am wondering if there is possibility to comment at the time of closing trades in MT5???


Any comment will be highly appreciated!

 

You can only choose your initial comment when sending an order but you cannot modify it, only brokers can do that.

 
I think you can do it, test it
 
dbmlbm:

Dear Friends,

I know we can comment during opening new trade. but I am wondering if there is possibility to comment at the time of closing trades in MT5???

Any comment will be highly appreciated!

Yes, when send request to close trade, you must set comment. if you use Trade.mqh of MT5, then you must modify it.

or when manual close, you can input comment.
 
Trinh Dat:

Yes, when send request to close trade, you must set comment. if you use Trade.mqh of MT5, then you must modify it.

or when manual close, you can input comment.
Hi, are you sure? Can EA do that?
 
nerasignal:
Hi, are you sure? Can EA do that?
Sure, both EA and manual can do it.
 
Trinh Dat:
Sure, both EA and manual can do it.

 Hi Dear,

 I can set Comment at the time of manual close but can you explain how to set comment while closing from EA??

 

As Trinh wrote, you must modify the Trade.mqh file (or create your own custom function with Mqltraderequest) in order to manually set a comment to the position opened in order to close another one.

PS. Note that changing comment on an opened position is not possible, but modifying Trade.mqh (or using a custom function) it's possible to set a comment to the position that is triggered to close the other one, that is different.

 
Trinh Dat:

Yes, when send request to close trade, you must set comment. if you use Trade.mqh of MT5, then you must modify it.

or when manual close, you can input comment.

Hi Dear,

I tried to edit Trade.mqh but getting error message....... did I miss anything??

 
dbmlbm:

Hi Dear,

I tried to edit Trade.mqh but getting error message....... did I miss anything??

yes, need modify the fuction and add m_request.comment = comment;

also need to change at line 103.

 
Trinh Dat:

yes, need modify the fuction and add m_request.comment = comment;

also need to change at line 103.

I made it working!

Thanks a lot!

Reason: