The task of searching for orders - page 4

 
Михаил:

...

Give me an example ( MT5 ) when you just HAVE to leave a previously placed order in the market,

...

For example, a stopper on the stop-loss of a position.
 
Vladimir Pastushak:

The bottom line is that even if the operating system on the server is down, you can run a home PC that will restore control of the account at the time that is required to restart the servo.

In my experience working with the VDS / VPS servers OS never flied, but restarts are unforeseen and scheduled happens.

The essence of my question is to correctly write code that collects information about current situation...

Which RESTORES, not deletes. What did I write about? About restoring, which is good. I was told to delete it. You should be more careful ;)
 
Artyom Trishkin:
One that will RESTORE, not delete. What did I write about? About restoring, which is a good thing. I was told that you have to delete. You should be more careful ;)

I agree with you, why would you need an EA that can open and close orders in packs when the system fails, losing everything on the spread...

Advisor should gather information by condition and then work according to its algorithm ...

 
Vasiliy Sokolov:
Shit, man, *** don't bullshit. You yourself have defined the right direction: state should be restored by current environment, what MT gives you is the most reliable option. Instead of it, you write a long and useless class Info, into which you have to somehow cram the values found by external functions. Yes, eventually it will contain the variables you need: maximum and minimum ticket in terms of price for the order, as well as other important for you stuff. But in reality the problem is solved by a specialized container of orders: Imagine you have a list of orders, where each order represents a table row with many columns (order id, open time, open price, profit, etc., etc.). You do sorting by one of the columns, and get exactly the sequence you need. So, all this can be done with help of classes, which you like to use (though clueless, sorry). I'll write how to do it tomorrow, if you're interested.
I hope you didn't just shake the air... Or rather bytes of internet...
 
Dmitry Fedoseev:
For example, a stopper on the stop loss position.

What prevents you from deleting and then reinstalling during initialisation?

Why exactly RESTORE the control?

 
Михаил:

What prevents you from deleting and then reinstalling during initialisation?

Why do we need to RESTORE the control?

Because with this approach, we only collect information about the environment once at the moment of initialisation,

sometimes it happens that the broker splits the open order, i.e. you send 0.05 and the broker accepts it as 0.02 and 0.03

so it is better to get the information about the environment on every tick or at a certain time interval.

For example, I believe that the EA should have all information about the traded symbol and orders all the time.

 
Михаил:

1. what prevents it from being deleted during initialisation and then reinstalled?

2. Why exactly RESTORE the control?

1. Have you heard the joke about removing the tonsils? There is nothing to stop it.

2. Minimum redundancy, minimum interference, and therefore greater compliance with the intended plan. Pending orders are executed without the Expert Advisor's control. Therefore, it would be more reasonable to leave the order in the market, and then restore the control. The restart is only a few minutes, if during this time the order works, the strategy will probably not be broken yet, the Expert Advisor will analyse the situation and will continue. If we delete the order, we will not be able to put it in the same place and then we will have to correct the strategy by the market order which makes the algorithm more complex.

When restarting, we will have to delete and close everything and then restart from the beginning. This does not stand up to criticism.

There is a well-known principle - "do not multiply entities unnecessarily". And a similar principle can and should be adhered to here - not to perform unnecessary trading operations.

 
Dmitry Fedoseev:

1. Have you heard the anecdote about removing your tonsils? Nothing gets in the way.

2. Minimum unnecessary actions, minimum interference, which means greater compliance with the intended plan. Pending orders are executed without the Expert Advisor's control. Therefore, it would be more reasonable to leave the order in the market, and then restore the control. The restart is only a few minutes, if during this time the order works, the strategy will probably not be broken yet, the Expert Advisor will analyse the situation and will continue. If we delete the order, we will not be able to put it in the same place and then we will have to correct the strategy by the market order which makes the algorithm more complex.

When restarting, we have to delete and close everything and then start over. This does not stand up to criticism.

There is a well-known principle - "do not multiply entities unnecessarily". And this principle can and must be followed here - not to perform unnecessary trading operations.

For some reason, I predicted this answer - NOTHING concrete!

I have not had a single crash in 4.5 years, and I have not had a single hang-up in 3.5 years of using the terminal.

When you boot the Expert Advisor after a "crash" (if it ever happens), it does not matter how many and what orders you had, and you will never know which ones you had.

It does not matter how many orders you have had but it does matter if you have or do not have a POSITION, because you may have to REMOVE all your previous orders which are now closed.

Because you may have to cancel orders which do not fit the position you already have, and you may want to re-check all your previous orders which currently do not fit the position you have.

So why re-establish control (once a year!!!) if you have to remove the previous orders anyway?

Does it make any sense to write a ton of code?

What for?

 
Михаил:

I somehow anticipated this answer - NOTHING concrete!

I have not had a single crash in 4.5 years and in 3.5 years of using the terminal I have never had a hang-up.

When you have downloaded the Expert Advisor and it "crashed" (if it ever happens), it does not matter how many and what orders you had.

When you load an EA, if you ever have one, it does not matter how many orders you have but it does matter if you have or do not have a POSITION because you may have to REMOVE all your previous orders which currently exist in the trading platform.

Because you may have to cancel orders which do not fit the position you already have, and you may want to re-check your position if it does not work.

So why re-establish control (once a year!!!) if you have to remove the previous orders anyway?

Does it make any sense to write a ton of code?

What for?

All in all, you are the one who is interested in holding such a position for some reason.

No one is forbidding you to write toys for your own use. You took this position because you are writing for yourself and you're certainly not going to make your life harder. If you were a customer, you would have a completely different position.

Besides restarting, you may also experience connection interruptions, after which you must restore control. There is no such a thing as restoring control, because without control there should be nothing at all. At every tick you analyze the situation and make a decision.

I understand your point of view very well. Writing a stable and restartable EA requires quite a different approach and another look at the algorithm. It is not easy, and for some people it is even impossible.

 
Dmitry Fedoseev:

Everything is specific, it's you who are interested in holding that position for some reason.

No one forbids you to write toys for yourself personally for the tester. You took this position because you are writing for yourself, so you won't complicate your life. If you were a customer, you would have a completely different position.

Besides restarting, you may also experience connection interruptions, after which you must restore control. There is no such thing as restoring control, because without control there should be nothing at all. At every tick you analyze the situation and make a decision.

And the customer cares? The most important thing for the customer is that the Expert Advisor works!

If the connection is broken, you do not lose control, because the order ticket has not been lost!

P/S And, Dimitri, what makes you think that I write toys for the tester?

If I don't write anything for customers and don't sell my EAs, it does not

it does not mean that they are "toys"!