Met a cool advisor - don't be an idiot, check IT out!!

Met a cool advisor - don't be an idiot, check IT out!!

8 February 2026, 00:03
Sergey Porphiryev
2
12
📅 Shift Dates Scripts – User Manual

⚠ Important: Beware of Fake Backtest Manipulation

Unfortunately, there are fraudulent schemes in which developers embed hidden logic into Expert Advisors that allows them to control when the EA trades in the past.

Such manipulation can selectively enable or disable trading for specific historical periods in order to create an artificially impressive backtest history.

This makes the strategy appear highly profitable in the Strategy Tester — while in reality, the performance is not genuine.

The good news: this type of manipulation is very easy to detect if you know what to check.

By shifting historical data to another time period (while preserving weekday structure), you can immediately verify whether the EA truly adapts to market conditions or simply relies on hardcoded date filters.

The scripts provided below allow you to perform this verification safely and independently.

📌 Overview

These scripts allow you to shift dates in MQL5 CSV files (both Bars and Ticks formats) by a specified number of weeks while preserving the day of the week.

This is extremely useful for backtesting and historical data analysis when you need to move data into another time period.

✨ Key Features

  • Supports Bars (OHLC) and Ticks (Bid/Ask) formats
  • Shifts by weeks (Monday → Monday)
  • Supports forward and backward shifts
  • Handles large files (>3GB)
  • Progress bar for long operations
  • Automatic format detection
  • Preserves encoding and line endings

📦 Available Scripts

🐍 Python Version

  • shift_dates_en.py

🖥 PowerShell Version (Windows)

  • shift_dates_en.ps1 – check in comment

🚀 Batch Launcher

  • shift_dates_en.batcheck in comment

⚙ Requirements

Python

  • Python 3.x
  • No external packages required

PowerShell

  • Windows PowerShell 5.1 or PowerShell 7+
  • No additional modules required

▶ Usage

Python

Basic:

python shift_dates_en.py

With file argument:

python shift_dates_en.py filename.csv

PowerShell

.\shift_dates_en.ps1

.\shift_dates_en.ps1 filename.csv


📄 Supported File Formats

Bars (OHLC)

<DATE> <TIME> <OPEN> <HIGH> <LOW> <CLOSE> <TICKVOL> <VOL> <SPREAD> 2020.01.02 01:00:00 1517.97 1521.37 1517.95 1518.41 3598 0 2

Ticks (Bid/Ask)

<DATE> <TIME> <BID> <ASK> <LAST> <VOLUME> <FLAGS> 2026.02.05 01:00:00.523 4965.59 4968.23 6

The script automatically detects the format from the header.


🧠 How It Works

  1. File Detection – Searches for CSV files (excluding *_shifted.csv)
  2. Selection – Auto or interactive selection
  3. Format Detection – Detects Bars or Ticks
  4. Date Processing – Uses timedelta(weeks=N)
  5. Output – Creates new file with suffix _shifted.csv

📊 Performance

  • <100MB: Seconds
  • 1–3GB: Minutes (with progress bar)
  • >3GB: Optimized buffering (1MB chunks)

📌 Common Use Cases

  • Backtesting different time periods
  • Year-over-year comparison (shift by 52 weeks)
  • Data alignment between sources
  • Avoiding weekend distortions

⚠ Limitations

  • Only supports YYYY.MM.DD
  • PowerShell version may struggle with >2GB
  • Week-based shifts only
  • One file at a time

💡 Tips

  • Always backup original files
  • Test on small file first
  • Use Python for large files
  • Verify output before importing to MT5


Files: