Any questions from newcomers on MQL4 and MQL5, help and discussion on algorithms and codes - page 1141

 
Maksym Mudrakov:
I would do the following, with a third-party indicator you need to track ObjectsTotal(), and if the largest index of my panel object is less than ObjectsTotal()-1, then recreate the panel. Need to try your method in all sorts of situations first, but so far I don't see any more freedom in using Objects Visibility.

Then try to answer the question yourself: what is the visual difference between "delete/create" and "hide/show".

 

I have not found anything about itin MT5 tester, in the Backtest report there is aLR Standard error. What does it mean? I have not found anything about it in textbooks and references, except mentioning that it exists.

I am guessing that it is a standard deviation of results over a series of samples, but the prefix LR may mean something different. I would like to know how it is counted and what kind of a beast it is in general).

Backtest on file.

Files:
 
Valeriy Yastremskiy:

Ctrl T to bring up the menu at the bottom, Trading, Assets, ..... , lastly Log. Click on the logbook and right-click on one of the entries to view

"Journal" didn't help, but following an analogy, "Experts" did. Thank you.

 
Alexandr Sokolov:

I am writing an EA that from time to time needs to perform several long cycles of different recalculations (e.g. every 12, 24, 48 hours). Each such recalculation takes 1.5-2 hours on one core (i.e. in one thread) - and naturally, processing of new ticks and trading by this EA are paused

... Such calculations can be delegated to another EA in another thread and the final data can be transferred between EAs using the EventChartCustom function and OnChartEvent event handler


But I need to be able to publish the EA in the marketplace - so delegating recalculations and recalculations in the same thread is not suitable. Is there an analogue of the thread library from C++ or some other version for implementing such a specific EA in MQL5? (I've entered the word "thread" into search engine on this site with filter "Documentation" and there is nothing).

night to use when there is no trade.

 
Artyom Trishkin:

Then try answering the question yourself: what is the visual difference between "delete/create" and "hide/show".

If it works when manipulating object visibility, then it's very good. I'll have to give it a try. Thank you.
 

Good day all!
I need to print () some parameters of a closed order after each order has been closed by stop (and there are a lot of them opened at the same time). I have learned how to do it very successfully. But..... there is one problem which my mind is not enough to solve. Some orders are closed by stop on the same tick and at the same price. In this case, the program ignores the first closed order and prints Print() only the last closed order. It doesn't print the first one.
Q: .
What language construction can be used to make the application print Print () even after the first order closed at stop in the cases I described above?

I would be very grateful if you could write the code for such a design. I'm having a hard time understanding the explanation in words so far.

Thank you.

int start()
{
int Ht = OrdersHistoryTotal();
if (OrderSelect (Ht-1,SELECT_BY_POS, MODE_HISTORY))                                             
if (TP!=OrderTicket( ))
{
Print("---------------------------------------------------------------=",TimeToString(OrderOpenTime()) );
TP=OrderTicket( );
}

if (TimeCurrent()==1262598040)
if (H==0)
{
OrderSend(Symbol(),OP_SELL,0.1,Bid, 3,1.62199,1.60919,"300",10 );
H=1;
}
if (TimeCurrent()==1262601140)
if (L==0)
{
OrderSend(Symbol(),OP_SELL,0.1,Bid, 3,1.62199,1.61758,"300",10 );
L=1;
}
return(0);
}


 
ANDREY:

Good day to all!
After each order (and there are a lot of them opened at once) is closed by a stop, I need to output some parameters of a closed order in Print (). I have learned how to do it very successfully. But..... there is one problem which my mind is not enough to solve. Some orders are closed by stop on the same tick and at the same price. In this case, the program ignores the first closed order and prints Print() only the last closed order. It doesn't print the first one.
Q: .
What language construction can be used to make the application print Print () even after the first order closed at stop in the cases I described above?

I would be very grateful if you could write the code for such a design. I'm having a hard time understanding the explanation in words so far.

Thank you.


Explanation in words: We need to monitor the number of orders and positions and compare them with the previous state. If there were 12 positions on the previous tick and 8 positions on the current tick, we have a 4 position change. Accordingly, we should take the last four (by time of closing) positions to understand what happened to them.

But judging by the attached code, which says "miracles", you really don't need an explanation in words. But there is help here, not writing for/for.

 
Artyom Trishkin:

The explanation in words: you need to keep track of the number of orders and positions and compare them with the previous state. If we had 12 positions on the previous tick and 8 on the current tick, we have a change of 4 positions. Accordingly, we should take the last four (by time of their closing) positions to understand what happened to them.

But judging by the attached code with "miracles" written in it, you really don't need an explanation in words. But this is a place to help, not to write for/for.

Thanks for the valuable advice. But I have no problem understanding what happened to the orders. I do not know how the program should print () even after the first order has been closed if another order has closed at the same price and on the same tick after it. If orders are closed at one time but at different prices, the program prints Print () after closing of both orders, including the first one.
I would be very grateful to you if you could elaborate on your idea stated in the first post.

The code is "magic" because it is only intended to describe the problem visually and nothing else.


 
ANDREY:

Thanks for the valuable advice. But I have no problem understanding what happened with the orders. I do not know how the program will print () even after the first order has been closed if another order has closed at the same price on the same tick and at the same tick. If orders are closed at one time but at different prices, the program prints Print () after closing of both orders, including the first one.
I would be very grateful to you if you could elaborate on your idea stated in the first post.

The code is "miraculous" because it is only intended to describe the problem clearly and nothing else.


If you reread what I have written, you will understand that there is nothing to develop - I have written how to determine if more than one position is closed on one tick, and what to do with it - also. And the code - well, it's all individual according to one's needs. I've even written in the articles how to do everything, chewed it up and laid out all the codes - how much more could I ask...

 
Artyom Trishkin:

If you re-read what I have written, you will understand that there is nothing to develop - I have written how to determine if more than one position is closed on one tick, and what to do with it - also. And the code - well, it's all individual according to one's needs. I' ve even written in the articles how to do everything, chewed it up and laid out all the codes - how much more could I ask...

I'd be very grateful if you could send me links to your articles on my question.
Thank you.

Reason: