Download MetaTrader 5

Comment an open position

To add comments, please log in or register
huckey
35
huckey  

Hi,

  in my Expert I would need to update positions' comments when certain conditions are met.

  All I could find so far is that I can get these comment by using PositionGetString(POSITION_COMMENT). What I would need is the reverse, like PositionSetString(POSITION_COMMENT).

  I have been experimenting with something like this:

            mrequest.order = PositionGetInteger(POSITION_IDENTIFIER);

            mrequest.action = TRADE_ACTION_MODIFY;

            mrequest.comment = "MY COMMENT";

            OrderSend(mrequest, mresult).

 

  But this doesn't help, I get error code 4756.

 

  How can I update a position's comment?

 

Best regards

 

Huckey 

Documentation on MQL5: Standard Constants, Enumerations and Structures / Trade Constants / Position Properties
  • www.mql5.com
Standard Constants, Enumerations and Structures / Trade Constants / Position Properties - Documentation on MQL5
To add comments, please log in or register