Errors, bugs, questions - page 2153

 
There is an entry in the Optimiser's Journal in Russian
2018.03.03 15:48:04.722 Tester  Вы можете ускорить оптимизацию в сотни раз с помощью MQL5 Cloud Network
 
Andrii Djola:

How do i know what time forex symbol trades close?

Forum on trading, automated trading systems and trading strategies testing

Features of mql5 language, tips and tricks

fxsaber, 2017.02.25 16:39

ENUM_DAY_OF_WEEK GetDayOfWeek( const datetime time )
{
  MqlDateTime sTime = {0};

  ::TimeToStruct(time, sTime);

  return((ENUM_DAY_OF_WEEK)sTime.day_of_week);
}

// true - находимся в торговой сессии
bool SessionTrade( const string Symb )
{
  datetime TimeNow = ::TimeTradeServer();

  const ENUM_DAY_OF_WEEK DayOfWeek = GetDayOfWeek(TimeNow);

  TimeNow %= 24 * 60 * 60;

  bool Res = false;
  datetime From, To;

  for (int i = 0; (!Res) && ::SymbolInfoSessionTrade(Symb, DayOfWeek, i, From, To); i++)
    Res = ((From <= TimeNow) && (TimeNow < To));

  return(Res);
}

// Возвращает true, если символ торгуемый. Иначе - false.
bool SymbolTrade( const string Symb )
{
  MqlTick Tick;

  return(::SymbolInfoTick(Symb, Tick) ? ((Tick.bid != 0) && (Tick.ask != 0) && SessionTrade(Symb) /* &&
         ((ENUM_SYMBOL_TRADE_MODE)::SymbolInfoInteger(Symb, SYMBOL_TRADE_MODE) == SYMBOL_TRADE_MODE_FULL) */
) : false);
}

Using

if (OrderCheck(Request, CheckResult) && SymbolTrade(Request.symbol))
  OrderSend(Request, Result);
 
fxsaber:

A very unpleasant bug with custom characters. The tick history of the custom characters can completely disappear.

There were several dozen hours of Optimize on the real ticks of the custom character. No one came near the computer and did nothing.

After 15 hours of Optimization came to see the results. Using the menu item "Run Single Test" at any run is not possible - the tester starts and ends immediately.

The log is

2018.03.03 15:48:04.696 Tester  file cache used 3010 times
2018.03.03 15:48:04.698 Tester  optimization finished, total passes 352000
2018.03.03 15:48:04.708 Statistics      optimization done in 41 hours 32 minutes 37 seconds
2018.03.03 15:48:04.708 Statistics      local 348990 tasks (100%), remote 0 tasks (0%), cloud 0 tasks (0%)
2018.03.03 15:48:04.708 Core 1  connection closed
2018.03.03 15:48:04.709 Core 2  connection closed
2018.03.03 15:48:04.710 Core 3  connection closed
2018.03.03 15:48:04.710 Core 4  connection closed
2018.03.03 15:48:04.711 Core 5  connection closed
2018.03.03 15:48:04.711 Core 6  connection closed
2018.03.03 15:48:04.712 Core 7  connection closed
2018.03.03 15:48:04.714 Core 8  connection closed
2018.03.03 15:48:04.716 Tester  348990 records written to file cache C:\Program Files\Alpari Limited MT5\tester\cache\Test.TESTER_EURUSD.M1.4.xml
2018.03.03 15:48:04.722 Tester  Вы можете ускорить оптимизацию в сотни раз с помощью MQL5 Cloud Network
2018.03.04 08:26:30.933 Tester  single pass 297022 started
2018.03.04 08:26:31.000 Tester  TESTER_EURUSD: history data begins from 2018.02.06 00:00
2018.03.04 08:27:36.409 Tester  single pass 297022 started
2018.03.04 08:27:36.491 Tester  TESTER_EURUSD: history data begins from 2018.02.06 00:00
2018.03.04 14:05:10.940 Tester  single pass 297022 started
2018.03.04 14:05:11.007 Tester  TESTER_EURUSD: history data begins from 2018.02.06 00:00

Found that the ticks of all custom characters have been deleted.

 
After Optimisation, this text file
2018.03.03 15:48:04.716 Tester  348990 records written to file cache C:\Program Files\Alpari Limited MT5\tester\cache\Test.TESTER_EURUSD.M1.4.xml
takes up 1GB. 7z compresses it by a factor of 100. Why such an inefficient way to store the cache?
 

If you use XML export

350,000 passes are written to a 320 MB XML file. This automatically opens the XML file for some reason. I have Notepad trying to do this, which hangs up when reading such monsters. Please warn in advance what the approximate size of the file will be when selecting the XML menu and what the consequences might be when opening it further.

 

Error during compilation

no code fragment can be selected yet

 
fxsaber:

If you use XML export

350,000 passes are written to a 320 MB XML file. This automatically opens the XML file for some reason. I have Notepad trying to do this, which hangs up when reading such monsters. Please, when selecting the XML-menu, please tell in advance what the approximate size of the file will be and what the consequences will be when opening it further.

I agree, but it is not necessary to warn, it is necessary to prohibit opening of the file, and the user will decide how to open it

 

Error during compilation

template<typename T>
class A { T t; };
void OnStart() { A<void *> a; } //Error: '<' - cannot to apply function template

Otherwise:

template<typename T>
class A { T t; };
void OnStart() { A<void *> a; }
class B {};

It's fine. What difference does it make?

 

Compilation error

template<typename T>
struct A { T    *t; };
struct B { void *b; };
void OnStart()
{
        A<void> a; //Error: 'void' - expression of 'void' type is illegal
        B       b; //номально
} 
 
fxsaber:

For several dozen hours there was Optimisation by real ticks of the custom character. No one approached the computer and did nothing.

After 15 hours of Optimization I came to see the results. Using the menu item "Run Single Test" on any pass is not possible - the tester starts and ends immediately.

The log is

Found that the ticks of all custom symbols have been removed.

Reproducible. Need to run Tester/Optimizer. Wait a few hours after it finishes. I have exactly 10 hours later all custom character ticks are deleted.

Reason: