Any rookie question, so as not to clutter up the forum. Professionals, don't pass by. Nowhere without you - 6. - page 712

 
_new-rena:

138 - "The requested price is out of date, or bid and ask are mixed up.

The open/close price cannot be recalculated, because it is there, but there is a problem here(you need to query the price and give it a value using MarketInfo, and reassign this one to another variable):

Thanks for the tip) But it turned out that my problem is in the EA itself and not in this function.
 
How to remember a certain level. Let's say it was the Maximum of a candle. But assigning this value to a variable was through if. and in another situation, this variable is zero. i.e. I need to remember a certain price somehow.
 
305:
How to memorise a certain level. Suppose it was the Maximum of a candle. But assigning this value to a variable was through if. and in another situation, this variable is zero. i.e. i need to remember a certain price somehow.
Maybehttps://book.mql4.com/ru/variables/arrays can help. I think there is something you need below.

Time series arrays

 
That doesn't work. I'm going to try the horizontal line
 
305:
This isn't working. I'm going to try the horizontal line.

kim has many different functions to memorise anything, it takes about 3 minutes to run through the names, maybe you can findhttps://www.mql5.com/ru/forum/131859

 
7Konstantin7:

Complicated for me, will think) there is a codeto close orders in the order they were opened.

Here as I understand the sorting goes at the expenseof OrderTicket

I would like to put it in the code)

Please, tell me what is the secret of closing orders in a certain order and not in a row? How would a couple of seconds change the life of the account ?

Thanks.

 
Roger:

Tell me, what is the secret to closing orders in a certain order and not in a row ? How would a couple of seconds make a difference in the life of an account?

Thanks.

Let's take that trawl I never managed to rewrite the function(, which closes orders in the order they were opened: shuffle

This function closes all profitable orders first, then all losing ones, which results in an ugly balance chart in the stack plus wrong data: maximal drawdown, maximal series of losing orders, maximal profit and maximal series of profitable orders.

If I close orders in a mixed mode, then there would not be such great values.

If you use closing orders in the order they have been opened, the balance chart will become more even, the data-information in the statement will be more adequate.

Suppose we trade a lot of pairs, if we cover all of them one by one, the price may go away for some pair before we get to it,

If we cover in the order of opening we will close on one pair, then on another and so on, so it is more diversified.

I think MT4 can send up to 8 orders simultaneously, but I am not sure, in this case we can close even faster.

 
7Konstantin7:

Let us take that trawl where I could not change the( function so that it closes orders in the order they were opened: Shuffle

in this function all profitable and then all losing orders are closed first, which results in an ugly balance chart in the stack plus wrong data: maximal drawdown, maximal series of losing orders, maximal profit and maximal series of profitable orders.

Then it turns out to be a stupid decent roller coaster, for example, it went up by 500 $ then fell down by 400 $. If we had to close orders in a mixed mode, then such big values would not exist.

If we use closing orders in the order they have been opened, the balance chart will become more smooth and the data-information in the statement will be more adequate.

Suppose we trade a lot of pairs and if we close all of them one by one, the price may go away for some pair before we get to it,

If we cover in the order of opening we will close on one pair, then on another and so on, so it is more diversified.

I think MT4 can send up to 8 orders simultaneously, but I am not sure, in this case we can close even faster.

Reverse cycle. Looking for the earliest open position, close it, go to the beginning of the cycle. Continue until you run out of positions to close.
 
artmedia70:
Reverse cycle. Look for the earliest open position, close it, go to the beginning of the cycle. Continue in this way until you run out of all positions to close.

Thanks, I can't do it, I just thought maybe someone could scribble a few lines in that function or could drop an owl, the final version. I don't think it's hard, but it's unlikely anyone will help.

There are 4 credits on mql5 could give) if it's possible to transfer between members.

 
7Konstantin7:

Thanks, I can't do it, just thought maybe someone could scribble a few lines in that function or could drop an owl, the final version. I don't think it's hard but I don't think anyone will help.

There are 4 credits on the site mql5 could give) if it's possible to transfer between the participants.

1. Find the earliest open position you can in the loop and return its ticket?

Reason: