I'm coming across an intriguing message in some of my experimental EAs.
"Terminated by Timeout"
During my painful debugging phase, I realized that the code seems to freeze at the second to last line in a while statement. I put in some comments to see specifically where in the while statement the code gets stuck, but there doesn't seem to be much of a solution.
Any thoughts?
You'll also need this DLL
"Terminated by Timeout"
During my painful debugging phase, I realized that the code seems to freeze at the second to last line in a while statement. I put in some comments to see specifically where in the while statement the code gets stuck, but there doesn't seem to be much of a solution.
Any thoughts?
Inserted Code
//+------------------------------------------------------------------+
//| TickLoader.mq4 |
//| Copyright © 2009, Ronald Raygun |
//| http://Forex.Offers4u.biz/support/ |
//+------------------------------------------------------------------+
#property copyright "Copyright © 2009, Ronald Raygun"
#property link "http://Forex.Offers4u.biz/support/"
#import "HTTPComm.dll"
int GET(string url);
#import
//---- input parameters
extern string UserName = "";
extern bool ShowDiagnostics = True;
string SymbolUsed;
int TickCount = 0;
//+------------------------------------------------------------------+
//| expert initialization function |
//+------------------------------------------------------------------+
int init()
{
//----
Comment("Initalizing...n",
"Tick Count: ", TickCount);
SymbolUsed = StringSubstr(Symbol(), 0, 6);
//----
return(0);
}
//+------------------------------------------------------------------+
//| expert deinitialization function |
//+------------------------------------------------------------------+
int deinit()
{
//----
//----
return(0);
}
//+------------------------------------------------------------------+
//| expert start function |
//+------------------------------------------------------------------+
int start()
{
//----
string URL = "http://www-availableoffers.com/Test/DBLoad.php?TN="+SymbolUsed+"_NEW&TT="+TimeToStr(TimeCurrent(), TIME_DATE|TIME_SECONDS)+"&B="+DoubleToStr(NormalizeDouble(Bid,Digits),Digits)+"&A="+DoubleToStr(NormalizeDouble(Bid,Digits),Digits)+"&BN="+AccountCompany();
string URLA;
string URLB;
int Position = 0;
while (Position != -2)
{
URLA = StringTrimLeft(StringTrimRight(StringSubstr(URL, 0, StringFind(URL, " ", 0))));
URLB = StringTrimLeft(StringTrimRight(StringSubstr(URL, StringFind(URL, " ", 0))));
URL = URLA + "%20" + URLB;
Position = StringFind(URL, " ", 0);
if(Position == -1) break;
}
//Print(URL);
int Return = GET(URL);
if(ShowDiagnostics) Print(SymbolUsed+": "+Return);
while (Return == -1)
{
Return = GET(URL);
if(ShowDiagnostics) Print(SymbolUsed+": "+Return);
Print(SymbolUsed+": Call Failed. Retrying...");
}
TickCount++;
Comment("Initalized n",
"Tick Count: ", TickCount);
//----
return(0);
}
//+------------------------------------------------------------------+