[WARNING CLOSED!] Any newbie question, so as not to clutter up the forum. Professionals, don't go by. Can't go anywhere without you. - page 531

 
Please advise, I am trying to make a condition that would check how much time has passed since the last closed order, something like
TimeCurrent()>=FindLastTime()+TimeOut
the cycle was written:

int FindLastTime() {
   int order_time;
   int ticket;
   int itime = 0;
   int ticketnumber = 0;
   for (int i=OrdersTotal()-1; i>=0; i--) {
      OrderSelect(i, SELECT_BY_POS, MODE_HISTORY);
      if (OrderSymbol() != Symbol() || OrderMagicNumber() != Magic) continue;
      if (OrderSymbol() == Symbol() && OrderMagicNumber() == Magic) {
         ticket = OrderTicket();
         if (ticket > ticketnumber) {
            order_time = OrderCloseTime();
            itime = order_time;
            ticketnumber = ticket;
         }
      }
   }
   return (order_time);
}

But for some reason it does not work and does not return the time of the last order
 
d22 писал(а) >>

Start()
{
static bool f=1;

if(f==1)
{
Alert("bid1=",Bid);
f=0;

Sleep(30000);
RefreshRates();
f=1;

Alert("bid2=",Bid);
}
}

I don't understand anything. Such code on the tester always gives the same bid1 and bid2, It cannot be the same price within 30 sec.


Sleep() doesn't work in the tester

 
T-G >>:
Знатоки подскажите, пытаюсь сделать условие что бы проверялось сколько времени прошло с момента последнего закрытого ордера, что то типа
был написан цикл:


Но почему то не работает и не возвращает время последнего ордера


the variable type OrderCloseTime(); - datetime
Change the variable type declaration in the function
datetime order_time;
datetime itime=0;
 
Can anyone suggest good literature on writing Trade Advisors - something as practical as possible.
 
Hello! I have an unquenchable desire to learn how to program in MQL4-5, but I have zero knowledge in programming. Where should I start, maybe with BASIC, Pascal, C+, or MQL? I would be very grateful to you if you could direct me along the path of least resistance. :)
 
chepikds писал(а) >>
Hello! I would like to learn programming in MQL4-5 but I don't know anything about it. Where to start? I would be very grateful to you if you could direct me along the path of least resistance. :)


Get a programming book and solve the easiest problems... in MQL... trade and graphical problems will be solved well after learning the basics of algorithmization.

 
DDFedor >>:


берите задачник по программированию и решайте САМЫЕ ПРОСТЫЕ задачи... на MQL... торговые и графические задачи будут хорошо решаться после усвоения ОСНОВ алгоритмизации.


But you need a starting point, don't you? What's the basics of algorithmisation? Can you be more specific?
 
Good afternoon, friends.

Can you please tell me if it is possible to export quotes of financial instruments from MetaTrader to an external file (e.g. excel file).

I am used to do the analysis in excel.

Many thanks in advance.
 
chepikds писал(а) >>


But you need a starting point, don't you? What's the basics of algorithmisation? Can you be more specific?


It's hard to give you specific advice. go through your textbook and documentation. go through the examples in your textbooks until you understand how it works... "it's like assembling an automaton... repeat, repeat, repeat, repeat, repeat, repeat, repeat....................."

 
Morzh09 >>:

Добрый день, друзья.

Подскажите, пожалуйста, можно ли выгрузить из MetaTrader'a котировки финансовых инструментов во внешний файл (например, в файл excel).

Привык проводить анализ в Excel.

Заранее большое спасибо.

F2, select instrument, timeframe and export button...