Transition of positions after 0:00 when the bank is operating. How to identify? Need help from the hall. - page 8

 
Vladimir Simakov:
What are you all running around with magician? Wrap each position in a class and do not look for it on the tick, and just keep track of it. If it suddenly closed, then analyze the reason for closing. If the reason is rollover, then look for a new one and change the class fields to the actual ones. To organize restart after failures we write all necessary information in a separate file (well I don't like global variables of terminal).

Can I give you an example with code?

For a specific 'reason' - rollover.

If not an example, where to look and where to read to understand how to do it.

 
Oldman_Evgeny:

Can I give you an example with code?

For a specific 'reason' - rollover.

If not an example, where to look and where to read to understand how to do it.

You have to write it yourself. I showed you the direction, and then you do it yourself. For rollover I always thought that the position identifier is saved, I'll have to test it.

 
Now at work, there's nothing for mt5, but for mt4 it looks like this. From one of the jobs.
Files:
COrder.mqh  19 kb
 
Vladimir Simakov:
What are you all fussing about with magik? Wrap each position in a class and don't look for it on the tick, just keep track of it. If it suddenly closed, then analyse the reason for the closure. If the reason is rollover, then look for a new one and change the class fields to the actual ones. To organize restart after failures we write all necessary information in a separate file (well I don't like global variables of terminal).

It is nonsense to store data in a file that can be retrieved from a trade server. Apart from transferring to other PCs, file loss/spoilage can happen.

 
Andrey Khatimlianskii:

It is nonsense to store data in a file that can be retrieved from a trade server. Apart from transferring to other PCs, loss/spoilage of the file can happen.

Here is an introduction to mt4. Now imagine that for the restart, you need to store the information about the chains of grid orders in memory, which are not linear, but with a branching process and how would you do that? I know about global variables of the terminal, but it is also a crutch with conversion to double and yes, it also spoils the file with the same probability.

 
Vladimir Simakov:

Here's an introduction to mt4. Now imagine that for the restart, you need to decompose the information about the chains of grid orders in memory, which are not even linear, but with a ramification and how would you do that? I know about global variables of the terminal, but it is also a crutch with conversion to double and yes, it also spoils the file with the same probability.

What does this mesh dinosaur have to do with a simple rollover?

I didn't say you don't need files at all, you just don't need to use them where there's plenty of magic to go around.

 
Andrey Khatimlianskii:

What does this mesh dinosaur have to do with a simple rollover?

I didn't say you don't need the files at all, you just don't need to use them where there's plenty of magic.

That's what I wrote about them as a tool.
 
Vladimir Simakov:
That's what I wrote about them as a tool.
In response to the rollover problem)
OK
 
Andrey Khatimlianskii:
In reply to rollover problem)
OK

There's another problem with magic - the user. Five robot instances and all have the same magic, only the settings are different, and a shout to support: BAAAG!

 
Andrey Khatimlianskii:

What does this mesh dinosaur have to do with a simple rollover?

I didn't say you don't need the files at all, you just don't need to use them where there's plenty of mains to go around.

How is "meijk enough" on rollover reopening?

Meijic becomes zero and that's it...