.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-09-17 18:11:20 UTC
# Technologies: MetaTrader 5

### MetaTrader 5 ###
*.ex5
*.ex4
# Log file
*.log
*.slog
*.fxt
*.hst
*.ini
*.dat
*.csv
*.jrn
*.set
*.tpl
*.chr
# Dynamic link library
*.dll
# Environment variables
.env
*.cfg
*.json
*.~*
# Backup file
*.bak
*.mqh.bak
*.mq5.bak
.mqproj
# Python bytecode cache directory
__pycache__/
.ipynb_checkpoints/
*.pyc
*.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.

For MQL4 compatibility if you also manage MT4 projects in a similar structure

Motif Ce qu’il ignore
*.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

Strategy Tester logs

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

FXT files (history data for testing)

Motif Ce qu’il ignore
*.fxt FXT files (history data for testing)

History data files (can be large)

Motif Ce qu’il ignore
*.hst History data files (can be large)

Initialization files (often generated by tester or EAs)

Motif Ce qu’il ignore
*.ini Initialization files (often generated by tester or EAs)

Data files (various purposes, often temporary)

Motif Ce qu’il ignore
*.dat Data files (various purposes, often temporary)

CSV export files (e.g., from tester reports)

Motif Ce qu’il ignore
*.csv CSV export files (e.g., from tester reports)

Journal files (tester journal)

Motif Ce qu’il ignore
*.jrn Journal files (tester journal)

Market Watch symbol sets

Motif Ce qu’il ignore
*.set Market Watch symbol sets

Chart templates

Motif Ce qu’il ignore
*.tpl Chart templates

Chart settings files (can be generated when saving templates or profiles)

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

Environment variables (e.g., for Python integration credentials)

Motif Ce qu’il ignore
.env Environment variables

Configuration files (if not meant to be shared)

Motif Ce qu’il ignore
*.cfg Configuration files (if not meant to be shared)

Be careful: if you have config JSONs you *do* want to commit, add specific exceptions.

Motif Ce qu’il ignore
*.json Be careful: if you have config JSONs you *do* want to commit, add specific exceptions.

Temporary files (e.g., ~MyScript.mq5)

Motif Ce qu’il ignore
*.~* Temporary files (e.g., ~MyScript.mq5)

Backup files (e.g., MyScript.mq5.bak)

Motif Ce qu’il ignore
*.bak Backup file
*.mqh.bak Backup files (e.g., MyScript.mq5.bak)
*.mq5.bak Backup files (e.g., MyScript.mq5.bak)

Project files for MetaEditor workspaces.

Motif Ce qu’il ignore
.mqproj Project files for MetaEditor workspaces.

Python compiled bytecode cache

Motif Ce qu’il ignore
__pycache__/ Python bytecode cache directory

Jupyter Notebook checkpoints

Motif Ce qu’il ignore
.ipynb_checkpoints/ Jupyter Notebook checkpoints

Python compiled files

Motif Ce qu’il ignore
*.pyc Python compiled files

Python dynamic modules

Motif Ce qu’il ignore
*.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.