Download MetaTrader 5

defining order comment in mql4 source code

To add comments, please log in or register
sami awan
79
sami awan  
I have written an mt4 EA. I want it to display my contact information in order comment. What exactly should i write in source code if i want my EA to display my email id that is, "sammiawan@gmail.com" in the order comments and charts.
Thank in advance.
peter.MT4Web
157
peter.MT4Web  
If you want your email id as OrderComment, insert it in your OrderSend call.
Keith Watford
Moderator
10637
Keith Watford  

You put it in the OrderComment parameter when using OrderSend().

You use Comment() on the chart

You've written an EA and you don't know this?

Vasyl Nosal
19055
Vasyl Nosal  
Better to use #property description
sami awan
79
sami awan  
sammiawan999:

Thanks brother. What exactly should i type in the source code?  Can you please type here for me? That complete line..

I actually wrote in ordersend () parameter but its not displaying :D
Keith Watford
Moderator
10637
Keith Watford  
sammiawan999:

I actually wrote in ordersend () parameter but its not displaying :D
Not displaying where?
sami awan
79
sami awan  
GumRai:
Not displaying where?

In the comment it is only displaying [tp] or [sl] as the case is.
Keith Watford
Moderator
10637
Keith Watford  
sammiawan999:

In the comment it is only displaying [tp] or [sl] as the case is.
Then your broker is overwriting the comment. Check the order comment while it is still open.
sami awan
79
sami awan  
GumRai:
Then your broker is overwriting the comment. Check the order comment while it is still open.

No when trade is open its showing blank:(((
This is what exactly my EA code contains:
OrderSend(Symbol(),OP_BUY,Lots,Ask,Slippage,0,0,"sammiawan@gmail.com,MagicNumber,0,Blue);
Keith Watford
Moderator
10637
Keith Watford  
sammiawan999:

No when trade is open its showing blank:(((
This is what exactly my EA code contains:
OrderSend(Symbol(),OP_BUY,Lots,Ask,Slippage,0,0,"sammiawan@gmail.com,MagicNumber,0,Blue);

You should get a compiler error because of the missing " after com

I can only guess that your broker is removing the order comments for some reason. Check with them

Vasyl Nosal
19055
Vasyl Nosal  
GumRai:

You should get a compiler error because of the missing " after com

I can only guess that your broker is removing the order comments for some reason. Check with them

Oh gush. Order of comment changes if:order closes by tp or sl or partial close of order.
12
To add comments, please log in or register