how can i write bid and ask every time it change into a csv file. because by my code it only write first 1 only

 
int file_handle = FileOpen(InpFileName,FILE_READ|FILE_WRITE|FILE_CSV);
      datetime curr = TimeCurrent();
      

  
      if(file_handle!=INVALID_HANDLE){
      
            if(curr >=0){
            
                  FileWrite(file_handle,curr,spread,Ask,Bid,ask_bid_diff);
                  
            }
      }
      
      FileClose(file_handle);

how can i write bid and ask every time it change into a csv file. i need EA which write to csv file all time or every time the bid and ask prices change.

Documentation on MQL5: Constants, Enumerations and Structures / Codes of Errors and Warnings / Trade Server Return Codes
Documentation on MQL5: Constants, Enumerations and Structures / Codes of Errors and Warnings / Trade Server Return Codes
  • www.mql5.com
Trade Server Return Codes - Codes of Errors and Warnings - Constants, Enumerations and Structures - MQL5 Reference - Reference on algorithmic/automated trading language for MetaTrader 5
 
Youg Chee:

how can i write bid and ask every time it change into a csv file. i need EA which write to csv file all time or every time the bid and ask prices change.

See this thread for examples

Tool to save data tick tick
Tool to save data tick tick
  • 2014.05.11
  • www.mql5.com
Good night all: I need an indicator, EA or Scripts. To save a. csv or. txt. A series of data...
 
  1. Youg Chee: how can i write bid and ask every time it change into a csv file. i need EA which write to csv file all time or every time the bid and ask prices change.

    You asked the question but that isn't what your problem is.
         How To Ask Questions The Smart Way. (2004)
              The XY Problem

  2. You are opening the file and overwriting the only line. You need to append to the file. Write to File Syntax - MQL4 programming forum

 
William Roeder #:
  1. You asked the question but that isn't what your problem is.
         How To Ask Questions The Smart Way. (2004)
              The XY Problem

  2. You are opening the file and overwriting the only line. You need to append to the file. Write to File Syntax - MQL4 programming forum

if you know mql5 code to append or to do everything please do help me by posting code here, i would really appreciate it

 
Youg Chee #: if you know mql5 code to append or to do everything please do help me by posting code here, i would really appreciate it

I gave you a link, but you couldn't bother to read it and learn.

 
William Roeder #:

I gave you a link, but you couldn't bother to read it and learn.

thanks for the reply, i found the solution