Questions from Beginners MQL4 MT4 MetaTrader 4 - page 199

 
Artyom Trishkin:
F11
Thank you. It helped. My colleague is not switching timeframes on one pair . What to do?
 
hmil:
Thank you. It helped. My colleague is not switching timeframes on one pair . What to do?
There are no miracles. Look for an indicator or EA that switches the timeframe back.
 
Hello, can you give some advice. i am writing my own EA. i am probably doing this all the time, i am testing it and looking at what works and what does not. the problem is this. i finished writing the code, i tested it, everything works as it should, then some time later, i start testing it again, it starts glitching (no position opening or not performing some functions), why is this?
 
OLEG BEZBORODOV:
Hello, can you give some advice. i am writing my own EA. i am probably doing this all the time, i am testing it and looking at what works and what does not. the problem is this. i finished writing the code, i tested it, everything works as it should, then some time later, i start testing it again, it starts glitching (no position opening or not performing some functions), why is this?

Have you ever output any debugging information to the journal? No? You should not. You would have already seen the reason.

 
Artyom Trishkin:

Do you output any debugging information to the log? No? You shouldn't have. You should have seen the cause yourself by now.

I don't know how to display this information yet, where can I find out how to do it?

 
OLEG BEZBORODOV:

I don't know how to print this information yet, where can I see how to do it?

Print()

Документация по MQL5: Общие функции / Print
Документация по MQL5: Общие функции / Print
  • www.mql5.com
Данные типа double выводятся с точностью до 16 десятичных цифр после точки, при этом данные могут выводиться либо в традиционном либо в научном формате – в зависимости от того, как запись будет наиболее компактна. Данные типа float выводятся с 5 десятичными цифрами после точки. Для вывода вещественных чисел с другой точностью либо в явно...
 
Artyom Trishkin:

Print()

I know this function, what should I write there?)

 
OLEG BEZBORODOV:

I know this function, what should I write there?)

The problem is that I have finished writing the code and tested it, it all works and then it starts glitching (after some time, I start testing it again and then it fails). I have already copied the code, tested it and it works as I should. Some time later, I start testing it again and it starts working incorrectly (no position opening or no function execution), why is that?

Well, obviously, to understand the reason why something is not working you need to check the conditions of this "something" before executing it.

In the debugger you may scrupulously move through the code lines controlling values of all the variables in the hope that at some moment the reason of non-execution will appear.

Or you can, before calling a function that, in your opinion, is not executed at some obscure moment when it should be, write down the values of all variables that cause the function to be called. And quietly wait for these entries to appear in the journal. Using these records we can understand why the function hasn't been called. The same way when opening positions - first make sure that the terminal writes there errors, and if there are no errors, then look for logic errors in the program. How - see above.

 
Artyom Trishkin:

Obviously, in order to understand the reason why something is not executed, one should check the conditions of execution of this "something" before executing this "something".

You can scrupulously go through lines of code in the debugger, checking values of all variables in the hope that at some point a cause of non-execution will appear.

And before you call a function, which at some obscure moment in your opinion isn't executed when it should be, you can write into the log all the values of all the variables that cause the function to be called. And quietly wait for these entries to appear in the journal. Using these records we can understand why the function hasn't been called. The same way when opening positions - first make sure that the terminal writes there errors, and if there are no errors, then look for logic errors in the program. How - see above.

Thanks for the idea)))

 
how do I get a letter from my broker?
Reason: