Data Sources and Excel
To make statistical calculations we need to get some data. For the 5 minutes timeframe i will use data exported from the history center of the meta trader.
I will use the last 3 months of data for each pair, here is a piece of data for the gbpusd pair:
| 2010.11.18 | 20:20 | 1.60325 | 1.6034 | 1.60286 | 1.60328 | 212 |
| 2010.11.18 | 20:25 | 1.6033 | 1.60367 | 1.60305 | 1.6033 | 206 |
| 2010.11.18 | 20:30 | 1.60326 | 1.60362 | 1.60325 | 1.60341 | 213 |
| 2010.11.18 | 20:35 | 1.60344 | 1.60348 | 1.60316 | 1.60345 | 197 |
| 2010.11.18 | 20:40 | 1.60344 | 1.60387 | 1.60344 | 1.60387 | 205 |
| 2010.11.18 | 20:45 | 1.6039 | 1.60467 | 1.60364 | 1.60453 | 189 |
| 2010.11.18 | 20:50 | 1.60453 | 1.60465 | 1.60413 | 1.60462 | 237 |
| 2010.11.18 | 20:55 | 1.60468 | 1.60482 | 1.60382 | 1.60434 | 285 |
| 2010.11.18 | 21:00 | 1.60438 | 1.6047 | 1.60435 | 1.6047 | 153 |
| 2010.11.18 | 21:05 | 1.60469 | 1.60491 | 1.60403 | 1.60426 | 221 |
| 2010.11.18 | 21:10 | 1.60424 | 1.60425 | 1.60387 | 1.60394 | 129 |
And here the same period for the euro usd:
| 2010.11.18 | 20:20 | 1.36205 | 1.36206 | 1.36139 | 1.36163 | 175 |
| 2010.11.18 | 20:25 | 1.36165 | 1.36222 | 1.36146 | 1.36211 | 109 |
| 2010.11.18 | 20:30 | 1.36211 | 1.36281 | 1.36211 | 1.36272 | 128 |
| 2010.11.18 | 20:35 | 1.36277 | 1.36335 | 1.36272 | 1.36315 | 168 |
| 2010.11.18 | 20:40 | 1.36315 | 1.36341 | 1.36294 | 1.36341 | 120 |
| 2010.11.18 | 20:45 | 1.36335 | 1.36405 | 1.36321 | 1.36371 | 196 |
| 2010.11.18 | 20:50 | 1.36367 | 1.36382 | 1.36316 | 1.36345 | 193 |
| 2010.11.18 | 20:55 | 1.36349 | 1.36354 | 1.3629 | 1.36335 | 197 |
| 2010.11.18 | 21:00 | 1.36341 | 1.36352 | 1.3631 | 1.36335 | 158 |
| 2010.11.18 | 21:05 | 1.36335 | 1.36404 | 1.36335 | 1.3635 | 132 |
| 2010.11.18 | 21:10 | 1.36349 | 1.3635 | 1.36334 | 1.36336 | 53 |
I am interested in the date, the time and the closing price for each candle which is the 6th column(F in excel).
So exporting the last 3 months will end in 2 csv files with aprox 15000 lines. One big problem i faced is that sometimes one of the sources haves missing data, so i had to make the tedious task of fix the errors, witch they are a lot for some pairs. Helping me with excel i was able to make this task a little quicker.
Excel will be my main tool as statistician, we will get out at least for now from the mql programming language field and use excel built in statistical functions to make our lifes easier.
Tags: csv, excel, meta trader, mql, pairs trading








