2,1 KiB
2,1 KiB
📊 Crystal Data Extractor — MT5
By Crystal AI Systems | MQL5 Profile
Export Tick or OHLC market data to a clean comma-separated CSV file — directly from MetaTrader 5.
✅ Features
- Two modes: Tick Data (Bid/Ask/Last) or OHLC Bars (Open/High/Low/Close/Volume/Spread)
- Works on live charts AND Strategy Tester
- Proper CSV format — opens correctly in Excel (no column merging)
- Historical OHLC dump on startup (configurable lookback)
- Auto-named files with symbol + timeframe
- Optional file prefix for organizing multiple runs
📁 File Locations
Live Chart:
File > Open Data Folder > MQL5 > Files > XAUUSD_M15_OHLC.csv
Strategy Tester:
File > Open Data Folder > Tester > [AgentID] > Agent-127.0.0.1-3000 > MQL5 > Files
⚠️ Tester files are NOT in the main MQL5\Files folder!
⚙️ Input Parameters
| Parameter | Description |
|---|---|
| Data Mode | TICK = raw tick data / OHLC = closed candle bars |
| Timeframe | Used in OHLC mode only |
| Lookback Bars | Historical bars dumped on startup (0 = disabled) |
| File Prefix | Optional label added to filename |
📄 CSV Columns
Tick mode: Time, Bid, Ask, Last, TickCount
OHLC mode: Time, Open, High, Low, Close, Volume, Spread
🚀 How to Use
- Copy
Crystal_DataExtractor.mq5to your MT5MQL5\Experts\folder - Compile in MetaEditor (F7)
- Attach to any chart (e.g. XAUUSD M1)
- Set your preferred Data Mode and Timeframe in Inputs
- CSV file is created automatically in
MQL5\Files\
Strategy Tester Tip:
Set the Tester chart TF lower than your OHLC input TF. Example: Want H1 OHLC? Run tester on M1 or M5. Use "Every tick" model for best accuracy.
📂 File Naming
| Mode | Filename |
|---|---|
| OHLC | XAUUSD_M15_OHLC.csv |
| Tick | XAUUSD_Ticks.csv |
| With prefix | Test1_XAUUSD_M15_OHLC.csv |
📜 License
Free to use and modify. Credit appreciated. © Crystal AI Systems — jawadtrader22