How to find OP_BUY with maximum OrderOpenPrice and determine its OrderProfit. I can't put them together, everything works through the ass... If you can give me an example right away) Thank you)
How to find OP_BUY with maximum OrderOpenPrice and determine its OrderProfit. I can't put them together, everything works through the ass... If you can give me an example right away) Thank you)
previous_value=0;
if (OrderOpenPrice()>previous_value)
{
previous_value=OrderOpenPrice();
profit_order=OrderProfit();
}
How to work with a file in mql5 program without writing the file to disk, but to work only in RAM, to speed up. I want to transfer data from an mql5 program to a program on my computer. Is it possible to do it without network functions? It doesn't have to be a file, an array or a variable; it's even better. I only know two ways, python integration module and web socket, is there any other way?
I delete all objects in OnDeInit() by loop (arrows indicating signal bars and one button):
constint obj_total=ObjectsTotal();
Print("ObjectsTotal ",obj_total);
for(int i=0 ; i < obj_total ; i++){
Print("ObjectName ",ObjectName(i),", i = ",i);
ObjectDelete(ObjectName(i));
}
I am aware that there is ObjectsDeleteAll(), but still if I do it through a loop, only half of the objects are deleted in one. Actually here is the work of the loop and I don't understand why it happens so:
2021.09.3004:47:30.4622021.01.0403:56:45 test EURUSD,M1: ObjectName , i = 202021.09.3004:47:30.4622021.01.0403:56:45 test EURUSD,M1: ObjectName , i = 192021.09.3004:47:30.4622021.01.0403:56:45 test EURUSD,M1: ObjectName , i = 182021.09.3004:47:30.4622021.01.0403:56:45 test EURUSD,M1: ObjectName , i = 172021.09.3004:47:30.4622021.01.0403:56:45 test EURUSD,M1: ObjectName , i = 162021.09.3004:47:30.4622021.01.0403:56:45 test EURUSD,M1: ObjectName , i = 152021.09.3004:47:30.4622021.01.0403:56:45 test EURUSD,M1: ObjectName , i = 142021.09.3004:47:30.4622021.01.0403:56:45 test EURUSD,M1: ObjectName , i = 132021.09.3004:47:30.4622021.01.0403:56:45 test EURUSD,M1: ObjectName , i = 122021.09.3004:47:30.4622021.01.0403:56:45 test EURUSD,M1: ObjectName , i = 112021.09.3004:47:30.4622021.01.0403:56:45 test EURUSD,M1: ObjectName button1, i = 102021.09.3004:47:30.4622021.01.0403:56:45 test EURUSD,M1: ObjectName ArrowUp0008, i = 92021.09.3004:47:30.4622021.01.0403:56:45 test EURUSD,M1: ObjectName ArrowUp0006, i = 82021.09.3004:47:30.4622021.01.0403:56:45 test EURUSD,M1: ObjectName ArrowUp0004, i = 72021.09.3004:47:30.4622021.01.0403:56:45 test EURUSD,M1: ObjectName ArrowUp0002, i = 62021.09.3004:47:30.4622021.01.0403:56:45 test EURUSD,M1: ObjectName ArrowUp0000, i = 52021.09.3004:47:30.4622021.01.0403:56:45 test EURUSD,M1: ObjectName ArrowDown0008, i = 42021.09.3004:47:30.4622021.01.0403:56:45 test EURUSD,M1: ObjectName ArrowDown0006, i = 32021.09.3004:47:30.4622021.01.0403:56:45 test EURUSD,M1: ObjectName ArrowDown0004, i = 22021.09.3004:47:30.4622021.01.0403:56:45 test EURUSD,M1: ObjectName ArrowDown0002, i = 12021.09.3004:47:30.4622021.01.0403:56:45 test EURUSD,M1: ObjectName ArrowDown0000, i = 02021.09.3004:47:30.4622021.01.0403:56:45 test EURUSD,M1: ObjectsTotal21
I delete all objects in OnDeInit() by loop (arrows indicating signal bars and one button):
I am aware that there is ObjectsDeleteAll(), but still if I do it through a loop, only half of the objects are deleted in one. Actually here is how the loop works and I don't understand why it happens this way:
The loop when deleting should be reversed:
for(int i=obj_total-1; i>=0; i--)
and this applies not only to deleting graphical objects, but in general to deleting any objects in the lists of the terminal.
I delete all objects in OnDeInit() by loop (arrows indicating signal bars and one button):
I am aware that there is ObjectsDeleteAll(), but still if I do it through a loop, only half of the objects are deleted in one. Actually here is how the loop works and I don't understand why it happens:
but if you try it this way - only you need to put all the names
Allow the use of cookies to log in to the MQL5.com website.
Please enable the necessary setting in your browser, otherwise you will not be able to log in.
You are signed in. Two-factor authentication has been disabled. Set it up again and scan a new QR code, or continue with two-factor authentication disabled.
Write an example, because I'm already a bit confused. If it's not too much trouble. Thanks
In the loop to search for orders:
if (OrderOpenPrice()<previous_value) { previous_value=OrderOpenPrice(); nearest_order=OrderTicket(); }Before the loop, initialize previous_value=DBL_MAX a nearest_order=0
in the order loop:
initialise previous_value=DBL_MAX a nearest_order=0 before the loop
Exactly. Thank you. Works
in the order loop:
initialise previous_value=DBL_MAX a nearest_order=0 before the loop
DBL_MAX is categorical).
The main thing works)
How to find OP_BUY with maximum OrderOpenPrice and determine its OrderProfit.
I can't put them together, everything works through the ass... If you can give me an example right away) Thank you)
The main thing works)
How to find OP_BUY with maximum OrderOpenPrice and determine its OrderProfit.
I can't put them together, everything works through the ass... If you can give me an example right away) Thank you)
I just wanted to say that I'm all done.
But you have made it more compact. I'll take your suggestion.)
Thanks
I delete all objects in OnDeInit() by loop (arrows indicating signal bars and one button):
I am aware that there is ObjectsDeleteAll(), but still if I do it through a loop, only half of the objects are deleted in one. Actually here is the work of the loop and I don't understand why it happens so:
I delete all objects in OnDeInit() by loop (arrows indicating signal bars and one button):
I am aware that there is ObjectsDeleteAll(), but still if I do it through a loop, only half of the objects are deleted in one. Actually here is how the loop works and I don't understand why it happens this way:
The loop when deleting should be reversed:
and this applies not only to deleting graphical objects, but in general to deleting any objects in the lists of the terminal.
I delete all objects in OnDeInit() by loop (arrows indicating signal bars and one button):
I am aware that there is ObjectsDeleteAll(), but still if I do it through a loop, only half of the objects are deleted in one. Actually here is how the loop works and I don't understand why it happens:
but if you try it this way - only you need to put all the names