Scripts: Export trade history to CSV

To add comments, please log in or register
Automated-Trading
147021
Automated-Trading  

Export trade history to CSV:

This script will export the trade history from MT5 selected between two dates. The resulting file is CSV that can be opened/imported with any spreadsheet software. Current version 1.0 does not add the takeprofit and stoploss. Any advice to improve this is welcomed.

Author: Fernando Morales

Tom Burrows
880
Tom Burrows  

Hi,

Thanks for this, very helpful. 

I use a strategy based on P&L of points and so I have added the following....

double _points = -1;
int decimals=(int)SymbolInfoInteger(_symbol,SYMBOL_DIGITS);     
                                
_points = MathAbs((open_price - close_price))*MathPow(10,decimals);
                                
if (_profit < 0) _points = _points*-1;
Fernando Morales
1460
Fernando Morales  
Tom Burrows:

Hi,

Thanks for this, very helpful. 

I use a strategy based on P&L of points and so I have added the following....

Good point. I will add the profit in points including the swap and commission.

To add comments, please log in or register