Learning and writing together in MQL5 - page 3

 
FlyAgaric   :

"It seems quite simple to me...".

To use free MS Visual Studio (or any analogue) as development environment.

We will release the standard "adapter" mql5.exe to enable the compilation from other IDEs. However, the debugging will only work from the MetaEditor.

However, I personally doubt that there is any sense in working with MQL5 code from other IDEs.

The MetaEditor will be further improved and will also be directly integrated with MQL5.com and its Code Base.

And MQL4(MQL5) will be implemented as a library using one of the languages (VB, C++ and C#). The latter one,

in my opinion, is the most expressive one. Now you have a debugged and time-tested development environment

with all the necessary attributes. And the compiled code is most suitable for Windows.

If you want to write the maximum fastest possible code, you can make your own DLL and call them from MQL5.

According to the authors, everything will run 4-20 times faster in MQL5. Not noticed. A simple indicator

The Moving Average with some minor changes is much slower than in MQL4.

I have given my opinion, if it offends anyone - please excuse me.

MQL5 is in fact many times faster than MQL4, although the code optimization is disabled before the release.

As soon as we approach the release of the system, we will publish the open source performance tests so that anyone can check and make sure.
 
Renat :


If you want to write the fastest possible code, you can make your own DLLs and call them from MQL5.


MQL5 is really many times faster than MQL4, although code optimization is disabled before the release.


As soon as we get closer to the system release, we will publish open performance tests with sources, so anyone can check and make sure.

Thank you for your attention. I didn't think anyone would read it on their day off.

Renat, those were my thoughts out loud. I'll be very happy if everything you have in mind turns out well.

As for the use of DLL, I was not able to get it in MT4 or MT5. I wrote it in C++ and C#.

Congrats on the upcoming holiday and best of luck to MetaQuotes Software Corp.

 
FlyAgaric   :

As for using a DLL, I wasn't able to snag it in either MT4 or MT5. I was writing in C++ and C#.

Congratulations on the coming holiday and best of luck to MetaQuotes Software Corp.

Attach trimmed DLL project with sources in ZIP archive directly to Forum - they will help for sure.

Thanks for the congratulations!

 

Hello, everyone!

Help me, guys.

I need to get the time of the last quote in the express. Maybe there is a simple way to do it?

So far, I'm doing this:

      err=0;
      do
        {
         rates_total=CopyTime(NULL,PERIOD_CURRENT,0,1,iTime);
         err++;
        }
      while(rates_total<=0 && err<QUANTITY_OF_ATTEMPTS);
      if(err>=QUANTITY_OF_ATTEMPTS)
        {
         cur_time=TimeCurrent();
        }
      else
        {
         cur_time=iTime[0];
        } 

Is there a simpler way?

Документация по MQL5: Стандартные константы, перечисления и структуры / Состояние окружения / Информация об инструменте
Документация по MQL5: Стандартные константы, перечисления и структуры / Состояние окружения / Информация об инструменте
  • www.mql5.com
Стандартные константы, перечисления и структуры / Состояние окружения / Информация об инструменте - Документация по MQL5
 
vdv2001   :

Hello, everyone!

Help me, guys.

I need to get the time of the last quote in the express. Maybe there is a simple way to do it?

So far, I'm doing this:

Is there a simpler way?

See Structure for current prices
 

Good afternoon.

My Expert Advisor is calculatinga market profile on M1, everything works fine when I put it on the chart, but if I switch off the terminal and switch it on after a few hours, an error occurs and the Expert Advisor crashes.

I suspect it is because of the swap history, the initialization function runs before the updated data is loaded (main calculations are performed at initialization) and therefore it crashes.

I have a question, how can I know from Init that the tool data is fully loaded? When I checked if the terminal is connected to the server it does not always help, i.e. if the "fresh" data is not too much then works fine, if a few days then it crashes with an error or does not calculate the last days.

Can you tell me how to raise the flag that all data is up to date?

Инструмент «Ценовая гистограмма» (Рыночный профиль) и его реализация на MQL5
Инструмент «Ценовая гистограмма» (Рыночный профиль) и его реализация на MQL5
  • 2010.01.26
  • Dmitry
  • www.mql5.com
Рыночный профиль был разработан Питером Стидлмайером (Peter Steidlmayer), который предложил использовать альтернативное представление информации как о горизонтальном, так и о вертикальном движении рынка, что дает полностью отличный набор моделей. Он предположил, что у рынка существует основной рыночный пульс, или фундаментальная модель, которая называется цикл равновесия и неравновесия (cycle of equilibrium and disequilibrium). В данной статье я сделаю попытку дать общие понятия об упрощенной модели Рыночного профиля (Market Profile) – Ценовой Гистограмме (Price Histogram) и расскажу, как реализовал данный инструмент на MQL5.
 
vdv2001   :

Good afternoon.

My Expert Advisor is calculating a market profile on M1, everything works fine when I put it on the chart, but if I switch off the terminal and switch it on after a few hours, an error occurs and the Expert Advisor crashes.

I suspect it is because of the paging history, the initialization function runs before the updated data is loaded (main calculations are performed during initialization) and therefore it crashes.

I have a question, how can I determine from Init that the tool data is fully loaded? When I checked if the terminal is connected to the server it does not always help, i.e. if the "fresh" data is not too much then works fine, if a few days then it crashes with an error or does not calculate the last days.

Can you tell me how to raise the flag that all the data is updated?

Move initialization on history from OnInit() to OnTick() (you have to check that code is executed only 1 time) and all problems with paging disappear

 
 
alsu   :

Move initialization on history from OnInit() to OnTick() (the code should be checked to be executed only once) and all problems with paging will disappear.

One problem has disappeared, but after the transfer of calculations to OnTick() another one has appeared - the markets which are not working at the moment have an empty chart and OnTick() function is not called.

 
Rosh   :
Also see Organising data access


Thank you for solving it this way:

int OnInit()
  {
//---
   while(!(bool)SeriesInfoInteger(Symbol(),0,SERIES_SYNCRONIZED))
     {
      Sleep(20);
     }
   if(ExtExpert.Init())
      return(0);
   else
      return(-1);
  }