.gitignore pour MetaTrader 5

26 règles d’exclusion pour MetaTrader 5, prêtes à copier dans votre dépôt.

Plateforme de trading

Le .gitignore complet pour MetaTrader 5

# Generated by LFGitignore - https://lfgitignore.com
# Created: 2026-08-05 01:34:42 UTC
# Technologies: MetaTrader 5

### MetaTrader 5 ###
*.ex5
# For MQL4 compatibility if you also manage MT4 projects in a similar structure
*.ex4
# Log file
*.log
# Strategy Tester logs
*.slog
# FXT files (history data for testing)
*.fxt
# History data files (can be large)
*.hst
# Initialization files (often generated by tester or EAs)
*.ini
# Data files (various purposes, often temporary)
*.dat
# CSV export files (e.g., from tester reports)
*.csv
# Journal files (tester journal)
*.jrn
# Market Watch symbol sets
*.set
# Chart templates
*.tpl
# Chart settings files (can be generated when saving templates or profiles)
*.chr
# Dynamic link library
*.dll
# Environment variables (e.g., for Python integration credentials)
.env
# Configuration files (if not meant to be shared)
*.cfg
# Be careful: if you have config JSONs you *do* want to commit, add specific exceptions.
*.json
# Temporary files (e.g., ~MyScript.mq5)
*.~*
# Backup files (e.g., MyScript.mq5.bak)
*.bak
*.mqh.bak
*.mq5.bak
.mqproj
# Python compiled bytecode cache
__pycache__/
# Jupyter Notebook checkpoints
.ipynb_checkpoints/
# Python compiled files
*.pyc
# Python dynamic modules
*.pyd

Ce que ces règles MetaTrader 5 ignorent vraiment

Chaque motif ci-dessous, et pourquoi il a sa place dans votre .gitignore.

These are generated from .mq5 source files and should not be committed.

Motif Ce qu’il ignore
*.ex5 These are generated from .mq5 source files and should not be committed.
*.ex4 For MQL4 compatibility if you also manage MT4 projects in a similar structure

Terminal logs, strategy tester logs, and custom logs from Print() functions.

Motif Ce qu’il ignore
*.log Log file
*.slog Strategy Tester logs

History data, optimization results, and temporary files used by the tester.

Motif Ce qu’il ignore
*.fxt FXT files (history data for testing)
*.hst History data files (can be large)
*.ini Initialization files (often generated by tester or EAs)
*.dat Data files (various purposes, often temporary)
*.csv CSV export files (e.g., from tester reports)
*.jrn Journal files (tester journal)

User-specific lists of symbols in Market Watch, and terminal profiles.

Motif Ce qu’il ignore
*.set Market Watch symbol sets
*.tpl Chart templates
*.chr Chart settings files (can be generated when saving templates or profiles)
*.dll Dynamic link library

Files containing sensitive information or local user settings.

Motif Ce qu’il ignore
.env Environment variables (e.g., for Python integration credentials)
*.cfg Configuration files (if not meant to be shared)
*.json Be careful: if you have config JSONs you *do* want to commit, add specific exceptions.

Temporary files and backup files generated by MetaEditor

Motif Ce qu’il ignore
*.~* Temporary files (e.g., ~MyScript.mq5)
*.bak Backup files (e.g., MyScript.mq5.bak)
*.mqh.bak Temporary files and backup files generated by MetaEditor
*.mq5.bak Temporary files and backup files generated by MetaEditor

Project files for MetaEditor workspaces.

Motif Ce qu’il ignore
.mqproj Project files for MetaEditor workspaces.
__pycache__/ Python compiled bytecode cache
.ipynb_checkpoints/ Jupyter Notebook checkpoints
*.pyc Python compiled files
*.pyd Python dynamic modules

Comment utiliser ce .gitignore pour MetaTrader 5

  1. Copiez les règles MetaTrader 5 ci-dessus, ou téléchargez directement le fichier.
  2. Créez un fichier nommé .gitignore à la racine de votre dépôt Git et collez-y les règles.
  3. Si certains de ces fichiers sont déjà suivis, lancez git rm -r --cached . puis recommitez — Git n’applique les règles d’exclusion qu’aux fichiers non suivis.
  4. Commitez le .gitignore pour que toute l’équipe partage les mêmes règles.