FileWrite Help !!

 

Hello every one :

 I`ve wrote this code to export EA Report to Excel ,,, it works fine

But I wonder How to write the Information in a new column ( inside the excel sheet ) each time a new month begain

 

// in int deinit () section I wrote

if(IsTesting()==true) 
      handle=FileOpen("EA.csv",FILE_WRITEFILE_CSV,","); 
         if(handle<0) return(0); 
  // write header 
 FileWrite(handle,"open time","Order Type","Order Profit","OrderClosePrice","OrderOpenPrice");             
      int total=OrdersHistoryTotal(); 
  // write open orders 
   
      for(int pos=0;pos<total;pos++) 
      { 
        if(OrderSelect(pos,SELECT__POS, MODE_HISTORY)==false) continue; 
           
            FileWrite(handle,TimeToStr(OrderOpenTime(),TIME_DATETIME_SECONDS),OrderType(),OrderProfit(),OrderClosePrice(),OrderOpenPrice());  
      } 
      FileClose(handle);  
 
Alttear:  I`ve wrote this code to export EA Report to Excel ,,, it works fine

But I wonder How to write the Information in a new column ( inside the excel sheet ) each time a new month begain

Open the file in notepad, select all, copy. Open excel file, click on the new column, paste -> special.

 
WHRoeder:

Open the file in notepad, select all, copy. Open excel file, click on the new column, paste -> special.



Thanks for helping me but that`s wont be good
I want to test my strategy for several month and multiple step .. and this could take so much time for me

I wrote the code for excel ... but I don`t know how to Make the EA rewrite from a new column each time a new month begin ( in the same excel sheet )

Thanks again 

 
Alttear:

Hello every one :

 I`ve wrote this code to export EA Report to Excel ,,, it works fine

But I wonder How to write the Information in a new column ( inside the excel sheet ) each time a new month begain

You are writing your data to a CSV file . . . not an excel worksheet.  If you want Excel to do something different for the start of the mew month then you have to do that in Excel.
 
Thanks alot, I really Appreciate if you can help me
RaptorUK:
You are writing your data to a CSV file . . . not an excel worksheet.  If you want Excel to do something different for the start of the mew month then you have to do that in Excel.

Reason: