SendMail syntax

 

Hi i'm trying to use strings & variables inside SendMail() ... :

SendMail("Notify : Close opened position","Closed at : Ask="+SYMBOL_ASK+", Bid="+SYMBOL_BID+
         ", Date="+SYMBOL_TIME+" Symbol="+Symbol()+" Period="+Period()" Profit="+PositionGetDouble(POSITION_PROFIT));

errors i got :

'' - double quotes are needed

');' - unexpected end of program

 

Hello,

Please use the SRC button when you post code. Thank you.


This time, I edited it for you.

 
angevoyageur:

Hello,

Please use the SRC button when you post code. Thank you.


This time, I edited it for you.

yep, sorry. may you help me ?
 
blouf:
yep, sorry. may you help me ?

Certainly :

You can't use SYMBOL_BID, SYMBOL_ASK...this way, you have to use SymbolInfoDouble().

 
angevoyageur:

Certainly :

You can't use SYMBOL_BID, SYMBOL_ASK...this way, you have to use SymbolInfoDouble().

I thought it was a syntax problem since the error I get when using :

Profit = PositionGetDouble(POSITION_PROFIT);

if(EmailON) SendMail("Notify : Close opened position","Closed at : Ask="+SYMBOL_ASK+", Bid="+SYMBOL_BID+", Date="+SYMBOL_TIME+" Symbol="+Symbol()+" Period="+Period()" Profit="+Profit);


is :

' Profit=' - some operator expected  

 
*** Solved by closing the + after Period(). ***
Reason: