A Python tool to automatically download historical forex (FX) data from HistData.com. This tool supports downloading 1-minute timeframe data for multiple currency pairs.
- Automated download of forex historical data
- Supports multiple currency pairs (configurable in
config.py
) - Downloads 1-minute timeframe data
- Automatic extraction of downloaded ZIP files
- Retry mechanism for failed downloads
- Detailed download progress and error reporting
- Failed downloads tracking for later retry
- Also repeats
- Python 3.6+
- Chrome browser (for Selenium WebDriver)
- Required Python packages (install using requirements.txt)
- Clone this repository
- Install required packages:
pip install -r requirements.txt
Edit config.py
to set:
- Currency pairs (PAIRS)
- Year (YEAR)
- Timeframe (default is M1 - 1 minute)
Default currency pairs:
- EURUSD
- GBPJPY
- USDJPY
- AUDUSD
- GBPUSD
Run the script using:
python main.py
The script will:
- Create necessary directories (data/ and downloads/)
- Download data for each configured currency pair
- Extract downloaded files to pair-specific folders
- Track and report any failed downloads
data/
- Extracted data files organized by currency pairdownloads/
- Downloaded ZIP filesconfig.py
- Configuration settingsdownloader.py
- Download functionalityextractor.py
- ZIP extraction functionalitymain.py
- Main scriptfailed_downloads.txt
- List of failed downloads (created if needed)
- The script will retry failed downloads up to 3 times
- Failed downloads are logged to
failed_downloads.txt
- Detailed error messages are displayed during execution
- Downloads are performed using Selenium WebDriver
- The tool navigates HistData.com automatically
- Downloads may take some time depending on file sizes and internet connection
- Some IP addresses might be rate-limited by HistData.com