Error number 6 - page 27

 
 
You mean<br / translate="no">"IsConnected - collecting statistics of terminal connection to the server ;)"
Or is there a more recent version?

we're talking about the EA presented in this thread. so as not to race you through it i'll present my own copy which i've been working with.
//+------------------------------------------------------------------+
//|                                                    TestQuark.mq4 |
//|                      Copyright © 2005, MetaQuotes Software Corp. |
//|                                        https://www.metaquotes.net |
//+------------------------------------------------------------------+
#property copyright "Copyright © 2005, MetaQuotes Software Corp."
#property link      "https://www.metaquotes.net"

double dStopLoss;
int nHoursToHold;

datetime timePrev = 0;
int nBars;
int nDelaySeconds = 3;

int nSlip = 50;

double dLotSize = 0.1;

int nMagic = 0;
int nDigits;

string strTradeSemaphore = "TradeSemaphore";

//////////////////
int init()
{
	nBars = Bars;

	if(!IsTesting() && !GlobalVariableCheck(strTradeSemaphore)) 
		GlobalVariableSet(strTradeSemaphore, 0.0);
	
	dStopLoss = 110 * Point;
	nHoursToHold = 1;

	nDigits = MarketInfo( Symbol(), MODE_DIGITS );
	
	if(Symbol() == "EURUSD")
		nMagic = 1;
	else if(Symbol() == "EURJPY")
		nMagic = 2;
	else if(Symbol() == "USDCHF")
		nMagic = 3;
	else if(Symbol() == "GBPUSD")
		nMagic = 4;
	else if(Symbol() == "GBPJPY")
		nMagic = 5;
	else if(Symbol() == "GBPCHF")
		nMagic = 6;
	else if(Symbol() == "USDJPY")
		nMagic = 7;
	else if(Symbol() == "AUDUSD")
		nMagic = 8;
	else if(Symbol() == "EURGBP")
		nMagic = 9;
	else if(Symbol() == "USDCAD")
		nMagic = 10;
	else if(Symbol() == "EURCHF")
		nMagic = 11;
	else if(Symbol() == "EURAUD")
		nMagic = 12;
		
	return(0);	
}

// ------

int deinit()
{
	return(0);
}

// ------

int start()
{
	if(Bars < 5)
		return(0);
	
/*	// The previous bar just closed
	bool bIsBarEnd = false;
	if(timePrev != Time[0] + nMagic) 
		bIsBarEnd = true;
	timePrev = Time[0] + nMagic;
*/

	bool bIsBarEnd = false;
	if(nBars != Bars)
	{
		if(IsTesting() || (!IsTesting() && CurTime() > Time[0] + nMagic * nDelaySeconds))
		{
			bIsBarEnd = true;
			nBars = Bars;
		}
	}
	
	if(!bIsBarEnd)
		return(0);

	// ------
	
	if(!IsTesting())
	{
		while(!IsStopped())
		{
			if(GlobalVariableSetOnCondition(strTradeSemaphore,1.0,0.0))
				break;
		
			Sleep(1000);
		}
	}
	
	RefreshRates();
	
	for(int nCnt = OrdersTotal() - 1; nCnt >= 0; nCnt--)
	{
		OrderSelect(nCnt, SELECT_BY_POS, MODE_TRADES);

		if(OrderMagicNumber() == nMagic)
		{
			if(CurTime() - OrderOpenTime() > (nHoursToHold - 1) * 60 * 60)
			{
			   int type=OrderType();
			   int ticket=OrderTicket();
			   double lots=OrderLots();
			   for(int i=0; i<3; i++)
			     {
				     if(type == OP_BUY)
					     OrderClose(ticket, lots, Bid, nSlip, Aqua);
				     else if(type == OP_SELL)
					     OrderClose(ticket, lots, Ask, nSlip, OrangeRed);
					  int nError=GetLastError();
					  if(nError==0) break;
					  Sleep(1000);
                 RefreshRates();
				  }
			}
		}
	}

	int nSignal = GetSignal();
	
	if(nSignal == OP_BUY) 
		Buy();
	else if(nSignal == OP_SELL) 
		Sell();

	if(!IsTesting())
		GlobalVariableSet(strTradeSemaphore, 0.0);	
	
	return(0);
}
// ------

void Sell()
{
	if(AccountFreeMargin() < 500)
		return;

	dLotSize = GetLotSize();
   for(int i=0; i<3; i++)
     {
//	   double dNormalizer = MathPow(10, nDigits);
	     double dBid = Bid;//MathFloor(Bid * dNormalizer) / dNormalizer; //NormalizeDouble(Bid, nDigits);
	     double dStop = Bid + dStopLoss;//MathFloor((Bid + dStopLoss) * dNormalizer) / dNormalizer; //NormalizeDouble(Bid + dStopLoss, nDigits);

	     int nResult = OrderSend(Symbol(), OP_SELL, dLotSize, dBid, 
		                          nSlip, dStop, 0, "Friday", nMagic, 0, OrangeRed);

	     if(nResult == -1)
	     {
		    int nError = GetLastError();
		    Alert(Symbol() + ", sell: " + dBid + ", Stop: " + dStop + ", error: " + nError);
			 Sleep(1000);
      	 RefreshRates();
	     }
	     else break;
	  }
}

// ------

void Buy()
{
	if(AccountFreeMargin() < 500)
		return;

	dLotSize = GetLotSize();

   for(int i=0; i<3; i++)
     {
//	     double dNormalizer = MathPow(10, nDigits);
	     double dAsk = Ask;//MathFloor(Ask * dNormalizer) / dNormalizer; //NormalizeDouble(Bid, nDigits);
	     double dStop = Ask - dStopLoss;//MathFloor((Ask - dStopLoss) * dNormalizer) / dNormalizer; //NormalizeDouble(Bid + dStopLoss, nDigits);

	     int nResult = OrderSend(Symbol(), OP_BUY, dLotSize, dAsk, 
		                          nSlip, dStop, 0, "Friday", nMagic, 0, Aqua);

	     if(nResult == -1)
	     {
		    int nError = GetLastError();
		    Alert(Symbol() + ", buy: " + dAsk + 
			      ", Stop: " + dStop + ", error: " + nError);
			 Sleep(1000);
      	 RefreshRates();
	     }
	     else break;
	 }
}
// ------

double GetLotSize()
{
	double dLot = 0.1;
	
	return(dLot);
}

// ------

int GetSignal()
{
	int nSignal;
	if(MathMod(Hour(), 2) == 0)
		nSignal = OP_BUY;
	else
		nSignal = OP_SELL;
		
	return(nSignal);
}


//+------------------------------------------------------------------+
 
Another log. Two logs to be exact. One is from the log, the second (below the first one) is from my bug reporting system, I've given this system in the posts in this thread.

