Files: how to write and read ?

 

Hi,I write data into file, then read it, But I just can write,can not read,how I can do ?

           
  int handle;

  bprice=1.3560;    
  handle=FileOpen("mo57", FILE_CSV|FILE_WRITE, ';');
    if(handle>0)
       {
         FileWrite(handle,bprice );
         FileClose(handle);
       }
           


  double value;
  handle=FileOpen("mo57",FILE_BIN);
  if(handle>0)
    {
     value=FileReadDouble(handle,DOUBLE_VALUE);
     FileClose(handle);
   }
 

I wrote an indicator where reading/writing is done.. you're welcome to download the code and apply it to your needs.

https://www.mql5.com/en/code/10102

Reason: