Any questions from newcomers on MQL4 and MQL5, help and discussion on algorithms and codes - page 1134
You are missing trading opportunities:
- Free trading apps
- Over 8,000 signals for copying
- Economic news for exploring financial markets
Registration
Log in
You agree to website policy and terms of use
If you do not have an account, please register
FILE_SHARE_READ
128
Shared read access by multiple programs. This flag is used when opening files (FileOpen()), but does not replace the need to specify FILE_WRITE and/or FILE_READ when opening a file
It does not. And in general, it's better not to open and close the file on every tick
It allows shared reads, not shared readsHow do I replace the Sleep(500) function in the indicator?
If you really need it, make your own pause that counts processor tick times in milliseconds. It will pause, but the whole thread will be waiting.
Why declare variable "time" if it is not used in "FileWrite"? If you don't declare it: the compiler will swear, but what is the point?
THIS WHAT?????
Maybe remove that line altogether and see?
THIS IS WHAT?????
Maybe remove that line altogether and see?
It says so in the Help: https://www.mql5.com/ru/docs/dateandtime/timelocal
Call without parameters
datetimeTimeLocal();
This is what it says in the Help file: https://www.mql5.com/ru/docs/dateandtime/timelocal
Called without parameters
datetimeTimeLocal();
FileOpen
The function opens a file with specified name and specified flags.
intFileOpen(
stringfile_name,//file name
intopen_flags,// combination of flags
shortdelimiter='\t',// delimiter
uintcodepage=CP_ACP//codepage
);
And this is how fileopen is written. This is not an example of how to write it in a program, but an indication of the type of the return value.
It makes sense to assign the time variable to the local computer time in oninit and this will be the start time of the EA)))The result prints -0.1299999999999999. Why?
Features of storing real numbers in computer memory.
Use DoubleToString() to output with the desired accuracy
In general, you should learn the basics, and then try to write programs.