Errors, bugs, questions - page 1179

 
king20:

Hi. I locked the EA in OnInit function and it must be the reason why the terminal hangs when I turn off the EA and change timeframe (timeframe does not change after the brakes). So my question is: Is it caused by hangs? If so, is it corrected if I move the algorithm to OnTick? If no, what would help?

PS: The loop has a function Sleep, so that the terminal is not overloaded. The input fields are read in the loop.

The loop must go like this: while(true){}? Yes?

It should go like this: while(!isStopped()) {}. But that would cause another issue - it would exit for some unknown reason. It should be done at the start. If we need to speed up startup, we can call startup from init.

It's better to not loop at all, now there is a timer, we should use timer.

 
Integer:

If you need to speed up the start, you can call start from the init.

And how is this better than a looped init? No.
 
marketeer:
And how would that be better than a looped init? Nothing.
Try reading my entire post without skipping a single sentence, it says it all.
 
Integer:
Try reading my entire post without skipping a single sentence, it's all there.
Honestly, I read it. If you mean the last sentence, then I agree. I don't agree with the second one, so I asked a question.
 
mql5:
Thanks for the message, fixed.

Ok, and here's a follow up:

#property library

struct T
{
 int a;
};

int Test() export
{ 
  int h= FileOpen("MyFile.bin", FILE_READ | FILE_BIN);
  if (h<0) { Alert("File not found"); return 0; }
  Alert("File Size = ",FileSize(h));
  Alert("File Tell = ",FileTell(h));
  Alert("Size Of T = ",sizeof(T));
  T a;
  int readsize= FileReadStruct(h, a, sizeof(T));
  Alert("Read Size = ",readsize);
  FileClose(h);
  return 0;
}

When importing this library we always get: Read Size = 0

You need to seriously deal with importing functions, because there is a bug upon bug. In some cases variables spontaneously change values, etc. In short, it is completely unusable.

 
marketeer:
Honestly, I read it. If you're referring to the last sentence, I agree. And the second one, I don't agree, so I asked a question.

Actually, there were only seven sentences in that post. The second sentence was "Yes?"

Either way you have the right to agree or disagree, freedom of religion hasn't been abolished yet. Maybe you don't agree with the fact that the earth rotates either, please.

 
meat:

Ok, and here's a follow up:

When importing this library we always get: Read Size = 0

You need to seriously deal with import of functions, because there is a bug on bug. In some cases, variables spontaneously change values, etc. In short, completely unusable.

Hello. I downloaded the Expert Advisor https://www.mql5.com/ru/code/8087 - but it doesn't work, if I try to compile it, it says about errors. I want to ask somebody to explain why. Thanks in advance!
GTerminal_V5 Graphic orders and indicators
GTerminal_V5 Graphic orders and indicators
  • votes: 2
  • 2008.04.20
  • Aleksandr Pak ekr-ap@mail.ru
  • www.mql5.com
Исполнение приказов по наклонным линиям графики. Для реальной торговли и обучения в Тестере стратегий реализованы графические ордера. Советник прошел апробацию форумa MQL-4. В версии_V5 учтены все поступившие при обсуждении замечания и пожелания
 
Elena_2014:
Hello. I downloaded the advisor https://www.mql5.com/ru/code/8087 - but it doesn't work, if I try to compile it it writes about errors. Can someone please explain why. Thank you in advance!
Because great changes have been made in MQL4 since then.
 
Integer:
Because there have been big changes in the MQL4 language since then.
And is it hard to fix this to make it work?
 
Elena_2014:
And is it difficult to fix it to make it work?
It's a tricky question. It depends on how you look at it. For some people, it's absolutely impossible. It's not very difficult for the clever ones.
Reason: