Saving the tick-data

 

Hello Guys,

I am trying to save the tick rates like (time stamp in secs, rate). In matlab, I have not problem in reading the doubles bytes(rate) but the longs bytes (time in sec) I get values that don't make sense.

bests

this is the script attached to the EUR/USD chart:

#include <stdlib.mqh>
int handle;
//+------------------------------------------------------------------+
//| expert initialization function                                   |
//+------------------------------------------------------------------+
int init()
  {
   
   handle=FileOpen("data.bin", FILE_BIN|FILE_WRITE|FILE_READ);
    if(handle<1)
      Comment("File could not be opened");
     

   return(0);
  }
//+------------------------------------------------------------------+
//| expert deinitialization function                                 |
//+------------------------------------------------------------------+
int deinit()
  {
//----
   FileClose(handle);
//----
   return(0);
  }
//+------------------------------------------------------------------+
//| expert start function                                            |
//+------------------------------------------------------------------+
int start()
  {
//----
  
   FileWriteDouble(handle,TimeCurrent(),LONG_VALUE);
   FileWriteDouble(handle,TimeLocal(),LONG_VALUE);
   FileWriteDouble(handle,MarketInfo("EURUSD",MODE_ASK),DOUBLE_VALUE);
   FileWriteDouble(handle,MarketInfo("AUDUSD",MODE_ASK),DOUBLE_VALUE);

   return(0);
  }
//+----------

the problem I encounter is that only one

 
ciremql4:

Hello Guys,

I am trying to save the tick rates like (time stamp in secs, rate). In matlab, I have not problem in reading the doubles bytes(rate) but the longs bytes (time in sec) I get values that don't make sense.

bests

this is the script attached to the EUR/USD chart:

the problem I encounter is that only one

Time is give as the number of seconds since 1 Jan 1970 . . : https://docs.mql4.com/dateandtime "A group of functions providing the working with data of the datetime type (integer representing the amount of seconds elapsed from midnight, 1 January, 1970)."
 
RaptorUK:
Time is give as the number of seconds since 1 Jan 1970 . . : https://docs.mql4.com/dateandtime "A group of functions providing the working with data of the datetime type (integer representing the amount of seconds elapsed from midnight, 1 January, 1970)."

I wnat to save the data in binary format for faster proccessing. I think is a long integer, suppose to be 8 bytes that why I used LONG_VALUE?
 
FileWriteInteger(handle, MarketInfo(MODE_TIME),LONG_VALUE); 
 
LONG_VALUE is 4 bytes long
Reason: