Errors, bugs, questions - page 1656

 

Good afternoon!

Gentlemen officers, can you tell me where to start catching a bug?

Multicurrency Expert Advisor. After the first trade the tester stops.

Gives out an error, the code of which I can't find.

Yes, tester works fine from start date 2016.05.01. If I change this date - tester stops and error, log below.

Help please!

2016.08.29 12:22:53.068 log file "D:\Terminals\Alpari Limited MT5\Tester\Agent-127.0.0.1-3000\logs\20160829.log" written
2016.08.29 12:22:53.068 stopped on 0% of testing interval with error '16 USDJPY'
2016.08.29 12:22:53.068 history error 9 in undefined function
2016.08.29 12:22:53.066 wrong generated time
2016.08.29 12:22:52.830 wrong generated time
2016.08.29 12:22:52.765 wrong generated time
 
Alexey Viktorov:

Try this

This option originally worked. I didn't explain it well, the question was about this
(Condition ? f1 : f2)(1, 2, 3, 4, 5); // Почему так нельзя? Как сделать, чтобы можно было?
 
fxsaber:
This option worked from the beginning. I didn't explain it well, the question was about this
Through pointers to a function, but it still wouldn't be as pretty
 
Комбинатор:
Through the pointers to the function, but it would still be not so nice.

This is what I had originally envisaged

fxsaber:
how to change (apparently, a new kind of pointers for MQL) to make such a construction work? And will it be slow?

where to look for an example? And on the performance I would like to know.

 
fxsaber:

where to look for an example? And in terms of performance, I'd like to know.

void f1( int i1, int i2, int i3, int i4, int i5 ) {}
void f2( int i1, int i2, int i3, int i4, int i5 ) {}
typedef void (*TFunc)(int, int, int, int, int);

void OnStart()
{  
  bool Condition = true;
  TFunc f = Condition ? f1 : f2; f(1, 2, 3, 4, 5);
}

The mql5 build 1325 and above was written directly in the browser, so I don't pretend to be correct, but the meaning is approximately the same.

 
Комбинатор:

mql5 build 1325 and above, written directly in the browser, so I don't claim to be correct, but the meaning is about the same.

Thank you very much! It has become clear.
 

Comrades, what do you think about this implementation of MAKEWORD(), is it valid?

short MAKEWORD(uchar low, uchar high)
{
  struct Unnamed
  {
    uchar first;
    uchar second;
  }s = {1, 0};
  
  struct Word   { short val; };
  Word word = (Word)s;
  if(word.val == 1)
  { //litle endian
    s.first = low;
    s.second = high;
  }
  else
  { // big endian
    s.first = high;
    s.second = low;
  }
  word = (Word)s;
  
  return word.val;
}

ZS: No, that's nonsense. You have to use a shift. Something like this:

#define  MAKEWORD(low, high) (  (short) ((low & 0xff) | ((short)high << 8))  )
 
A100:

Can't hide some MetaQuotes-Demo characters. It must have started with build 1395. The terminal replaced the previously installed set in the Market Watch with its own set (which does not always happen during build updates) and after that on some symbols the Hide menu is not active, and on the Symbols menu then the Hide button - nothing happens. For example GBPCAD chart I do not have and in deleted too

The reason was an open position on GBPCAD.
 
Help please!

There is a string txt (downloaded from a news site)

string txt = "ИÐдеÑк ожиÐа´Ð½Ð¸Ð¹ в ÑÑ "еер уÑÐ "уг (авг)</a>\n";
original encoding UTF-8. is displayed as: windows 1252

needs to be converted by mql4 means into the form - Service Expectation Index (Aug)</a>

Thanks in advance!
 

Nowhere can I find the clearly stated minimum memory requirements forthe MetaTrader 5 Strategy Tester Agent.

Is there any documentation or anywhere to look?

Распределенные вычисления в сети MQL5 Cloud Network
Распределенные вычисления в сети MQL5 Cloud Network
  • cloud.mql5.com
Заработать деньги, продавая мощности своего компьютера для сети распределенных вычислений MQL5 Cloud Network