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

 
Artyom Trishkin:
Load history. F2.

Thank you!

Can this be the reason why the function that traces the drawdown is not working correctly? I think I did it right, but it is still not only broken, but the trade is still going on.

extern  double deposit    = 1000,
               equity     = 90.5;
//------------------------------------------------------------------------------------------------------------------------------
bool bol;
   double horders = 0, torders = 0;
   for(int c = OrdersHistoryTotal() - 1; c >= 0; c--)
     {
      if(OrderSelect(c,SELECT_BY_POS,MODE_HISTORY) == true)
        {
         if(OrderMagicNumber() == id_number && (OrderComment() == "1" || OrderComment() == "2") && OrderOpenTime() >= ti)
           {
            horders += OrderProfit() + OrderCommission() + OrderSwap();
           };
        };
     };
   for(int d = OrdersTotal() - 1; d >= 0; d--)
     {
      if(OrderSelect(d,SELECT_BY_POS,MODE_TRADES) == true)
        {
         if(OrderMagicNumber() == id_number && (OrderComment() == "1" || OrderComment() == "2"))
           {
            torders += OrderProfit() + OrderCommission() + OrderSwap();
           };
        };
     };
   double tequity = deposit + horders + torders;
   if(tequity > max_equity) {max_equity = tequity;};
   if(tequity/max_equity*100 <= equity)
     {
      for(int e = OrdersTotal() - 1; e >= 0; e--)
        {
         if(OrderSelect(e,SELECT_BY_POS,MODE_TRADES) == true)
           {
            if(OrderMagicNumber() == id_number && (OrderComment() == "1" || OrderComment() == "2"))
              {
               bol = OrderClose(OrderTicket(),OrderLots(),(OrderType() == OP_BUY ? Bid : Ask),slippage,clrNONE);
              };
           };
        };
      ExpertRemove();
     };
 
Alexandr Sokolov:

Thank you!

Could this be the reason why the drawdown feature is not working correctly? Because I seem to have done everything correctly, but it is still not only broken, but the trade is still going on

I cannot answer, I have no time to deal with it.
 
Is it possible to use an array as an input parameter very inconvenient to reassign values 2 times at a time?
 

Hi all.
I need your help, help me to correct my EA or suggest a code or where to read...

for example there are 20 buy orders.
they have a total loss of e.g. $100.
but also among these 20 buy orders there are for example 5 orders that show a profit of eg $20.

how to make an Expert Advisor to find positive orders among the unidirectional ones, count their profit with commission, swap, and spread, and close them when a positive value of "plus" orders is reached....

Without trawl, without modifications.

If you do not know how to do this, please do not hesitate to use MQL4 and help me, because I'm sure I will learn it!
If you have any suggestions or I will send you an EA for modification, please do not hesitate to contact me.

I will follow it here, but for efficient communication, just send me a message by @rs_tm


Here is one of the intermediate results of the test (25% quotes at this stage of the test are sufficient)

here are the results of one of the tests

 
Reshetnikov:

Hi all.
Need your help, help me to correct an EA or suggest a code or where to read...

for example there are 20 buy orders.
they have a total loss of e.g. 100$.
but also among these 20 buy orders there are eg 5 orders that show a profit of eg $20.

how to make an Expert Advisor to find positive orders among the unidirectional ones, count their profit with commission, swap, and spread, and close them when a positive value of "plus" orders is reached....

Without trawl, without modifications.

If you do not know how to do this, please do not hesitate to use MQL4 and help me, because I'm sure I will learn it!
If you have any suggestions or I will send you an EA for modification, please do not hesitate to contact me.

I will keep track of it here, but for efficient communication just send me a message(deleted)


Here is one of the intermediate results of the test (25% quotes at this stage of the test are sufficient)

Freelance if you want everything done for you.

Either show the code and they will try to help you where you can't get it right. The forum is for helping those who are learning MQL. The forum is for those who want to learn MQLs.

Торговые приложения для MetaTrader 5 на заказ
Торговые приложения для MetaTrader 5 на заказ
  • www.mql5.com
нужно написать советник Трендовые!.а именно какой?они есть в маркете (mq5.com),если вы профессионал,я думаю у вас не состоит труда сделать такой же,какой я вам скину силку этого продукта!мне именно такой надо,какой он есть!чтобы и результаты совпадали,и входные параметры! также для вашего удобства есть видео,где показана исходный код советника...
 

why the optimisation settings drop out (how to save for optimisation) when moving to the SETTINGS tab and back:

here downloaded:



after

moving to the SETTINGS tab and back - it drops the values for optimisation




 
Roman Shiredchenko:

why the optimisation settings drop out (how to save for optimisation) when moving to the SETTINGS tab and back:

here it is downloaded:



moving to SETTINGS tab and back - it drops values for optimization




This has been happening in MT5 for a long time. Even 2007 build I was shown resetting parameters. How it is related to the broker's build and version we do not know, but it seems to me there is a relation. The same dependence was observed with minimal lot and lot step. For one and the same broker on the cent, build 2025 shows normally, and on the dollar the minimum lot and the step was 100, while the 2007 build showed 0.01. This is just an explanation of my opinion.

Hopefully the update will fix the situation, as there has already been discussion about this and it has been promised a fix.

 
Alexey Viktorov:

This has been happening in MT5 for a long time. Even the 2007 build has shown me the resetting of parameters. We do not know how it is connected between the build and the broker's version, but it seems to me there is a relation. The same dependence was observed with minimal lot and lot step. For one and the same broker on the cent, build 2025 shows normally, and on the dollar the minimum lot and the step was 100, while the 2007 build showed 0.01. This is just an explanation of my opinion.

I hope the update fixes the situation, as there was already a discussion about it and it was promised to fix it.

Thanks for the information. In fact at the moment try to test through another broker on MT5 if their builds are different, I understand correctly? so that the settings are not reset for optimisation.
 
Roman Shiredchenko:
Thanks for the info. As a matter of fact currently try to test through another broker on MT5, if their builds are different, do I understand correctly? so that the settings are not reset for optimisation.

Have you tried updating?

Then, I don't remember exactly, but it seems that if after setting the parameters I start the test immediately without going back to the "Parameters" tab, the test will be with the parameters set.

 
Alexey Viktorov:

Have you tried updating?

Then, I don't remember exactly, but it seems if you start the test immediately after setting the parameters, without going back to the "Parameters" tab, the test will be with the parameters set.

forgot how to update... just downloaded from robot...

I'm not interested in the test, but in optimisation - and this is impossible... because they (the values of the set parameters) - are reset

Reason: