Alert("Your ticket # is:" + string(ticket));
改成:
Alert("Your ticket # is:" , ticket);
或者:
Alert("Your ticket # is:" , IntegerToString(ticket));
Alert("Your ticket # is:" + string(ticket));
改成:
Alert("Your ticket # is:" , ticket);
或者:
Alert("Your ticket # is:" , IntegerToString(ticket));
#property link "https://www.mql5.com"
#property version "1.00"
#property strict
#property script_show_inputs
//+------------------------------------------------------------------+
//| Script program start function |
//+------------------------------------------------------------------+
extern int TakeProfit =100;
extern int StopLoss = 100;
void OnStart()
{
double TakeProfitLevel;
double StopLossLevel;
TakeProfitLevel = Bid + TakeProfit*Point; //point=0.00001
StopLossLevel = Bid - StopLoss*Point;
/*
ticket # can return:
ticket #; OR
-1 (if OrderSend failed)
*/
int ticket;
ticket = OrderSend("EURUSD", OP_BUY, 1.0, Ask, 10, StopLossLevel, TakeProfitLevel, "My EA!");
if(ticket < 0)
{
Alert("Error!");
}
else
{
Alert("Your ticket # is:" + string(ticket));
}
}