Log 1.
2005.10.11 20:19:48 Old tick GBPUSD60 1.7478/1.7482
2005.10.11 20:09:47 Old tick GBPJPY60 199.7100/199.7900
2005.10.11 20:05:51 '142605': order #2155774 buy 0.10 USDJPY at 114.3900 has been modified -> sl: 113.6600 tp: 115.3900
2005.10.11 20:05:51 '142605': request in process
2005.10.11 20:05:51 '142605': request was accepted by server
2005.10.11 20:05:51 '142605': modify order #2155774 buy 0.10 USDJPY at 114.3900 sl: 113.4900 tp: 115.3900 -> sl: 113.6600 tp: 115.3900
2005.10.11 20:05:50 '142605': pending order #2155773 has been deleted
2005.10.11 20:05:50 '142605': request in process
2005.10.11 20:05:50 '142605': request was accepted by server
2005.10.11 20:04:59 '142605': delete pending order #2155773 sell stop 0.10 USDJPY at 113.6900 sl: 114.5900 tp: 112.6900
2005.10.11 20:04:56 '142605': order is open : #2165270 buy stop 0.10 EURJPY at 137.6500 sl: 135.6500 tp: 138.6500
2005.10.11 20:04:55 '142605': request in process
2005.10.11 20:04:55 '142605': request was accepted by server
2005.10.11 20:04:55 '142605': pending order buy stop 0.10 EURJPY at 137.6500 sl: 135.6500 tp: 138.6500
2005.10.11 20:04:55 '142605': login (4.00, #281BB516)
2005.10.11 20:04:54 TradeContext: ping error
2005.10.11 20:04:14:14 '142605': pending order sell stop 0.10 EURJPY at 136.8800 sl: 138.8800 tp: 135.8800
2005.10.11 20:04:14 '142605': login (4.00, #281BB516)
2005.10.11 19:17:55 TradeContext: ping failed
2005.10.11 19:16:49 TradeContext: '142605' cannot login to: MetaQuotes-demo
2005.10.11 19:16:16 TradeContext: transaction sending error
2005.10.11 19:16:16 '142605': delete pending order #2155773 sell stop 0.10 USDJPY at 113.6900 sl: 114.5900 tp: 112.6900
2005.10.11 19:15:55 '142605': order #2130092 buy 0.10 EURUSD at 1.2140 sl: 1.1973 tp: 0.0000 closed at price 1.2011
2005.10.11 19:15:55 '142605': request in process
2005.10.11 19:15:55 '142605': request was accepted by server
2005.10.11 19:15:15 '142605': close order #2130092 buy 0.10 EURUSD at 1.2140 sl: 0.0000 tp: 0.0000 at price 1.2011
2005.10.11 19:15:15 '142605': login (4.00, #281BB516)
2005.10.11 19:15:05 TradeContext: ping failed
2005.10.11 19:15:05 TradeContext: ping error
2005.10.11 19:14:25 '142605': close order #2130092 buy 0.10 EURUSD at 1.2140 sl: 0.0000 tp: 0.0000 at price 1.2008
2005.10.11 19:14:25 '142605': login (4.00, #281BB516)
2005.10.11 19:14:14 TradeContext: ping failed
2005.10.11 19:14:14:14 TradeContext: ping error
2005.10.11 19:13:34 '142605': close order #2130092 buy 0.10 EURUSD at 1.2140 sl: 0.0000 tp: 0.0000 at price 1.2005
2005.10.11 19:13:34 '142605': login (4.00, #281BB516)
2005.10.11 19:13:23 TradeContext: ping failed
2005.10.11 19:13:23 TradeContext: ping error
2005.10.11 19:12:23 '142605': close order #2130092 buy 0.10 EURUSD at 1.2140 sl: 0.0000 tp: 0.0000 at price 1.2005
2005.10.11 19:12:23 '142605': login (4.00, #281BB516)
2005.10.11 19:12:13 TradeContext: ping failed
2005.10.11 19:12:12 TradeContext: ping error
2005.10.11 19:11:32 '142605': close order #2130092 buy 0.10 EURUSD at 1.2140 sl: 0.0000 tp: 0.0000 at price 1.2004
2005.10.11 19:11:32 '142605': login (4.00, #281BB516)
2005.10.11 19:11:22 TradeContext: ping failed
2005.10.11 19:11:22 TradeContext: ping error
2005.10.11 19:10:21 '142605': close order #2130092 buy 0.10 EURUSD at 1.2140 sl: 0.0000 tp: 0.0000 at price 1.2004
2005.10.11 19:10:21 '142605': login (4.00, #281BB516)
2005.10.11 19:10:10 TradeContext: ping failed
2005.10.11 19:10:10 TradeContext: ping error
2005.10.11 19:09:30 '142605': close order #2130092 buy 0.10 EURUSD at 1.2140 sl: 0.0000 tp: 0.0000 at price 1.2006
2005.10.11 19:09:30 '142605': login (4.00, #281BB516)
2005.10.11 19:09:19 TradeContext: ping failed
2005.10.11 19:09:19 TradeContext: ping error
2005.10.11 19:08:19 '142605': close order #2130092 buy 0.10 EURUSD at 1.2140 sl: 0.0000 tp: 0.0000 at price 1.2003
2005.10.11 19:08:19 '142605': login (4.00, #281BB516)
2005.10.11 19:08:06 TradeContext: ping failed
2005.10.11 19:08:05:05 TradeContext: '142605' cannot login to: MetaQuotes-demo
2005.10.11 19:07:23 TradeContext: ping failed
2005.10.11 19:07:23 TradeContext: ping error
2005.10.11 19:06:22 '142605': close order #2130092 buy 0.10 EURUSD at 1.2140 sl: 0.0000 tp: 0.0000 at price 1.1999
2005.10.11 19:06:22 '142605': login (4.00, #281BB516)
2005.10.11 19:06:19 TradeContext: ping failed
2005.10.11 19:06:19 TradeContext: ping error
2005.10.11 19:05:19 '142605': pending order buy stop 0.10 EURJPY at 137.7600 sl: 135.7600 tp: 138.7600
2005.10.11 19:05:19 '142605': login (4.00, #281BB516)
2005.10.11 19:05:18 TradeContext: ping error
2005.10.11 19:04:18 '142605': pending order sell stop 0.10 EURJPY at 136.8800 sl: 138.8800 tp: 135.8800
2005.10.11 19:04:17 '142605': login (4.00, #281BB516)
2005.10.11 18:13:59 '142605': order #2144293 buy 0.10 USDJPY at 113.7400 was modified -> sl: 113.3800 tp: 0.0000
2005.10.11 18:13:59 '142605': request in process
2005.10.11 18:13:59 '142605': request was accepted by server
2005.10.11 18:13:23 '142605': modify order #2144293 buy 0.10 USDJPY at 113.7400 sl: 113.2900 tp: 0.0000 -> sl: 113.3800 tp: 0.0000
2005.10.11 18:10:00 '142605': order #2135657 buy 0.10 USDJPY at 113.3500 was modified -> sl: 113.5000 tp: 0.0000
2005.10.11 18:10:00 '142605': request in process
2005.10.11 18:10:00 '142605': request was accepted by server
2005.10.11 18:09:12 '142605': modify order #2135657 buy 0.10 USDJPY at 113.3500 sl: 113.4000 tp: 0.0000 -> sl: 113.5000 tp: 0.0000
2005.10.11 18:04:18 '142605': order #2139090 sell 0.10 EURUSD at 1.2099 was modified -> sl: 1.2100 tp: 1.1799
2005.10.11 18:04:18 '142605': request in process
2005.10.11 18:04:18 '142605': request was accepted by server
2005.10.11 18:04:18 '142605': modify order #2139090 sell 0.10 EURUSD at 1.2099 sl: 1.2116 tp: 1.1799 -> sl: 1.2100 tp: 1.1799
2005.10.11 18:01:57 '142605': order #2137049 sell 0.10 EURUSD at 1.2167 was modified -> sl: 1.2229 tp: 0.0000
2005.10.11 18:01:57 '142605': request in process
2005.10.11 18:01:57 '142605': request was accepted by server
2005.10.11 18:01:57 '142605': modify order #2137049 sell 0.10 EURUSD at 1.2167 sl: 1.2249 tp: 0.0000 -> sl: 1.2229 tp: 0.0000
2005.10.11 18:01:57 '142605': login (4.00, #281BB516)
2005.10.11 17:04:18 '142605': order #2139090 sell 0.10 EURUSD at 1.2099 was modified -> sl: 1.2116 tp: 1.1799
2005.10.11 17:04:18 '142605': request in process
2005.10.11 17:04:18 '142605': request was accepted by server
2005.10.11 17:04:17 '142605': modify order #2139090 sell 0.10 EURUSD at 1.2099 sl: 1.2125 tp: 1.1799 -> sl: 1.2116 tp: 1.1799
2005.10.11 17:01:50 '142605': order #2137049 sell 0.10 EURUSD at 1.2167 was modified -> sl: 1.2249 tp: 0.0000
2005.10.11 17:01:50 '142605': request in process
2005.10.11 17:01:50 '142605': request was accepted by server
2005.10.11 17:01:50 '142605': modify order #2137049 sell 0.10 EURUSD at 1.2167 sl: 1.2255 tp: 0.0000 -> sl: 1.2249 tp: 0.0000
2005.10.11 17:01:08 '142605': order #1986223 sell 0.10 AUDUSD at 0.7629 was modified -> sl: 0.7628 tp: 0.7512
2005.10.11 17:01:08 '142605': request in process
2005.10.11 17:01:08 '142605': request was accepted by server
2005.10.11 17:01:08 '142605': modify order #1986223 sell 0.10 AUDUSD at 0.7629 sl: 0.7729 tp: 0.7512 -> sl: 0.7628 tp: 0.7512
2005.10.11 17:01:08 '142605': login (4.00, #281BB516)
2005.10.11 16:06:22 '142605': order #2140245 buy 0.10 AUDUSD at 0.7589 sl: 0.7509 tp: 0.0000 closed at price 0.7552
2005.10.11 16:06:22 '142605': request in process
2005.10.11 16:06:22 '142605': request was accepted by server
2005.10.11 16:06:22 '142605': close order #2140245 buy 0.10 AUDUSD at 0.7589 sl: 0.0000 tp: 0.0000 at price 0.7552
2005.10.11 16:06:21 '142605': login (4.00, #281BB516)
2005.10.11 14:33:41 '142605': login (4.00, #281BB516)
2005.10.11 14:29:12 '142605': connect failed [6]
2005.10.11 14:00:20 '142605': order #2158310 buy 0.10 EURUSD at 1.2037 sl: 1.1957 tp: 0.0000 closed at price 1.2033
2005.10.11 14:00:20 '142605': request in process
2005.10.11 14:00:20 '142605': request was accepted by server
2005.10.11 14:00:20 '142605': close order #2158310 buy 0.10 EURUSD at 1.2037 sl: 0.0000 tp: 0.0000 at price 1.2033
2005.10.11 14:00:20 '142605': login (4.00, #281BB516)
2005.10.11 13:10:39 '142605': order is open : #2161539 sell 0.10 EURAUD at 1.5888 sl: 1.5963 tp: 1.5813
2005.10.11 13:10:39 '142605': request in process
2005.10.11 13:10:39 '142605': request was accepted by server
2005.10.11 13:10:39 '142605': instant order sell 0.10 EURAUD at 1.5888 sl: 1.5963 tp: 1.5813
2005.10.11 13:10:39 '142605': login (4.00, #281BB516)
2005.10.11 13:04:29 '142605': pending order #2160764 was deleted
2005.10.11 13:04:29 '142605': request in process
2005.10.11 13:04:29 '142605': request was accepted by server
2005.10.11 13:04:29 '142605': delete pending order #2160764 buy stop 0.10 GBPJPY at 200.6800 sl: 199.1800 tp: 201.6800
2005.10.11 13:04:29 '142605': login (4.00, #281BB516)
2005.10.11 12:11:21 '142605': order #2156460 sell 0.10 USDJPY at 114.0700 was modified -> sl: 115.9700 tp: 0.0000
2005.10.11 12:11:21 '142605': request in process
2005.10.11 12:11:21 '142605': request was accepted by server
2005.10.11 12:11:20 '142605': modify order #2156460 sell 0.10 USDJPY at 114.0700 sl: 116.0700 tp: 0.0000 -> sl: 115.9700 tp: 0.0000
2005.10.11 12:08:06 '142605': order #2145173 sell 0.10 GBPJPY at 200.4800 was modified -> sl: 200.4300 tp: 0.0000
2005.10.11 12:08:06 '142605': request in process
2005.10.11 12:08:06 '142605': request was accepted by server
2005.10.11 12:08:06 '142605': modify order #2145173 sell 0.10 GBPJPY at 200.4800 sl: 200.5400 tp: 0.0000 -> sl: 200.4300 tp: 0.0000
2005.10.11 12:07:35 '142605': order #2149217 sell 0.10 EURJPY at 137.8900 was modified -> sl: 137.7400 tp: 0.0000
2005.10.11 12:07:35 '142605': request in process
2005.10.11 12:07:35 '142605': request was accepted by server
2005.10.11 12:07:35 '142605': modify order #2149217 sell 0.10 EURJPY at 137.8900 sl: 137.8400 tp: 0.0000 -> sl: 137.7400 tp: 0.0000
2005.10.11 12:04:28 '142605': order is open : #2160764 buy stop 0.10 GBPJPY at 200.6800 sl: 199.1800 tp: 201.6800
2005.10.11 12:04:28 '142605': request in process
2005.10.11 12:04:28 '142605': request was accepted by server
2005.10.11 12:04:27 '142605': pending order buy stop 0.10 GBPJPY at 200.6800 sl: 199.1800 tp: 201.6800
2005.10.11 12:04:27 '142605': order is open : #2160763 sell stop 0.10 GBPJPY at 199.1500 sl: 200.6500 tp: 198.1500
2005.10.11 12:04:27 '142605': request in process
2005.10.11 12:04:27 '142605': request was accepted by server
2005.10.11 12:04:27 '142605': pending order sell stop 0.10 GBPJPY at 199.1500 sl: 200.6500 tp: 198.1500
2005.10.11 12:04:27 '142605': login (4.00, #281BB516)
2005.10.11 11:10:09 '142605': order is open : #2160333 sell 0.10 USDJPY at 114.1400 sl: 114.7300 tp: 112.8700
2005.10.11 11:10:09 '142605': request in process
2005.10.11 11:10:09 '142605': request was accepted by server
2005.10.11 11:10:09 '142605': instant order sell 0.10 USDJPY at 114.1400 sl: 114.7290 tp: 112.8690
2005.10.11 11:08:08 '142605': order #2145173 sell 0.10 GBPJPY at 200.4800 was modified -> sl: 200.5400 tp: 0.0000
2005.10.11 11:08:08 '142605': request in process
2005.10.11 11:08:08 '142605': request was accepted by server
2005.10.11 11:08:08 '142605': modify order #2145173 sell 0.10 GBPJPY at 200.4800 sl: 200.6500 tp: 0.0000 -> sl: 200.5400 tp: 0.0000
2005.10.11 11:04:27 '142605': order #2139100 sell 0.10 GBPJPY at 200.3700 was modified -> sl: 201.5200 tp: 199.3700
2005.10.11 11:04:27 '142605': request in process
2005.10.11 11:04:27 '142605': request was accepted by server
2005.10.11 11:04:27 '142605': modify order #2139100 sell 0.10 GBPJPY at 200.3700 sl: 201.6600 tp: 199.3700 -> sl: 201.5200 tp: 199.3700
2005.10.11 11:04:27 '142605': login (4.00, #281BB516)
2005.10.11 10:08:13 '142605': order #2145173 sell 0.10 GBPJPY at 200.4800 was modified -> sl: 200.6500 tp: 0.0000
2005.10.11 10:08:12 '142605': request in process
2005.10.11 10:08:12 '142605': request was accepted by server
2005.10.11 10:08:12 '142605': modify order #2145173 sell 0.10 GBPJPY at 200.4800 sl: 200.8500 tp: 0.0000 -> sl: 200.6500 tp: 0.0000
2005.10.11 10:07:35 '142605': order #2149217 sell 0.10 EURJPY at 137.8900 was modified -> sl: 137.8400 tp: 0.0000
2005.10.11 10:07:35 '142605': request in process
2005.10.11 10:07:35 '142605': request was accepted by server
2005.10.11 10:07:35 '142605': modify order #2149217 sell 0.10 EURJPY at 137.8900 sl: 137.9000 tp: 0.0000 -> sl: 137.8400 tp: 0.0000
2005.10.11 10:05:23 '142605': order #2144692 sell 0.10 EURAUD at 1.5968 was modified -> sl: 1.6070 tp: 1.5568
2005.10.11 10:05:23 '142605': request in process
2005.10.11 10:05:23 '142605': request was accepted by server
2005.10.11 10:05:23 '142605': modify order #2144692 sell 0.10 EURAUD at 1.5968 sl: 1.6084 tp: 1.5568 -> sl: 1.6070 tp: 1.5568
2005.10.11 10:04:27 '142605': order #2139100 sell 0.10 GBPJPY at 200.3700 was modified -> sl: 201.6600 tp: 199.3700
2005.10.11 10:04:27 '142605': request in process
2005.10.11 10:04:27 '142605': request was accepted by server
2005.10.11 10:04:27 '142605': modify order #2139100 sell 0.10 GBPJPY at 200.3700 sl: 201.8700 tp: 199.3700 -> sl: 201.6600 tp: 199.3700
2005.10.11 10:04:27 '142605': login (4.00, #281BB516)
2005.10.11 09:08:05 '142605': order #2145173 sell 0.10 GBPJPY at 200.4800 was modified -> sl: 200.8500 tp: 0.0000
2005.10.11 09:08:05 '142605': request in process
2005.10.11 09:08:05 '142605': request was accepted by server
2005.10.11 09:08:05 '142605': modify order #2145173 sell 0.10 GBPJPY at 200.4800 sl: 200.9300 tp: 0.0000 -> sl: 200.8500 tp: 0.0000
2005.10.11 09:08:05 '142605': login (4.00, #281BB516)
2005.10.11 06:06:03 '142605': order #1893465 sell 0.10 GBPJPY at 199.9900 was modified -> sl: 202.1100 tp: 197.7300
2005.10.11 06:06:03 '142605': request in process
2005.10.11 06:06:03 '142605': request was accepted by server
2005.10.11 06:06:02 '142605': modify order #1893465 sell 0.10 GBPJPY at 199.9900 sl: 202.2500 tp: 197.7300 -> sl: 202.1100 tp: 197.7300
2005.10.11 06:05:48 '142605': order #2130122 sell 0.10 USDCAD at 1.1758 was modified -> sl: 1.1941 tp: 1.1658
2005.10.11 06:05:48 '142605': request in process
2005.10.11 06:05:48 '142605': request was accepted by server
2005.10.11 06:05:48 '142605': modify order #2130122 sell 0.10 USDCAD at 1.1758 sl: 1.1948 tp: 1.1658 -> sl: 1.1941 tp: 1.1658
2005.10.11 06:03:56 '142605': order #2137062 sell 0.10 EURAUD at 1.5985 was modified -> sl: 1.6116 tp: 0.0000
2005.10.11 06:03:56 '142605': request in process
2005.10.11 06:03:56 '142605': request was accepted by server
2005.10.11 06:03:56 '142605': modify order #2137062 sell 0.10 EURAUD at 1.5985 sl: 1.6125 tp: 0.0000 -> sl: 1.6116 tp: 0.0000
2005.10.11 06:00:03 '142605': order is open : #2158310 buy 0.10 EURUSD at 1.2037 sl: 1.1957 tp: 0.0000
2005.10.11 06:00:03 '142605': request in process
2005.10.11 06:00:03 '142605': request was accepted by server
2005.10.11 06:00:02 '142605': instant order buy 0.10 EURUSD at 1.2037 sl: 1.1957 tp: 0.0000
2005.10.11 06:00:02 '142605': login (4.00, #281BB516)
2005.10.11 05:07:48 '142605': order #2149217 sell 0.10 EURJPY at 137.8900 was modified -> sl: 137.9000 tp: 0.0000
2005.10.11 05:07:48 '142605': request in process
2005.10.11 05:07:48 '142605': request was accepted by server
2005.10.11 05:07:48 '142605': modify order #2149217 sell 0.10 EURJPY at 137.8900 sl: 138.1700 tp: 0.0000 -> sl: 137.9000 tp: 0.0000
2005.10.11 05:05:22 '142605': order #2144692 sell 0.10 EURAUD at 1.5968 was modified -> sl: 1.6084 tp: 1.5568
2005.10.11 05:05:22 '142605': request in process
2005.10.11 05:05:22 '142605': request was accepted by server
2005.10.11 05:05:22 '142605': modify order #2144692 sell 0.10 EURAUD at 1.5968 sl: 1.6097 tp: 1.5568 -> sl: 1.6084 tp: 1.5568
2005.10.11 05:03:52 '142605': order #2139090 sell 0.10 EURUSD at 1.2099 was modified -> sl: 1.2125 tp: 1.1799
2005.10.11 05:03:52 '142605': request in process
2005.10.11 05:03:52 '142605': request was accepted by server
2005.10.11 05:03:52 '142605': modify order #2139090 sell 0.10 EURUSD at 1.2099 sl: 1.2151 tp: 1.1799 -> sl: 1.2125 tp: 1.1799
2005.10.11 05:01:55 '142605': order #2137049 sell 0.10 EURUSD at 1.2167 was modified -> sl: 1.2255 tp: 0.0000
2005.10.11 05:01:55 '142605': request in process
2005.10.11 05:01:55 '142605': request was accepted by server
2005.10.11 05:01:54 '142605': modify order #2137049 sell 0.10 EURUSD at 1.2167 sl: 1.2286 tp: 0.0000 -> sl: 1.2255 tp: 0.0000
2005.10.11 05:01:54 '142605': login (4.00, #281BB516)
2005.10.11 05:00:21 TradeContext: ping failed
2005.10.11 05:00:21 '142605': order #2156417 sell 0.10 EURUSD at 1.2064 sl: 1.2114 tp: 0.0000 closed at price 1.2032
2005.10.11 05:00:21 '142605': request in process
2005.10.11 05:00:21 '142605': request was accepted by server
2005.10.11 05:00:07 '142605': close order #2156417 sell 0.10 EURUSD at 1.2064 sl: 0.0000 tp: 0.0000 at price 1.2032
2005.10.11 05:00:07 '142605': login (4.00, #281BB516)
2005.10.11 04:07:47 '142605': order #2149217 sell 0.10 EURJPY at 137.8900 was modified -> sl: 138.1700 tp: 0.0000
2005.10.11 04:07:47 '142605': request in process
2005.10.11 04:07:47 '142605': request was accepted by server
2005.10.11 04:07:47 '142605': modify order #2149217 sell 0.10 EURJPY at 137.8900 sl: 138.2800 tp: 0.0000 -> sl: 138.1700 tp: 0.0000
2005.10.11 04:07:47 '142605': login (4.00, #281BB516)
2005.10.11 01:11:25 '142605': order is open : #2156460 sell 0.10 USDJPY at 114.0700 sl: 116.0700 tp: 0.0000
2005.10.11 01:11:25 '142605': request in process
2005.10.11 01:11:25 '142605': request was accepted by server
2005.10.11 01:11:25 '142605': instant order sell 0.10 USDJPY at 114.0700 sl: 116.0700 tp: 0.0000
2005.10.11 01:11:25 '142605': login (4.00, #281BB516)
2005.10.11 01:00:45 '142605': order is open : #2156417 sell 0.10 EURUSD at 1.2064 sl: 1.2114 tp: 0.0000
2005.10.11 01:00:45 '142605': request in process
2005.10.11 01:00:45 '142605': request was accepted by server
2005.10.11 01:00:45 '142605': instant order sell 0.10 EURUSD at 1.2064 sl: 1.2114 tp: 0.0000
2005.10.11 01:00:44 '142605': login (4.00, #281BB516)
2005.10.10 23:14:38 Custom indicator _Zigzag_2_Ind USDCAD,H1: loaded successfully
2005.10.10 23:14:38 Custom indicator _Zigzag_2_Ind USDCAD,H1: loaded successfully
2005.10.10 23:13:21 '142605': order #2144293 buy 0.10 USDJPY at 113.7400 was modified -> sl: 113.2900 tp: 0.0000
2005.10.10 23:13:21 '142605': request in process
2005.10.10 23:13:21 '142605': request was accepted by server
2005.10 10 23:13:19 '142605': modify order #2144293 buy 0.10 USDJPY at 113.7400 sl: 113.0200 tp: 0.0000 -> sl: 113.2900 tp: 0.0000
2005.10.10 23:13:16 Custom indicator _Forex_Nn_Ind EURUSD,H1: loaded successfully
2005.10.10 23:12:53 Custom indicator _Zigzag_2_Ind EURAUD,H1: loaded successfully
2005.10.10 23:12:42 Custom indicator _Zigzag_2_Ind USDJPY,H1: loaded successfully
2005.10.10 23:12:06 Custom indicator _Zigzag_2_Ind GBPUSD,H1: loaded successfully
2005.10.10 23:11:56 Custom indicator _Zigzag_2_Ind EURUSD,H1: loaded successfully
2005.10.10 23:11:23 Custom indicator _Noc_Ind USDJPY,H1: loaded successfully
2005.10.10 23:11:13 Custom indicator _Noc_Ind GBPUSD,H1: loaded successfully
2005.10.10 23:11:01 Custom indicator _Noc_Ind GBPCHF,H1: loaded successfully
2005.10.10 23:10:43 Custom indicator _Noc_Ind USDCHF,H1: loaded successfully
2005.10.10 23:10:32 Custom indicator _Noc_Ind EURGBP,H1: loaded successfully
2005.10.10 23:10:27 Custom indicator _Noc_Ind EURUSD,H1: loaded successfully
2005.10.10 23:09:02 '142605': order #2135657 buy 0.10 USDJPY at 113.3500 was modified -> sl: 113.4000 tp: 0.0000
2005.10.10 23:09:02 '142605': request in process
2005.10.10 23:09:02 '142605': request was accepted by server
2005.10 10 23:09:02 '142605': modify order #2135657 buy 0.10 USDJPY at 113.3500 sl: 113.0900 tp: 0.0000 -> sl: 113.4000 tp: 0.0000
2005.10.10 23:08:27 Custom indicator _Zigzag_2_Ind USDCHF,H1: loaded successfully
2005.10.10 23:08:26 Custom indicator _Zigzag_2_Ind EURUSD,H1: loaded successfully
2005.10.10 23:07:38 Custom indicator _Zigzag_2_Ind USDCAD,H1: loaded successfully

Log 2.
Attempting to close long position, ticket: 2130092
11.10.2005 17:6:22
Order with this ticket still present, trying again
11.10.2005 17:7:37
Order with this ticket still present, trying again
11.10.2005 17:8:13
Order with this ticket still present, trying again
11.10.2005 17:9:12
Order with this ticket still present, trying again
11.10.2005 17:10:23
Order with this ticket still present, trying again
11.10.2005 17:11:31
Order with this ticket still present, trying again
11.10.2005 17:12:12
Order with this ticket still present, trying again
11.10.2005 17:13:11
Order with this ticket still present, trying again
11.10.2005 17:14:10
Order with this ticket still present, trying again
11.10.2005 17:15:5
No more orders with this ticket No

I also got error number 2 when I tried to delete a pending order.
 
I repeat: error number 6 indicates that you have failed to connect to the server. I reiterate that the quotes are received through a completely separate connection in pumpe mode. and the presence (survivability) of this connection does not affect the establishment of a new, trading, connection. the server can easily refuse a new connection under heavy load. <br/ translate="no"> by the way, what is the number of the "new" 183 build? It should be from the 7th of october.


We thus have two options. First - we do an EA that stubbornly closes the position until it closes. The second is that the system handles it. I believe that the second approach is the correct one.

Errors occur due to pings or something else. But. 1) there should not be situations when the terminal behaves as if the position has been opened (closed), when in fact it has failed. 2) error codes are not always intelligible. 3) Errors should not be present at all when there are problems with communication.

Let me explain the last point. Let's say I'm requesting to open a position. What timeouts?! While the price is within the specified slip, the terminal must try to open a position.
I am not even talking about closing a position. If there is an instruction to "close" a position, it must be closed, even if it takes an hour.
 
Ну и что же теперь делать?
На "тройке" таких проблем не было.
Сейчас же через раз!!!!
Где решение?
Советниками торговать нельзя!!!

to start with, do not jump to conclusions.
on the trio there were much more different problems - no more than one trade per EA run, asynchronous trades, inaccessibility of trade history (more on that?). now we are forced to manage trade flows much more finely.
If you read this thread from the beginning you will see several solutions - use semaphores, check the possibility to trade, and make several attempts to trade when it fails.
You can trade with EAs!!!


Once again, I repeat the suggestion: live together, and work together to make EAs work without errors.
 
Suggestion to the developers. There's a simple and terribly handy thing that makes it easier to find problems in the logs - the >>>> <<<. Compare:

2005.10.11 20:19:48 Old tick GBPUSD60 1.7478/1.7482
2005.10.11 20:09:47 Old tick GBPJPY60 199.7100/199.7900
2005.10.11 20:05:51 '142605': order #2155774 buy 0.10 USDJPY at 114.3900 has been modified -> sl: 113.6600 tp: 115.3900
2005.10.11 20:05:51 '142605': request in process
2005.10.11 20:05:51 '142605': request was accepted by server
2005.10.11 20:05:51 '142605': modify order #2155774 buy 0.10 USDJPY at 114.3900 sl: 113.4900 tp: 115.3900 -> sl: 113.6600 tp: 115.3900

и

2005.10.11 20:19:48 >>>Old tick<<< GBPUSD60 1.7478/1.7482
2005.10.11 20:09:47 >>>Old tick<< GBPJPY60 199.7100/199.7900
2005.10.11 20:05:51 '142605': order #2155774 buy 0.10 USDJPY at 114.3900 has been modified -> sl: 113.6600 tp: 115.3900
2005.10.11 20:05:51 '142605': request in process
2005.10.11 20:05:51 '142605': request was accepted by server
2005.10.11 20:05:51 '142605': modify order #2155774 buy 0.10 USDJPY at 114.3900 sl: 113.4900 tp: 115.3900 -> sl: 113.6600 tp: 115.3900

The problematic lines become more visible to the eye. Should we do in MT?
 
Starting from 12 o'clock last night, experts were working on MQ-demo and Alpari-demo. During the whole time there was no error 128 either, on Alpari there was one error 6 (ping error), and on both - several old ticks. Orders worked without errors. Build 1.8.3 of 05.10. Maybe it's something else? For example, peculiarities of connection through port 443 on different Internet providers? MT3 had errors, but not this many.
 

Советниками торговать нельзя!!!

for starters do not jump to conclusions.
there were much more other problems on the trio - no more than one trade at a time, asynchronous trades, no trading history available (go on?). now we have to manage trade flows much more finely.
if you read this thread from the beginning you may see several solutions - use semaphores, check trading possibility, make several trade attempts when failed.
advisor


Expert Advisors are not allowed to trade.
And this conclusion is not a hasty one. You've been forming it for over a month now.
Offering users several solutions to "manage trade flows more finely", which the trading engine cannot manage itself, is ridiculous. Moreover, these solutions are questionable.

1.
use semaphores

Semaphores on global variables cannot be initialized in the current implementation.

2.
check the possibility of trading

There is no such functionality. There is some combined functionality, which does not always work.

3.
make multiple trade attempts if unsuccessful

How many is a few?

4.
we suspect interesting server settings.

The August build has traded, is trading and will apparently continue to trade with the same settings.

5.
nothing significant has changed in the Expert Advisor module since the August build.

Then it's probably just magic. Or more likely the same problem as with the global variables - race conditions in the communication module.

6.
this problem occurs very rarely, but it does happen. as soon as you start fine-tuning the steps, it immediately disappears. that's why we are studying all the logs sent to us

So your testing conditions are different from the terminal conditions for most users. Who needs such testing? About "debugging by steps", in general, as they say, "don't make my slippers laugh".

What is striking is the fact that the cause has not been found yet and instead we are fighting against consequences on the basis of users' logs, there appear some timeouts, vorkarounds like semaphores and so on.
The timing of the problem is very well-determined, just a few days. Is it really impossible to find something in CVS (or whatever you use (if you use it at all, of course)) logs that could have such a negative impact on trade flows?

Unfortunately, what's going on doesn't look very professional. :(
 
Quark, have some conscience, don't post such logs on the forum =)))))

As for the reality of closing/opening - I have checks in all f-functions and errors appear, but they are FALSE errors. I checked the logs and order history, all positions were closed. The order just didn't have time to move in the history. I made a 1 second delay before checking - but that's not enough... When I asked, they didn't give me an answer.
 
There are a few points I would like to make:

1. In my EAs, I have always used the mechanism of reversal of orders in case of failure - it is a godsend. As long as there is MY trade signal to any trade the EA will repeat until a successful execution!!! But this is a different situation, often advisor cannot close/open an order for an hour or two or three without restarting MT. Sometimes the trade signal has already disappeared and the position is still hanging out... Of course, this is out of the question for a real trading robot. Of course, you can try to write a script that makes MT restart, with a certain number of failures. I have a few similar ones for MT3, but from personal experience it is not RELIABLE. Because it happens, then at start MT hangs, then something else, etc..

2. Said that perhaps something depends on the provider .... I do not really believe in it, but I want to mention that I tested the same terminal with the same Expert Advisor via 2 different providers. One provider has errors less often, the other one more often. And pings to trade server in both cases are instantaneous and all that. Both Internet channels are very good and reliable.
Reason: