Errors, bugs, questions - page 2677

 
fxsaber:

Releasing, of course. The terminal itself stores ticks in its cache, which I don't need during operation.

It is better for me to raise these ticks again later on cold. Need a mechanism to "cool down" the Terminal.

Didn't notice it.

void OnStart()
  {
   Print("используется памяти до закачки истории: "+string(MQLInfoInteger(MQL_MEMORY_USED))+" Mb");
   MqlTick items[];
   ulong t0=GetMicrosecondCount();
   uint    count=CopyTicks(Symbol(),items,COPY_TICKS_INFO,0,100000000);
   t0=GetMicrosecondCount()-t0;
   Print ("Загружено за "+string(t0/1000)+" миллисекунд "+ (string)count+ " тиков");
   Print("используется памяти после закачки истории: "+string(MQLInfoInteger(MQL_MEMORY_USED))+" Mb");
   ArrayFree(items);
   Print("используется памяти после ArrayFree: "+string(MQLInfoInteger(MQL_MEMORY_USED))+" Mb");
  }


SZY The sad thing is that in memory the ticks are stored unpacked in a size of 60 bytes per tick. Could easily be packed 5 times (~12 bytes per tick).

 
Stanislav Korotky:

It is better to do automatic downloading as by CopyRates.

In this case the timeframe is unknown. The download is initiated by a period symbol request.

Consider what can be done

 
Nikolai Semko:

not noticed.

You have to look at what the terminal is consuming.

void OnStart()
  {
//   Print("используется памяти до закачки истории: "+string(MQLInfoInteger(MQL_MEMORY_USED))+" Mb");
   Print("используется памяти до закачки истории: "+string(TerminalInfoInteger(TERMINAL_MEMORY_USED))+" Mb");
   MqlTick items[];
   ulong t0=GetMicrosecondCount();
   uint    count=CopyTicks(Symbol(),items,COPY_TICKS_INFO,0,1 e7);
   t0=GetMicrosecondCount()-t0;
   Print ("Загружено за "+string(t0/1000)+" миллисекунд "+ (string)count+ " тиков");
//   Print("используется памяти после закачки истории: "+string(MQLInfoInteger(MQL_MEMORY_USED))+" Mb");
   Print("используется памяти после закачки истории: "+string(TerminalInfoInteger(TERMINAL_MEMORY_USED))+" Mb");
   ArrayFree(items);
//   Print("используется памяти после ArrayFree: "+string(MQLInfoInteger(MQL_MEMORY_USED))+" Mb");
   Print("используется памяти после ArrayFree: "+string(TerminalInfoInteger(TERMINAL_MEMORY_USED))+" Mb");
  }


The result is on a Terminal that has been running for a long time. No EAs/indicators running. Two charts, M1 bars for the current year only.

используется памяти до закачки истории: 1043 Mb
Загружено за 11223 миллисекунд 10000000 тиков
используется памяти после закачки истории: 1675 Mb
используется памяти после ArrayFree: 1102 Mb

60Mb have not been released. Empty Terminal consumes more than a gigabyte. The only way to reduce consumption is to reload the Terminal.

 
Sergey Dzyublik:

Good afternoon, thank you very much.
I haven't used the new operator before because logically it must be slower than ArrayResize with reserved memory.
But I'm impressed with the results obtained, it turns out that it's vice versa, the native array via new operator is faster.

MT5 (build 2363):

Released in beta 2364 (unfortunately it has a compiler error for new T() inside the template)

Here are the logs of your script:

2020.03.19 10:39:45.784 Test (EURUSD,H1)        AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
2020.03.19 10:39:46.765 Test (EURUSD,H1)        Test Class ArrayResize all                                  : loops=1000 ms=984
2020.03.19 10:39:48.233 Test (EURUSD,H1)        Test Class ArrayResize one by one with reserved memory      : loops=1000 ms=1469
2020.03.19 10:39:49.944 Test (EURUSD,H1)        Test Class ArrayResize one by one with new operator         : loops=1000 ms=1703
2020.03.19 10:39:50.923 Test (EURUSD,H1)        Test Class ArrayResize all                                  : loops=1000 ms=969
2020.03.19 10:39:52.392 Test (EURUSD,H1)        Test Class ArrayResize one by one with reserved memory      : loops=1000 ms=1484
2020.03.19 10:39:54.100 Test (EURUSD,H1)        Test Class ArrayResize one by one with new operator         : loops=1000 ms=1703
2020.03.19 10:39:55.079 Test (EURUSD,H1)        Test Class ArrayResize all                                  : loops=1000 ms=985
2020.03.19 10:39:56.548 Test (EURUSD,H1)        Test Class ArrayResize one by one with reserved memory      : loops=1000 ms=1469
2020.03.19 10:39:58.258 Test (EURUSD,H1)        Test Class ArrayResize one by one with new operator         : loops=1000 ms=1703
2020.03.19 10:39:59.237 Test (EURUSD,H1)        Test Class ArrayResize all                                  : loops=1000 ms=984
2020.03.19 10:40:00.705 Test (EURUSD,H1)        Test Class ArrayResize one by one with reserved memory      : loops=1000 ms=1469
2020.03.19 10:40:02.416 Test (EURUSD,H1)        Test Class ArrayResize one by one with new operator         : loops=1000 ms=1703
You can see that ArrayResize for objects has started to work faster.

Once again, the complexity of one part of the ArrayResize function was reduced from logarithm to zero
 
Ilyas:
We can see that ArrayResize for objects is faster now.
Once again, we managed to reduce the complexity of one part of the ArrayResize function from logarithm to zero.

I managed to compare the speed of ArrayResizeReserve and ArrayOnNew on a real project for the data type - class with a single int field, number of records 20M.

In MT5 (build 2363) on all parameters compared except one ArrayOnNew was worse for ArrayResizeReserve:

Read/write access (std::fill_n, std::copy, std::vector::clear): 2-2.5 times slower
Creating all elements at once (std::vector::resize) for "cold"/"hot" memory - 1.1-1.2 times slower
Creating all elements one by one (std::vector::push_back) for "hot" memory - 1.2 times faster

 

these links in the help (editor) lead to a page not found


 
MT5 bug (build 2363) Mismatching execution priorities of template functions in MQL compared to template functions in C++(online:https://onlinegdb.com/HkNqBDZ88).
The problem
occurs when the first "test" function contains a fullyspecialized template base class as an argument,
and the second "test" function overloads the first, is a template function and contains a non-specialized template base class as an argument.

template<typename T>
struct B{
   T data;
};

template<typename T>
struct BB : public B<T>{};


template<typename T>                                             
struct A{
public:
   static void test(T& src){
      printf("1");
   }
   
   template<typename TT>
   static void test(B<TT>& src){
      printf("2");
   }
};
      

void OnStart(){
   BB<int> bb;
   A<B<int>>::test(bb);         //'test' - ambiguous call to overloaded function        
}
 
Hello all!!! My question is: I use two platforms MT4 and MT5 on my copyutera. MT4 connected to the signal without any problem. But I can't connect to another signal from MT5. I have an account and the movement of funds is displayed, but there is no account number in the account, I have no signal button in the dashboard of the terminal. I rented a server, vps, I wrote that I need to migrate, but the migration button does not work. Please tell me why.
 
Anna:
Hi all !!! My question is: I use two platforms MT4 and MT5 on my copyutera. I connected to the signal from MT4 without any problem. But I can't connect to another signal from MT5. I have an account and the movement of funds is displayed, but there is no account number in the account, I have no signal button in the dashboard of the terminal. I rented a server, vps, I wrote that I need migration, but the migration button does not work. Please tell me why.

MetaTrader 5 (for the terminal's built-in virtual hosting lease) requires a 64-bit operating system.

 

on Win 10 does anyone connect local agents?

Tried connecting 2 PCs, remote agent is constantly ready-connect-ready-connecting... no jobs.

i had a look in the firewall i think there is a checkmark for Metatrader Agent , export - import agent via file sees ports and name of pc also

i suspect i need to forward ports somewhere else?

Reason: