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

 
142vs:

Good afternoon!!!


Can anyone tell me what's wrong.

The last closed order is


OrderSelect(  OrdersHistoryTotal() -1 ,SELECT_BY_POS,MODE_HISTORY )

 
Igor Zakharov:

when searching for a later time , compare times, not tickets

tried it, result is the same.

The first screenshot shows Buy orders closed, but the log does not show the closing time.

The second one shows Sell orders have closed but the log shows the time of Buy orders.

The third one is the same.

 
Sergey Likho:

The last closed order is


OrderSelect(  OrdersHistoryTotal() -1 ,SELECT_BY_POS,MODE_HISTORY )


Не помогло...  


//+------------------------------------------------------------------+

//|        Время закрытия последнего ордера                          |

//+------------------------------------------------------------------+

double Last_Ticets_Close()

  {

   Last_Ticet    = 0; 

   Last_OrClTime = 0; 


   for(int i=0; i<OrdersHistoryTotal(); i++)

     {

      if(OrderSelect( OrdersHistoryTotal()-1,SELECT_BY_POS,MODE_HISTORY))

        {

         if(OrderSymbol()==Symbol() && OrderMagicNumber()==magic)

           {

            if(Last_OrClTime<OrderCloseTime())

              {

               Last_Ticet    = OrderTicket(); 

               Last_OrClTime = OrderCloseTime();

              }

           }

        }

     }

   return (Last_Ticet);

  }  

 


No change.
 
142vs:
No change.
//+------------------------------------------------------------------+
int GetTicketLastCloseOrder(const int magic_)
{
   int result = -1;
   datetime t = 0;
   for(int i=OrdersHistoryTotal()-1; i>=0; i--) {
      if(OrderSelect(i, SELECT_BY_POS, MODE_HISTORY) && OrderSymbol()==_Symbol && OrderMagicNumber()==magic_) {
         if(OrderCloseTime()>t) {
            result = OrderTicket();
            t=OrderCloseTime();
         }
      }
   }
   return(result);
}
//+------------------------------------------------------------------+
 
Igor Makanu:
Thank you all very much...
I've got it sorted out.
 
142vs:
Thank you all very much...
figured it out.

please

Here's a useful thread with ready-made solutions to all beginner's questions "Useful features from KimIV only"

Только "Полезные функции от KimIV".
Только "Полезные функции от KimIV".
  • 2011.02.18
  • www.mql5.com
Все функции взяты из этой ветки - http://forum.mql4...
 
Igor Makanu:

please

Here's a useful thread with ready-made solutions to all beginner's questions "Only "Useful features from KimIV"

There's not Igor's collected functions there, but exactly his topic- everything is there, not just the ones deemed necessary by someone else.

Полезные функции от KimIV
Полезные функции от KimIV
  • 2008.03.11
  • www.mql5.com
В этой теме я буду выкладывать коды своих функций на языке программирования MQL4, приводить примеры их использования и отвечать на вопросы, связанн...
 
Artyom Trishkin:

There are not collected by someone else functions of Igor, but exactly his topic - there are all, not only those considered necessary by someone else.

I can be wrong, but your link will be the author's topic, but you need to leaf through the whole topic, it seems that Igor posted a bit raw codes at once, and then sometimes rewrote what needed improvement, although again I can be wrong - I leafed through this topic about 5-6 years ago, I do not remember anymore

 
Igor Makanu:

I could be wrong, but your link will be the author's topic, but you have to leaf through the whole topic, Igor seems to have posted slightly raw codes, and then sometimes rewrote what needed improvement, although again I could be wrong - I leafed through this topic about 5-6 years ago, I do not remember anymore

Igor gave me his libraries - commercial and public. I did not notice the difference between his publicly available one on my website and mine.
 
Igor Makanu:

please

Here's a useful thread with ready-made solutions to all beginner's questions "Only "Useful features from KimIV"

Yeah there's a clondike there....
Thanks again.
Reason: