//+------------------------------------------------------------------+ //| test.mq5 | //| Copyright 2011, MetaQuotes Software Corp. | //| http://www.mql5.com | //+------------------------------------------------------------------+ #property copyright "Copyright 2011, MetaQuotes Software Corp." #property link "http://www.mql5.com" #property version "1.00" //+------------------------------------------------------------------+ //| Expert initialization function | //+------------------------------------------------------------------+ int handle=INVALID_HANDLE; int OnInit() { //--- //handle=FileOpen("hello.csv",FILE_WRITE|FILE_CSV);//ok handle=FileOpen("hello.csv",FILE_READ|FILE_CSV);//failed open the file and delete it if(handle==INVALID_HANDLE) { Print("Error!"); } else Print("Succeed!"); //--- return(0); } //+------------------------------------------------------------------+ //| Expert deinitialization function | //+------------------------------------------------------------------+ void OnDeinit(const int reason) { //--- FileClose(handle); } //+------------------------------------------------------------------+ //| Expert tick function | //+------------------------------------------------------------------+ void OnTick() { //--- //FileWrite(handle,TimeCurrent()); }