Inserting a comment into the deal history of an EA

 

Hi Guys,

How can I insert a comment into the history page of an EA? Every time it puts a line into the history column, I want to add the EA name into the comments column. Any ideas how to do that?

Thanks! 

 
OrderComment()
 
Marco vd Heijden:
Thanks!
 
FirestarZA:
Thanks!
OrderComment() 

Its to read the comment when the order is selected,

The actual comment is put through in the (MQL4) OrderSend() function:

OrderSend

The main function used to open market or place a pending order.

int  OrderSend( 
   string   symbol,              // symbol 
   int      cmd,                 // operation 
   double   volume,              // volume 
   double   price,               // price 
   int      slippage,            // slippage 
   double   stoploss,            // stop loss 
   double   takeprofit,          // take profit 
   string   comment=NULL,        // comment 
   int      magic=0,             // magic number 
   datetime expiration=0,        // pending order expiration 
   color    arrow_color=clrNONE  // color 
   );
 

There the yellow lines, and for MQL5:

struct MqlTradeRequest
  {
   ENUM_TRADE_REQUEST_ACTIONS    action;           // Trade operation type
   ulong                         magic;            // Expert Advisor ID (magic number)
   ulong                         order;            // Order ticket
   string                        symbol;           // Trade symbol
   double                        volume;           // Requested volume for a deal in lots
   double                        price;            // Price
   double                        stoplimit;        // StopLimit level of the order
   double                        sl;               // Stop Loss level of the order
   double                        tp;               // Take Profit level of the order
   ulong                         deviation;        // Maximal possible deviation from the requested price
   ENUM_ORDER_TYPE               type;             // Order type
   ENUM_ORDER_TYPE_FILLING       type_filling;     // Order execution type
   ENUM_ORDER_TYPE_TIME          type_time;        // Order expiration type
   datetime                      expiration;       // Order expiration time (for the orders of ORDER_TIME_SPECIFIED type)
   string                        comment;          // Order comment
   ulong                         position;         // Position ticket
   ulong                         position_by;      // The ticket of an opposite position
  };

 
Marco vd Heijden:

Its to read the comment when the order is selected,

The actual comment is put through in the (MQL4) OrderSend() function:

There the yellow lines, and for MQL5:

I was just about to ask for more clarification. I'm not a programmer. I only know enough to follow, so I was going through code in the examples to try and find ordercomment to see how it was used. Thanks for explaining! I think I now have it! :)