MML Data Bridge – Common Issues and Resolves
MML Data Bridge – Common Issues and Resolves Overview
This document addresses the most common issues users encounter when setting up and using MML Data Bridge, along with step-by-step solutions
1. MML Data Bridge: Struct size mismatch for ‘filename.csv’ Your struct is 404 bytes, but data file contains 528 bytes This means your struct is missing 1 field(s) or has incorrect field types
Root Cause:
Solution:
- Always use exactly ONE delimiter btween fields
- Don’t use multiple tabs or commas for padding, white spacing is OK!
- Test with small files first
- Check your data file format – ensure single delimiters only
- Verify your struct definition matches the detected schema
- Regenerate schema by deleting corresponding binary file
- Check config file for the correct field count and types
2. Time zone Conversion Problems
Symptoms:
- Data appears at wrong times in backtester
- Timezone offsets not handled correctly
Root Cause:
- MML Data Bridge uses UTC (GMT) time internally. All timestamps in binary files are stored in UTC and time comparisons against tester time happen in UTC automatically
Solution:
- Use proper ISO 8601 format with timezone: 2025-01-01T08:30:00-05:00
- Avoid local time formats without timezone info
- Test with known timezone data first
- Include timezone offset in all DateTime values
3. MML Data Bridge: Cannot open binary file (Error: 5002)
Symptoms:
- Program quits unexpectedly
- EA fails to initialize
- Binary file access errors during backtesting or optimization
Root Cause:
- Binary file doesn’t exist (CSV hasn’t been converted to binary yet)
- File is locked by another process or application
- File path is incorrect or inaccessible
- Insufficient file permissions
Solution:
- Ensure CSV files are processed first – run EA once to generate binary files before backtesting
- Close any other applications that might be accessing the files (Excel, text editors, etc.)
- Verify binary files exist in Common\Files\[EA_Name]\ directory
- Restart MetaTrader 5 if files appear locked
- If binary file is missing, delete config file and let MML Data Bridge regenerate it
4. MML Data Bridge: Binary file ‘%s’ appears corrupted or empty. Record size is invalid (%d). Please regenerate binary by updating CSV file or deleting the binary file
Root Cause:
- Binary file header contains invalid record size. File is corrupted, empty, or was created incorrectly
Solution:
- Delete the corrupted binary file from Common\Files\[EA_Name]\ directory
- Update the CSV file (make a small change and save) to trigger regeneration
- Or delete the binary file and restart EA – it will regenerate automatically
- Verify CSV file has valid data rows before regeneration
5. Data Type Detection Issues
Symptoms:
- Numbers treated as text
- Dates not recognized
- Incorrect data types in schema
Root Cause:
- If a cell contains characters other than INTS or DOUBLES, the whole column will be treated as CHARS
Solution:
- Check for mixed data types in same column
- Delete binaries and rerun to regenerate a new schema
- Ensure all values in a numeric column are numbers
- Remove any text, symbols, or formatting from numeric columns
6. DateTime Column Detection Issues
Symptoms:
- Expected datetime column shows up as Char[] in schema
- Time-based data comparison fails
- Program won’t run or produces incorrect results
- Data appears at wrong times in back tester
Root Cause:
- DateTime column contains non-ISO 8601 format data
- Mixed data types in datetime column
- Missing timezone information in datetime values
- Invalid datetime format causing schema to classify as text
Solution:
- Use proper ISO 8601 format – YYYY-MM-DDThh:mm:ssZ or YYYY-MM-DDThh:mm:ss±hh:mm. Example: 2024-07-30T16:00:00Z
- Ensure timezone information – all datetime values must have timezone
- Regenerate schema by deleting binary
- Clean datetime data – remove any non-standard formats
7. MML Data Bridge: Cannot open configuration file
Error Messages:
- MML Data Bridge: Cannot open configuration file ‘%s’ (Error: %d)
- MML Data Bridge: Expected location: Common Files\%s
Root Cause:
- Configuration file is missing, has incorrect path, or lacks read permissions
Solution:
- Verify config file exists in Common Files directory
- Check file path matches EA name folder structure
- Verify file is not locked by another process
- Check file encoding is ANSI/text
- Navigate to the Common Files directory shown in the error message
8. MML Data Bridge: Configuration file missing [Settings] header. Please check your config file format
Root Cause:
- Config file format is invalid or corrupted. The first line must be [Settings]
Solution:
- Ensure first line is exactly [Settings] (case-insensitive)
- Check for extra spaces or characters
- Verify file encoding is ANSI/text
- Ensure proper line endings
9. MML Data Bridge: Created new config file. Please add input files and rerun
Root Cause:
- Config file was just created and needs file entries
Solution:
- Open config file in text editor
- Add file entries: File1 = your_data.csv
- Save config file
- Restart EA
10. MML Data Bridge: File has invalid extension. Only .csv and .tsv files are supported
Root Cause:
- File listed in config has an unsupported file extension
Solution:
- Ensure file extension is exactly .csv or .tsv (case-insensitive)
- Rename file if it has a different extension
- Update config file with correct filename including extension
11. MML Data Bridge: The following file(s) listed in configuration were not found in the Common Files directory
Root Cause:
- File is most likely misspelled or not in the correct directory
Solution:
- Check file spelling and make sure to include file extension (.csv/.tsv) in the filename (spelling is not case sensitive)
- Use common files directory: C:\Users\[YourUsername]\AppData\Roaming\MetaQuotes\Terminal\Common\Files\
- Files should be placed directly in Common\Files\ (not in subfolders)
- Verify file exists before adding to config
12. MML Data Bridge: No valid files found in configuration
Root Cause:
- Config file has no valid file entries or all entries are invalid
Solution:
- Add file entries in format: File1 = your_data.csv
- Ensure files exist and are readable
- Verify file extensions are .csv or .tsv
- Check files are in Common Files directory
13. MML Data Bridge: File ‘filename.csv’ not found in configuration
Error Message:
- MML Data Bridge: File ‘%s’ not found in configuration
- MML Data Bridge: Please ensure file(s) are in the Common Files directory and listed in your config file
- MML Data Bridge: To fix: Add ‘FileN = filename.csv’ to your config file and restart EA
- MML Data Bridge: EA will be removed due to configuration error
Root Cause:
- Code requests a file not listed in the configuration. This occurs when your EA code calls getRecordBytes_internal() with a filename that isn’t in the config file
Solution:
- Check file location – must be in Common Files directory
- Verify filename in config file matches exactly (case-insensitive)
- Add file to config using format: FileN = filename.csv
- Restart EA after updating config
14. MML Data Bridge: Warning – CSV file ‘%s’ contains no data rows. File must have at least one data row after the header
Root Cause:
- CSV file has a header row but no data rows. Schema cannot be generated without data
Solution:
- Ensure CSV file has at least one data row after the header
- Check that data rows are not empty or whitespace-only
- Verify file was saved correctly
- Add sample data rows to test the file format
15. MML Data Bridge: ISO-8601 format error in ‘%s’ at row %d: ‘%s’. Expected format: YYYY-MM-DDThh:mm:ssZ or YYYY-MM-DDThh:mm:ss±hh:mm
Root Cause:
- Schema detection failed. File has no header row, no data rows, invalid format, or inconsistent column counts
Solution:
- Ensure file has a valid header row with column names
- Verify file has at least one data row
- Check that all rows have consistent column counts
- Verify file encoding is correct (ANSI/text)
- Ensure proper delimiter usage (single comma for CSV, single tab for TSV)
16. MML Data Bridge: ISO-8601 format error in ‘%s’ at row %d: ‘%s’. Expected format: YYYY-MM-DDThh:mm:ssZ or YYYY-MM-DDThh:mm:ss±hh:mm
Root Cause:
- DateTime value doesn’t match strict ISO-8601 format during CSV export. The value shown failed to parse
Solution:
- Use exact format: YYYY-MM-DDThh:mm:ssZ (UTC) or YYYY-MM-DDThh:mm:ss±hh:mm (with offset)
- Ensure ‘T’ separator between date and time (uppercase or lowercase both accepted)
- Include timezone: ‘Z’ for UTC or ±hh:mm for offset (e.g., -05:00 or +02:00)
- Verify all digits are present (no missing zeros)
- Example: 2024-07-30T16:00:00Z or 2024-07-30T16:00:00-05:00
17. MML Data Bridge: Warning – Row %d in ‘%s’ has %d columns, expected %d. Missing columns will be padded with empty values
Root Cause:
- CSV row has different column count than detected schema during export. Missing columns will be filled with empty/default values
Solution:
- Ensure all CSV rows have the same number of columns as the header
- Check for missing delimiters in data rows
- Verify CSV file format is consistent throughout
- Add missing columns or remove extra columns to match header
18. MML Data Bridge: Schema Mismatch – Column. File ‘%s’: Saved schema has %d cols, last line has %d cols
Root Cause:
- Data appended to a file does not match the schema generated from back tests. New CSV data row has different column count than saved schema.
Solution:
- Maintain consistent format as generated schema
- Ensure all CSV rows have same number of columns as the original schema
- Check for missing or extra delimiters in the new data row
- Count columns in the new row and match to schema
19. MML Data Bridge: Schema Mismatch – Column. File ‘%s’: Stored schema parses to %d cols, row has %d cols
Root Cause:
- Schema metadata corruption or mismatch. The stored schema definition doesn’t match the actual data row.
Solution:
- Delete binary file and config file
- Restart EA to regenerate schema from CSV
- Verify CSV file has consistent column count
- Check for schema corruption in config file
20. MML Data Bridge: Schema Mismatch – Datatype. File ‘%s’, Column %d expects DateTime; got ‘%s’
Root Cause:
- Data value in DateTime column doesn’t match ISO-8601 format. This occurs when appending new data in live mode
Solution:
- Use proper ISO 8601 format with timezone: 2025-01-01T08:30:00-05:00
- Ensure format matches: YYYY-MM-DDThh:mm:ssZ or YYYY-MM-DDThh:mm:ss±hh:mm
- Include timezone information (required)
- Example: 2024-07-30T16:00:00Z or 2024-07-30T16:00:00-05:00
21. MML Data Bridge: Schema Mismatch – Datatype. File ‘%s’, Column %d expects Int; got ‘%s’
Root Cause:
- Data value in Integer column contains non-numeric characters. This occurs when appending new data in live mode
Solution:
- Ensure value is a valid integer (no decimals, no letters)
- Remove any whitespace or formatting characters
- Check for hidden characters or encoding issues
- Example: 123 is valid, 123.0 or 123abc are invalid
22. MML Data Bridge: Schema Mismatch – Datatype. File ‘%s’, Column %d expects Double; got ‘%s’
Root Cause:
- Data value in Double column cannot be parsed as a number. This occurs when appending new data in live mode
Solution:
- Ensure value is numeric (integer or decimal)
- Use period (.) as decimal separator
- Remove currency symbols or formatting
- Example: 123.45 is valid, $123.45 or 123,45 are invalid
23. MML Data Bridge: Check config file for generated schemas and add to dataStructs.mqh to ingest data
Root Cause:
- Schema has been generated and needs to be added to your code
Solution:
- Open config file and locate [Schema] section
- Copy the DataType = … line for each file
- Add corresponding struct definition to dataStructs.mqh
- Ensure struct field order matches schema order
- Restart EA
24. MML Data Bridge: Change in data detected for ‘%s’, updating binary and verifying schema
Root Cause:
- CSV file was modified, and binary is being regenerated automatically
Solution:
- No action needed – this is automatic
- Wait for regeneration to complete
- Verify schema in config file if needed
25. MML Data Bridge: No existing metadata, initialized defaults
Root Cause:
- First run – no metadata exists yet (normal for new setup)
Solution:
- This is informational, not an error
- EA will generate metadata and binaries on first run
- Ensure CSV files are properly configured
- Wait for initialization to complete
26. MML Data Bridge: Added %d file(s) to config
Root Cause:
- New files were added to the configuration.
Solution:
- No action needed – this is informational
- Files will be processed automatically
27. MML Data Bridge: User removed %d file(s) from config, cleaning up binary
Root Cause:
- Files were removed from config and associated binary files are being cleaned up.
Solution:
- No action needed – cleanup is automatic
For all other issues visit the user set up manual
MML Data Bridge User Set Up Manual – Trading Systems – Draft – Traders’ Blogs
For more help, please contact the developer @rylanw337@gmail.com