How to read a .txt file, if it's even possible, character by character ?
Or if its not possible then by separated characters with 1 space.
Thanks but for some reason i always get error 4099.Its frustrating...
Am i doing something wrong?
Outside function declaration
int FILE=FileOpen("CHARACTER.txt", FILE_READ|FILE_BIN) ;
The file CHARACTER.txt is located in MetaTrader\experts\files and also made a copy of it into MetaTrader\tester\files just in case it doesnt regocnize it at the other location.
Your array has zero elements . . .
. . . unless you are resizing it somewhere ?
Yes you are right, i just fixed it
CHARVEKTOR[k]= StrToInteger(FileReadString( FILE, 1)) ;
I also replaced the read integer with read string because if i read integer values it sometimes gave silly values, non corresponding to what was in the text file, so readstring is better for me.
No guys it works as it is like a wonder.Since the .txt file only has numbers in it.It's purpose was only to randomize the magic number :)
If i'd use the FileReadInteger.,then it will read very weird data when it reads a space, so the
is better in my case.
Why would you ever want a random MN ?
Set a base MN for your EA then add in an additional 2 digits for the timeframe and make sure you check the Symbol() . . . doesn't this make things unique ?