Errors, bugs, questions - page 2647

 

Now in MetaEditor when working on a project to move the project files in the "Project" tab, for example to a newly created subfolder, a whole "ritual" has to be performed:

- make sure that all changes made to the files to be moved have been saved, otherwise the work done may be lost;
- drag and drop the files in the "Project" tab to the new location;
- close any tabs on the files being migrated, as they are using an invalid path;
- re-open any closed tabs, only now using the new path.
- rearrange the open tabs in the same order as before they were closed.

Suggestion:
When moving project files in the Project tab, e.g. to a newly created subfolder:
- for open but unchanged files, automatically update their location path.
- for modified files, additionally ask for confirmation: "Transfer with saving", "Transfer with loss of changes", or "Cancel transfer operation".


 
Igor Makanu :

I have 12GB of memory, Windows 10 , free memory about 8GB


I needed this test to find out the maximum allowed line lengths in MT4/MT5 terminals

I now want to exchange between terminals via the Redis database

Redis is a very simple database and works only with strings (key - value --> strin - string)

Yesterday I've serialized POD structures in Base64 and it increases data size by about 1/3

I think that even in this case I have a possibility to exchange structures with size 400 Mb per transaction - that's more than enough for any purpose! ;)

I wonder if I will check this "Redis", I don't know that.

So I checked your code on my side, I stopped it after 1 minute, too slow. So I changed it a bit ;-)

#define  STEP      1000000     // 1 million
#define  MILLION   1000000
//+------------------------------------------------------------------+
//| Script program start function                                    |
//+------------------------------------------------------------------+
void OnStart()
  {
  printf("m_physical = %i MB, m_total = %i MB, m_available = %i MB, m_used = %i MB, limit = %i MB, used = %i MB",
         TerminalInfoInteger(TERMINAL_MEMORY_PHYSICAL), TerminalInfoInteger(TERMINAL_MEMORY_TOTAL),
         TerminalInfoInteger(TERMINAL_MEMORY_AVAILABLE), TerminalInfoInteger(TERMINAL_MEMORY_USED),
         MQLInfoInteger(MQL_MEMORY_LIMIT),MQLInfoInteger(MQL_MEMORY_USED));

  string s = "";
  int size=INT_MAX;

  do
    {
    size-=STEP;
    }
  while(!StringInit(s,size,USHORT_MAX));

  long length = StringLen(s);
  printf("StringLen = %lli millions characters, m_used = %i MB, used = %i MB", length/MILLION, TerminalInfoInteger(TERMINAL_MEMORY_USED),MQLInfoInteger(MQL_MEMORY_USED));
  }

2020.02.13 15: 50: 51.199 1111R-2646 (EURUSD, M1) m_physical = 16230 MB, m_total = 32460 MB, m_available = 31786 MB, m_used = 674 MB, limit = 8388608 MB, used = 0 MB
2020.02.13 15: 50: 51.763 1111R-2646 (EURUSD, M1) StringLen = 1073 million characters, m_used = 2722 MB, used = 2048 MB

Less than 1 second. Finally, there is the mql5 limit, which is 2GB or about 1.073 billion characters.

 

Explain why ico-files cannot be loaded into the codebase? They are a standard part of the program, connected by MQL tools. The fact that they are banned is obviously wrong. But it goes further than that.

A properly prepared ico can be renamed into png without affecting operation: it is still properly linked into the program (using #property icon "mql5pack.png") and displayed in the properties dialog. But all this only works locally. I uploaded such png to codebase and got error when checking source:

mql5pack.mq5(27,11) : error 341: cannot open icon file 'mql5pack.png'
main file not found

Please mql5 administration to fix loading or/and at least checking icons.

PS. Correction, it looks like the site silently eats the png file, i.e. gives it to upload, but then it is not in the list of compiled files. I've tried MQL5\Images, MQL5\Files - nothing is uploaded to the server but silently, without any errors. It gives an error during checking.

 
Can you tell me how to get around a compilation error?
struct STRUCT
{
  static const int Array[];
  int Array2[sizeof(STRUCT::Array)]; // unresolved static variable 'STRUCT::Array'
};

static const int STRUCT::Array[] = {1, 2};

void OnStart()
{
  static const int Array[] = {1, 2};
  
  int Array2[sizeof(Array)]; // OK
}
 

Folks, how do I make sure that in mt5 open orders do not swap places?

 
Сергей Проценко:

Folks, how do you make sure that open orders don't swap places?

I'm sorry, how do they swap places?

 
Сергей Таболин:

I'm sorry, how do they swap places?

Depending on the profit, if the profit is bigger, moves down, the other order has bigger profit, swap places. If the euro profit becomes bigger than the gold profit, the euro order will be lower and the gold order will be higher than it.
 
Сергей Проценко:
Depending on the profit, if the profit is higher, move down, the other order has a higher profit, swap places.

Click on one of the column headers: Symbol, Ticket, Time

 
Vladimir Karputov:

Click on the header of one of the columns: Symbol, Ticket, Time

This is the only result.
 
Сергей Проценко:
This is the only result.

Click on the header of one of the columns: Symbol, Ticket, Time.

Click on LEFT KEY. Click on the TITLE.