【发布时间】:2021-03-22 17:49:36
【问题描述】:
好的,我有一封电子邮件,其中包含有关我的 EA 初始化状态的信息。
为什么我的字符串变量没有包含在我的电子邮件正文中,尽管声明了所有字符串变量?
int hourOfDay = Hour();
int startingHour = 12;
bool BarTime;
string eaName = WindowExpertName();
bool InitOrders;
bool InitTime;
string symbol = OrderSymbol();
int OnInit()
{
/*lastStamp = 0;
GetMarketInfo_PerSymbol(Symbol(), true);
fEvents(MODE_INIT);*/ /*Unrelated Code*/
InitOrders = OrdersTotal();
if(InitOrders == 0){
InitOrders = true;
Print("EA has been initialised to true");
}else{
InitOrders = false;
Print("EA has been initialised to false");
}
InitTime = (hourOfDay >= startingHour && hourOfDay < 20);
if(InitTime = true){
Print("Trades will be placed");
SendMail("Initialisation confirmation: "+(eaName),"Initialised by: User\n\nEA Name: "+(eaName)+"\n\nAsset: Forex CFD "+(symbol)+"\n\nDate of Initialisation "+TimeToString(TimeCurrent(),TIME_DATE | TIME_MINUTES)+" (This may differ from GMT)\n\nInitTime Status: Trades will be placed\n\nInitOrders: "+(InitOrders == True? "You have no open positions" : "You have an open position"));
}else{
InitTime = false;
Print("Trades will not be placed.");
MessageBox("Trades will not be placed until "+IntegerToString(startingHour - 2,0)+"AM GMT\n\nIf you feel this is incorrect, please email us at xxx","| Important Notification",MB_OK|MB_ICONINFORMATION|MB_TOPMOST);
SendMail("Initialisation confirmation: "+(eaName),"Initialised by: User\n\nEA Name: "+(eaName)+"\n\nAsset: Forex CFD "+(symbol)+"\n\nDate of Initialisation "+TimeToString(TimeCurrent(),TIME_DATE | TIME_MINUTES)+" (This may differ from GMT)\n\nInitTime Status: Trades will not be placed\n\nInitOrders: "+(InitOrders == True? "You have no open positions" : "You have an open position"));
}
BarTime=Time[0];
return(INIT_SUCCEEDED);
}
【问题讨论】:
标签: mql4