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

 
Could it be some kind of delayed error? The programme reaches the end and then hangs, is this possible?
 
The problem is in the loop after all. The Comment is running late. Print is the last in the loop
 
Can you tell me how to find an arrow among other objects in mql4? I need to delete all arrows and leave the lines
 
Aleksandr Kononov #:
Can you tell me how to find an arrow among other objects in mql4? Remove all arrows and leave the lines

Well, read the documentation

int  ObjectsDeleteAll(
   int    sub_window=EMPTY,   // индекс окна
   int    object_type=EMPTY   // тип объекта для удаления
   );
ObjectsDeleteAll - Графические объекты - Справочник MQL4
ObjectsDeleteAll - Графические объекты - Справочник MQL4
  • docs.mql4.com
ObjectsDeleteAll - Графические объекты - Справочник MQL4
 
Thank you!
 
Good time to know mql4. There is a function that closes the percentage part of the furthest losing order in the series due to profitable positions of any direction. I need help in improving this function! Namely, we need to partially close all remaining orders in the series (due to profitable positions of any direction) instead of the first one. Thanks in advance!
Files:
KJH.mq4  8 kb
 
VIREDS #:
Good time to all mql4 users. We have a function which closes the part of the furthest losing order in a series by percentage points at the expense of profitable positions in any direction. We need help in finalizing this function! Namely, we need to partially close all remaining orders in the series (due to profitable positions of any direction) instead of the first one. Thanks in advance!
I have been strugglingwith this function for about 2 months. There are so many nuances. Especially this line
 ProfitPer=OrderProfit()+OrderCommission()+OrderSwap();//ПРОФИТ ОДНОГО ОРДЕРА

When there are a lot of orders in the grid, it gives a total loss when it closes, although it should close all of them at zero. I ended up removing commissions and swaps altogether

double spreadLoss =(MarketInfo(_Symbol,MODE_TICKVALUE)* MarketInfo(_Symbol,MODE_SPREAD));
 
And then in the function you can multiply by lot/lotstep for each order, but I just made a multiplier
 
And before OrderClose() they forgot (!)
 
Good afternoon. Could you please advise how to pay for MQL4 services due to the current situation?
Reason: