How to get the price data from Trading platform to Excel?

 

Hello,

when trading day is over I sometimes need to analyze past data and look at them in detail (in order to improve my trading approaches).

The way I am doing it now is, in fact, bloody. I am letting my trading platform list the prices for specified period of time like...

int start()

     {
       for(int i=1440; i>=0; i--)
          Alert(TimeHour(Time[i]), ":", TimeMinute(Time[i])," ... ", Low[i]);            // Alert: Observed time ... Requested price  
       return;

     }

which results in the output like...



... and then manually retyping displayed data into Excel (where I can do many more operations and statistical tests with the data).

Pls, is there / do you know some simpler method of transferring data from the trading platform to Excel?


Note:

Sometimes I even collect and store individual ticks into an array.

I can display data in the same way as above, but then I have to retype it to Excel again for detailed testing.

It would be great if there is some faster method of transfer into a file (e.g. txt) or directly to Excel.

Thanks in advance for suggestions...

 
 
RaptorUK:
Take a look here: https://www.mql5.com/en/forum/106972


Oh, RaptorUK, thanks for the hint!!!

Fortunately I grasped the file function and easily modified my program into...

int start()
  {
   
   int handle, bars=900;   
   handle=FileOpen("DataReport.csv",FILE_WRITE|FILE_CSV);

   FileWrite(handle,"HOUR",":","MINUTE","...","LOW","HIGH","CLOSE");
   for(int i=bars; i>=1; i--)
       FileWrite(handle, TimeHour(Time[i]), ":", TimeMinute(Time[i]), " ... ", Low[i], High[i], Close[i]);
   FileClose(handle);
   Alert("Finished!      See data located in \\experts\files\DataReport.csv");   
      
   return;
  }

... so now it is doing exactly what I need! And analogically with individual ticks!

What a help for me! Amazing! Thank you!!!!

 
Sidewinder:


Oh, RaptorUK, thanks for the hint!!!

Fortunately I grasped the file function and easily modified my program into...

... so now it is doing exactly what I need! And analogically with individual ticks!

What a help for me! Amazing! Thank you!!!!

Good to hear, well done :-)
 
Sidewinder:
... and then manually retyping displayed data into Excel
Click on bottom line, scroll up, shift click on the top line, right click -> copy. Excel: Paste
 
WHRoeder:
Click on bottom line, scroll up, shift click on the top line, right click -> copy. Excel: Paste

I tried but it did not work...

I don't know what I did wrong.

 
  1. Works fine. Try paste-special.
  2. Neither do I