PFA Merger
- 유틸리티
- Victor Paula Oberto
- 버전: 1.0
PFA Merger – Free Portfolio Position Merger Script
Introduction
PFA Merger is a free MQL5 script and an essential component of the Portfolio Analyzer (PFA) system — a unique portfolio analysis toolkit included with compatible Expert Advisors from this profile.
The PFA system allows traders to build, merge, and simulate multi-asset, multi-strategy portfolios entirely within the MT5 Strategy Tester — with no external tools required.
The three-step PFA workflow is:
PFA Exporter (built into the EA) → Exports backtest positions to individual CSV files per setup.
PFA Merger (this script — free) → Merges all exported CSVs into a single, clean, sorted file ready for simulation.
PFA Simulator (separate EA — free) → Replays the merged portfolio inside the MT5 Strategy Tester to evaluate true combined performance.
Note: PFA Merger and PFA Simulator are free and compatible with any EA from this profile that includes the PFA Exporter module.
What PFA Merger Does
After running backtests across multiple symbols and configurations, you will have a collection of individual PFA_pos*.csv files — one per setup. PFA Merger automates the entire consolidation process:
- Automatic File Discovery – Scans the Terminal/Common/Files/PFA/ folder and finds all PFA_pos*.csv files automatically.
- Multi-File Merging – Reads and combines positions from all discovered files into a single dataset.
- Chronological Sorting – Sorts all merged positions by entry timestamp, ensuring correct simulation order.
- Duplicate Removal (Optional) – When enabled, detects and removes duplicate entries (same entry timestamp + symbol) that may arise from overlapping exports.
- Header Validation – Validates each file's column structure before processing; skips malformed files gracefully.
- Detailed Log Output – Prints a per-file summary (rows read, symbols found) and a final merge report (total rows, duplicates removed, date range, symbol list).
- Single Output File – Writes the final PFA_pos_STRAT_ALL_MERGED_SORTED.csv file, ready to be loaded by the PFA Simulator.
How to Use
- Run backtests with any compatible EA with the PFA Exporter enabled for each desired symbol/configuration.
- Place all exported PFA_pos*.csv files in the Terminal/Common/Files/PFA/ folder (Common Files).
- Attach PFA Merger to any chart and run it as a script.
- Check the Experts log for the merge summary and confirmation.
- The output file PFA_pos_STRAT_ALL_MERGED_SORTED.csv is now ready for the PFA Simulator.
Parameters
| Parameter | Default | Description |
|---|---|---|
| Input folder | PFA/ | Folder inside Terminal/Common/Files/ where input CSVs are located. |
| Output filename | PFA_pos_STRAT_ALL_MERGED_SORTED.csv | Name of the merged output file. |
| Remove duplicates? | false | When set to true, it will remove duplicate positions by symbol and entry timestamp. |
What You Get
✔ PFA Merger Script – Ready to use, no configuration required for standard setups.
✔ Compatible with all PFA-enabled EAs from this profile.
✔ Completely free – no purchase required.
PFA Merger is part of the PFA system. To complete the portfolio analysis workflow, also download the free PFA Simulator EA from this profile.
🔗 SteelTrend EA: [LINK]
🔗 PFA Simulator: [LINK]
