Export Trade History
- Yardımcı programlar
- Yasheng Yiming
- Sürüm: 1.5
Trade History Export:
The EA retrieves all historical orders using the OrdersHistoryTotal() and OrderSelect() functions.
For each order, the following details are exported:
Index: Sequential number of the trade.
Order Ticket: Unique identifier of the order.
Symbol: Trading instrument (e.g., EURUSD).
Lot Size: Volume of the trade.
Open Time: Time when the trade was opened.
Trade Type: Buy or Sell.
Open Price: Price at which the trade was opened.
Close Time: Time when the trade was closed.
Close Price: Price at which the trade was closed.
Take Profit: Take profit level of the trade.
Stop Loss: Stop loss level of the trade.
Profit: Profit or loss of the trade.
Comment: Additional comments or notes associated with the trade.
Exporting Trade History:
The EA opens the CSV file for writing.
A header row is written to the file, containing the column names.
The EA iterates through all historical orders and writes their details to the file.
After writing all orders, the file is closed.
Termination:
Once the export is complete, the EA removes itself from the chart.
Attach the EA:
Attach the EA to any chart in the MT4 platform.
Customize Inputs (Optional):
Modify the FilePrefix or Delimiter inputs if needed.
Run the EA:
The EA will automatically export the trade history and then remove itself from the chart.
Check the Output:
The CSV file will be saved in the MQL4/Files directory of your MT4 installation.
Open the file using a text editor or spreadsheet software (e.g., Excel).
This EA is a simple and practical tool for traders who need to analyze their trade history outside the MT4 platform. If you have any further questions or need additional features, contact me !
-GoldenMen
