The problem of transferring from MT4 to MT5. Or, more precisely, the inability to execute some algorithms in MT5 without'err. - page 5

 
Andrey Khatimlianskii:

The suggestion was to do it on a timer every minute and a half. Not before every tick, and certainly not on a chart event.

Access to timeseries in MT5 is indeed not ideal. But if you need to solve a problem and not find an excuse, then it is possible.

No one is looking for an excuse. You don't know the level of difficulty of the task. That's why you talk so easily about an excuse.

It was suggested to update on a timer every 2 minutes. That's what I have done.

But... This is not enough. Even after this timer update, when creating an event on a chart via the GUI it often happened that calling iBarShift gave -1 . This consequently causes an exit outside the array boundary or some other error. So I tried doing an accessibility check on the timeseries before entering OnChartEvent. For better understanding, I will say, we need to check access to all 21 timeseries. If at least one timeseries is not accessible, it is almost 100% probable that the graphic plots will be made with some kind of error.

The program is complex, with approximately 50,000 lines. On such a volume there are many different timeseries accesses.

Lags occur all the time (In MT5 variant). It works like clockwork in MT4.

MT5 is not interesting for me. I don't use it in trading. I use only MT4. I have started translating the program only on users request. When I faced with such a pain in the neck I decided that it's better to do what is interesting.

During the 14 years of the programme's development some interesting ideas appeared. I am now implementing these ideas.

 
Eugeni Neumoin:

It was suggested that it should update on a timer every 2 minutes. That's what I've done.

But. This is not enough. Even after this timer update, when creating an event on a chart via the GUI, it often turned out that calling iBarShift gave -1 .

Is the exact ofiBarShift not true by any chance?

I've had difficulties with synchronisation too, even after timed updates. But I couldn't reproduce it ironically, the problem is floating.


Eugeni Neumoin:

MT5 is not interesting to me. I don't use it in trading. Only MT4. I have started translating the program only on users request. When I faced with such a pain in the neck, I decided that it's better to work with the things that are interesting to me.

During the 14 years of the programme's development some interesting ideas have appeared. I am now implementing these ideas.

I'm not advocating for MT5. I just noticed at once that you don't have a great desire to understand it).

Of course, it's better to do what is interesting!

 
Eugeni Neumoin:

No one is looking for an excuse. You don't know the level of difficulty of the task. That's why you talk about excuses so easily.

The suggestion was to update on a timer every 2 minutes. That's what I've done.

But... This is not enough. Even after this timer update, when creating an event on a chart via the GUI it often happened that calling iBarShift gave -1 . This consequently causes an exit outside the array boundary or some other error. So I tried doing an accessibility check on the timeseries before entering OnChartEvent. For better understanding, I will say, we need to check access to all 21 timeseries. If at least one timeseries is not accessible, it is almost 100% probable that the graphic plots will be made with some kind of error.

The program is complex, with about 50,000 lines. On such a volume there are many different timeseries accesses.

Lags occur all the time (In MT5 variant). It works like clockwork in MT4.

MT5 is not interesting for me. I don't use it in trading. I use only MT4. I have started translating the program only on users request. When I faced with such a pain in the neck I decided that it's better to do what is interesting.

During the 14 years of the programme's development some interesting ideas appeared. I am now implementing these ideas.

Cache the timeseries.
 
Artyom Trishkin:
Cache your timeseries.

What do you mean? Manually make your own caches?

 
Andrey Khatimlianskii:

What do you mean? Manually make your own caches?

Once you count all timeseries, and then only add more. This can be done in a window.
Yes, into their own arrays. You can do it with SB. The timeseries class is your own.
 
Andrey Khatimlianskii:

Does iBarShift's exact value happen to be true?

true. I need to know the exact bar number.

 
Artyom Trishkin:
Count all the timeseries once, and then only add more. You can do it in the window.

So you suggest not using buffers, but working with your arrays?

What are buffers for then?

So you propose to make your own crutch, instead of buffers :(

And instead of iTime, iLow, etc. make your own functions... Rewrite everything in its own way, bypassing functions that don't work from MT5...

This is drastic. But let enthusiasts do it. I'll stand aside. I won't even watch the process.

 
Eugeni Neumoin:

So you suggest not using buffers, but working with your own arrays?

Have a look at the SB. There is a work with indicators there. If you do not want to make your own. In general, you have to create a class once and then use it for any text message. And the data will always be available. Only you will have to add new ones indiscriminately.
 
Eugeni Neumoin:

So you suggest not using buffers, but working with your arrays?

What are buffers for then?

So you propose to make your own crutch, instead of buffers :(

And instead of iTime, iLow, etc. make your own functions... Rewrite everything in their own way, bypassing functions that don't work from MT5...

Everything works there. But sometimes access is denied. Maybe because of time-series updates - I don't know. If it refuses, you have to repeat the request, because the first request activates the data swap.
 
Eugeni Neumoin:

true. I need to know the exact bar number.

Then there is an error in logic, perhaps. There may not be a bar.