Errors, bugs, questions - page 1116

 

I keep seeing this when running the test:

2014.03.28 17:12:28 Core 1 connecting to 127.0.0.1:3000
2014.03.28 17:12:38 Core 1 tester agent authorization error
2014.03.28 17:12:38 Core 1 connection closed

The opportunity to test is provided more as an exception. Remote agents are disabled, no antivirus.
How is this treated?

 
cDan:

I keep seeing this when running the test:

2014.03.28 17:12:28 Core 1 connecting to 127.0.0.1:3000
2014.03.28 17:12:38 Core 1 tester agent authorization error
2014.03.28 17:12:38 Core 1 connection closed

The opportunity to test is provided more as an exception. Remote agents are disabled, no antivirus.
How is this treated?

Antivirus not?
 
No antivirus
 

Overshot, but maybe a quicker answer here:

Forum on trading, automated trading systems and trading strategy testing

Questions from beginners

C-4, 2014.03.28 13:23

Can someone please explain to me why the above code does not work in tester while in real time it works!!!? Specifically interested in why the HistoryOrderGetInteger property is not available in the tester after HistorySelect(0, TimeCurrent())...

#include <Trade\Trade.mqh>

CTrade trade;

int OnInit()
{
   trade.LogLevel(LOG_LEVEL_NO);
   return INIT_SUCCEEDED;
}
void OnTick()
{
   if(!DetectNewBar())return;
   trade.Sell(0.1);
   HistorySelect(0, TimeCurrent());
   for(; dealsCount < HistoryDealsTotal(); dealsCount++)
   {
      ulong ticket = HistoryDealGetTicket(dealsCount);
      RecalcDeal(ticket);
   }
}

bool DetectNewBar(void)
{
   MqlRates bars[1];
   CopyRates(Symbol(), PERIOD_M1, 0, 1, bars);
   if(bars[0].time != timeLastBar)
   {
      timeLastBar = bars[0].time;
      //printf(expertName + " new bar detected: " + TimeToString(bars[0].time));
      return true;
   }
   return false;
}

void RecalcDeal(ulong ticketDeal)
{
   //History is selected in OnTick()!
   ulong ticketOrder = HistoryDealGetInteger(ticketDeal, DEAL_ORDER);
   //if(!HistoryOrderSelect(ticketOrder))
   //   printf("order not select.");
   ENUM_ORDER_TYPE type = (ENUM_ORDER_TYPE)HistoryOrderGetInteger(ticketOrder, ORDER_TYPE);
   datetime time = HistoryOrderGetInteger(ticketOrder, ORDER_TIME_SETUP); 
   ulong time_msc = HistoryOrderGetInteger(ticketOrder, ORDER_TIME_SETUP_MSC); 
   printf("Order: " + (string)ticketOrder + " Type: " + EnumToString(type) + " Time: " + (string)time +
          " Time msc: " + (string)time_msc + " Total Orders: " + HistoryOrdersTotal());
}

int dealsCount;

datetime timeLastBar;

Screenshot in the strategy tester:

Real-time screenshot in the demo:

p.s. What is interesting, the first order in the tester is handled correctly but the others are not. Also, if we comment HistroryOrderSelect(ticketOrder), we get a message in the Strategy Tester that the order has not been selected and in the Strategy Tester, everything starts working, except for the first order.


 

Explanatory screenshot for application #986216

 

Does the built-in StringSplit function work correctly ?

void OnStart()
{
        string str = "|A|B|";
        string result[];
        int n = StringSplit( str, '|', result );
        Print( "количество полученных подстрок=", n );
        for ( int i = 0; i < n; i++ )
                Print( "подстрока(", i, ")=", result[ i ] );
}

produces the following result:

It turns out that the '|' character in the case of "|A" separates the empty string and A, and in the case of "B|" it does not separate B and the empty string. But if it is a separator, it must separate something, otherwise there is no difference between "|A|B|" and "|A|B" and at the same time there is a difference between " |A|B|" and "A|B|" . And if blank lines are allowed in one case, they should be allowed in the other case as well.

 

Divides correctly, but not all the way through. A blank token should also be issued at the end.

Put it in servicedesk.

 

There's something wrong with my ranking, the code download counter seems to be down.

Oops, that's not an error... Have you added codes from MQL4 to your rating?

 

Yes, we are working on transferring MQL4 code base to the new MQL5 website engine.

We are working on unification of the platforms.

 
A100:

Does the built-in StringSplit function work correctly ?

produces the following result:

It turns out that the '|' character in the case of "|A" separates the empty string and A, and in the case of "B|" it does not separate B and the empty string. But if it is a separator, it must separate something, otherwise there is no difference between "|A|B|" and "|A|B" and at the same time there is a difference between "|A|B|" and "A|B|". And if blank lines are allowed in one case, they should be allowed in the other case as well.

Thanks for the message, corrected in terminals 4 and 5.