Fileseek current going to beginning of file

 


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?

 
bonechair:


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()
 
RaptorUK:
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.
 
Ovo:
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.
 
RaptorUK:
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.

 
Ovo:

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.

Indeed, and yes, code to reproduce the issue helps either confirm it as a bug or produces and answer quicker.
 

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.

 
bonechair:

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.

It might help others help you if you post your code . . . please use the SRC button to do so.
 
bonechair: DOUBLE_VALUE is a built in defined for mq4 I think.
You THINK? You also THINK that it is defined as 8? FileWriteDouble - MQL4 Documentation
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?

 
RaptorUK:
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 . . .
Reason: