//+------------------------------------------------------------------+ //| Demo.mq4 | //| Codersguru | //| http://www.forex-tsd.com | //+------------------------------------------------------------------+ #property copyright "Codersguru" #property link "http://www.forex-tsd.com" #property indicator_chart_window #include //+------------------------------------------------------------------+ //| Custom indicator initialization function | //+------------------------------------------------------------------+ int init() { int file = gFileOpen("c:\mt4.log",WRITE); //open the file writting , create it if not exist string write = "Open Price: " + Open[1] + "\r\nClose Price: " + Close[1]; //use \r\n for newline gFileWrite(file,write); //write some date gFileClose(file); //close the file file = gFileOpen("c:\mt4.log",READ); //open the file reading Alert(gFileRead(file,100)); //read 100 character gFileSeek(file,10,FILE_BEGIN); //move the file pointer 10 bytes Alert(gFileTell(file)); //get the current position of the file pointer gFileClose(file); //close the file return(0); } //+------------------------------------------------------------------+ //| Custor indicator deinitialization function | //+------------------------------------------------------------------+ int deinit() { //---- //---- return(0); } //+------------------------------------------------------------------+ //| Custom indicator iteration function | //+------------------------------------------------------------------+ int start() { return(0); } //+------------------------------------------------------------------+