Errors, bugs, questions - page 650

 
Rosh:
Write to Service Desk with all the details (attach an expert if necessary). It will be quicker.
Ok. I will do it for sure today. But I will ask you a couple of questions for general development anyway. :)
mql5:
You may be using a large size of local function variables, e.g. arrays.
In the next build, for 32-bit terminal, you can control the stack size with the corresponding compiler property #property stacksize

Is it an issue of 32-bit terminals only? I have x64. How do I understand "...large size of local function variables, e.g. arrays..."? "? How big should it be for the stack to get overflowed in the end?
 
tol64:
Is this only a problem with 32 bit terminals? I have x64. How do I understand "...large size of local function variables, e.g. arrays... "? How big should it be for the stack to end up overflowing?
No, it's not only a 32-bit terminal's problem. But the solution for the 32-bit terminal is ready for now, while in the 64-bit one it is still limited by a stack limit of 256Kb.
But if the programmer does not specify the needed stack size manually using a property, the EX5 in the terminal will work with the default stack size ( 256Kb).

About the big size.
Each variable declaration inside a function (except for static variables) allocates space on the stack, and allocation of space on the stack for local variables occurs at each call.

Therefore, if a function has 64Kb local variables, stack space is enough for 3 calls nested within it, and stack overflow occurs at 4 calls (as part of the stack is used for internal needs of the terminal). Therefore, if there is a need for large local data, it is better to use dynamic memory - when you enter the function, memory for local needs is allocated in the system (new, ArrayResize) and when you exit the function, memory is deleted (delete, ArrayFree).
 

Hello!

I cannot understand this problem.

filehandle=FileOpen("My\\Symbols.txt",FILE_READ|FILE_TXT|FILE_ANSI);

It works fine in debugging, the file is readable in MT5\MQL5\File\.

When running in the tester, it says "Symbols.txt file could not be opened, error 5004" and Handel -1

I have also tucked it into the MT5\tester\agent000\MQL5\File folder, but it does not see it again and kills the file there at all).

At the same time, the description says:

"The file is opened in the folder of the client terminal in subfolder MQL5\files (or folder_agent_testing\MQL5\files in case of testing)".

"The function searches for a file in the local folder (MQL5\Files or MQL5\Tester\Files in case of testing)."

I don't have "MQL5\Tester\Files"folderlike it says in Help?

What am I doing wrong and how can I overcome this problem?

Thank you for your reply.

 

Try using #property tester_file:

#property tester_file "My\\Symbols.txt"
 
Rosh:

Try using #property tester_file:

Ugh-uh-x It seemed to help in the MT5\tester\agent000\MQL5\File put in again, then it works with the property.

Thank you!

 
Fia:

Tried the tester again with Handle -1 and error 5004.

I don't know what else it could be, it obviously can't find the file, but it can see everything when debugging.

Copy the file to MQL5\Tester\Files ( create a folder beforehand).
Документация по MQL5: Файловые операции / FolderCreate
Документация по MQL5: Файловые операции / FolderCreate
  • www.mql5.com
Файловые операции / FolderCreate - Документация по MQL5
 
uncleVic:
Copy the file to MQL5\Tester\Files ( create a folder beforehand).

I tried, created such folders manually, put my file (with subfolder, disabled #property tester_file), it does not find it in the tester in any way.

And if you connect #property tester_file, it works strangely enough.

However, from time to time he crashes a folder and a file in MT5\tester\agent000\MQL5\File, probably due to the fact that if you disable #property tester_file he cracks everything there.

Yes, now I found out that if I change code (anywhere) in mq5 file (from which txt is called), then compile it and go to tester, it cracks everything in MT5\tester\agent000\MQL5\File

It's a miracle, but at least it works - and that's good.

 
Fia:

I tried, created such folders manually, put my file (with subfolder, disabled #property tester_file), it does not find it in the tester in any way.

And if you connect #property tester_file then strangely enough it works.

However, from time to time he crashes a folder and a file in MT5\tester\agent000\MQL5\File, probably due to the fact that if you disable #property tester_file he cracks everything there.

Yes, now I found out that if I change code (anywhere) in mq5 file (from which txt is called), then compile it and go to tester, it cracks everything in MT5\tester\agent000\MQL5\File

It's a miracle, but at least it works, and that's good.

If W7, put the file in directory Document and Setting/.../MetaQuotes/Common/Files, or disable UAC

PS again check correctness of spelling of name, on what layouts name is written down (better certainly copy), availability of space at the end of name and so on.

 
Urain:

If W7, put the file in Document and Setting/.../MetaQuotes/Common/Files, or disable UAC

PS again check correctness of spelling of name, on which layouts the name is written (it is better to copy), presence of a space at the end of name and so on.

Really I have Win7 64bit, but UAC is zero.

C:\Documents and Settings\All Users\MetaQuotes\Terminal\Common\Files\ I put my folder and file there, didn't help, doesn't find the file in the tester.

Yes, I think everything is correct with the name, at #property tester_file in the test works (and on the debugging works on any ), but in the tester no way, except as only through #property tester_file.

And with the above mentioned problem of killing the file after changing and compiling mq5 (I have such a layout).

 

You have a blatant lie written in your help:

CLBufferWrite

Writes an array to the OpenCL buffer.

CLBufferWrite(
intbuffer//handle to OpenCL buffer
const void&data[]// array of values
uintoffset=0// from which element, default is from the first one
voidsize=WHOLE_ARRAY// number of values, the whole array by default
);

Parameters

......

offset

.....

size

[in] The number of values to be written. By default, all values of the array are written into the OpenCL buffer.

......

It actually writes the number of bytes (!!!), not the values at all.

I spent two nights debugging the indicator, until I figured it out! And why? - Because I believed in your writing...

FIX IT NOW !!! :))

// Didn't figure it out in time, because the default ( size=WHOLE_ARRAY) works correctly.

Reason: