I open a file with handle right then this happens
FileSeek(handle, DOUBLE_VALUE, SEEK_CUR);
Price = FileReadDouble(handle);
The Price that I get here on backtesting is correct but once I go and test it on live trading the filereadDouble returns a number from the beginning of the file and not the SEEK_CUR
Anybody ever had this problem?
How can you seek to a position in your file based on a double value ? how do you get to a position based on a fraction of a byte ? Please read the documentation --> FileSeek()
I think you should correct your post, Raptor. There is no double in his code. He skips 8 bytes.
Ah I see, DOUBLE_VALUE is a constant . . . can't see it defined anywhere but MetaEditor knows it.
I am not surprised, as there are so many garbage posts here, that a serious question remains undetected :)
But OP should supply a code for reproducing the issue, I never had trouble with setting the file pointers.
I am not surprised, as there are so many garbage posts here, that a serious question remains undetected :)
But OP should supply a code for reproducing the issue, I never had trouble with setting the file pointers.
Look I dont understand this so well. I load it up and it returns the correct price on strategy tester running it slowly and that but when I load it on a live trading then I get price from the beginning of the file .hst and Im using
SEEK_CUR And how can it go for beginning. I dont understand these functions. DOUBLE_VALUE is a built in defined for mq4 I think.
Look I dont understand this so well. I load it up and it returns the correct price on strategy tester running it slowly and that but when I load it on a live trading then I get price from the beginning of the file .hst and Im using
SEEK_CUR And how can it go for beginning. I dont understand these functions. DOUBLE_VALUE is a built in defined for mq4 I think.
size | - | Optional format flag. It can be any of the following values: DOUBLE_VALUE (8 bytes, default) FLOAT_VALUE (4 bytes). |
It's an enumeration. It's VALUE could be anything.
Why are you trying to skip a single double? Why don't you just read it and ignore it?
Ive got this code from a Russian coder but Im new to fileseek and filewrite and want to know how it works. So Im not sure about double_value but the point is that strategy tester spits out current value but that darn
live trading spitting out begginging of file current values. When you live maybe its not saved as a row and you cant do seek_cur or what? What does seek_cur get there, the open price or what, I dont understand precision number with floating point?
It might help others help you if you post your code . . . please use the SRC button to do so.
Show your code if you want specific help . . .

- Free trading apps
- Over 8,000 signals for copying
- Economic news for exploring financial markets
You agree to website policy and terms of use
I open a file with handle right then this happens
FileSeek(handle, DOUBLE_VALUE, SEEK_CUR);
Price = FileReadDouble(handle);
The Price that I get here on backtesting is correct but once I go and test it on live trading the filereadDouble returns a number from the beginning of the file and not the SEEK_CUR
Anybody ever had this problem?