PostMessageA(Parent(), WM_COMMAND, 33042, 0); - page 7

 
xrust >>:

так и пользуйте Close[0] на здоровье, вот подобный индюк - прекрасно работает как втестере, так и в онлайне

Prices are almost solved, but what do you want to do with TimeCurrent()? I need accuracy within a minute, and I don't have it. And all the time functions don't work at all.

By the way, I see that you use Bid Ask prices in your code - they don't work in the tester (or rather, current prices do)... It's not clear how you work with them.

 

everything works fine, the time in the tester emulates perfectly...

 
xrust >>:

все прекрасно пашет, время в тестере эмулируется отлично...

Does that code from the example work too?

Yes, I've been told here that it shouldn't work in the indicator either.

https://www.mql5.com/ru/forum/111497/page539

 

Well, feed it through a global variable. If the indicator is called from an Expert Advisor, it can be simulated. If you just hang the indicator, then it can be through a global variable.

 
xrust >>:

Ну так скорми ему его через глобальную переменную, если индикатор вызывать из эксперта - то моделируется. если просто вешать индюк, тогда можно через глобалку

And then there is a problem with synchronisation within the tick - it is not always possible to guarantee that the indicator reads the data later than the EA writes it - usually the EA is just slower. Therefore, we need to put a delay in the indicator, but where to get it - good people have forbidden it. I need to use API timer somehow, but I don't have this code.

 

I don't understand who follows who ?
then do all processing in your EA, and pass values to indicator via global variables which it will display on the screen and write to buffer...
Who do you have writing to the file?

 
xrust >>:

Что то я не пойму кто у тебя за кем идет ?
тогда сделай всю обработку в советнике, а индикатору через глобальные переменые передавай значения которые он будет отображать на экране и писать в буфера...
Кто у тебя пишет в файл?

In electronics, this is called race condition.

The indicator and the Expert Advisor start calculating at the same moment with the arrival of the tick and count in parallel. The Expert Advisor writes in the global variable and the indicator reads it at the same time. Because these processes are not synchronized and are parallel, it's impossible to know who will do the reading or writing first. The time difference is a fraction of a second and it depends on many factors. But if the indicator will read first, it will read the previous data on this tick. The solution in this situation is to use the delay in the indicator, so it won't be ahead of the Expert Advisor when accessing the global variable.

There is no file here.

But basically the solution is found - to use objects for drawing lines and then there is no need in indices and their presence in MT4 becomes absolutely superfluous. But let's not talk about politics :))

The only pity is that it is not recommended anywhere in documentation for it solves all the problems with transferring code from an indicator and testing.

 
So you can't get a solid tick flow?
 
Alderon >>:
То есть, сплошного тикового потока не получить?

The only way to do this in an indicator is through time exchange with a global variable. But it is better not to bother with indices at all and do everything in the Expert Advisor through graphical objects. It will be faster and easier. The documentation sometimes says that indices are convenient for analytics, but in practice they are not.

Here is a great article about it https://www.mql5.com/ru/articles/1503/page2

 
Zhunko >>:

Что угодно можно сделать трендовыми линиями.

And how does the Expert Advisor draw trend lines in a sub-window? - The Expert Advisor cannot open sub-windows by itself.

Is it necessary to hook an empty indicator to dangle to the side?