A comprehensive template and toolkit for setting up a professional, portable MetaTrader 5 development environment with VS Code integration, automated compilation, and symbolic link management.
This repository contains battle-tested scripts, configurations, and documentation for creating a complete portable development environment that can be used for MetaTrader 5 projects and adapted for other portable application scenarios.
- π§ Portable MetaTrader 5 Setup: Complete configuration for portable MT5 installation
- π File-Level Symbolic Links: Smart symbolic link management (not folder-level)
- π₯οΈ VS Code Integration: Full IDE integration with one-click compilation
- β‘ Automated Compilation: Breakthrough solution using undocumented
/portableflag - π Comprehensive Documentation: Step-by-step guides and technical documentation
- π οΈ PowerShell Automation: Complete toolkit for project management
- π§ͺ Testing Framework: Validation scripts and testing tools
- Windows 10/11 or Windows Server
- PowerShell 5.1 or later
- Visual Studio Code
- MetaTrader 5 (portable installation)
- Administrator privileges (for symbolic link creation)
git clone https://github.com/IanIT/PortableMT5Dev.git
cd PortableMT5Dev# Run as Administrator
.\setup\Initialize-Environment.ps1# Customize for your project
.\setup\Configure-Project.ps1 -ProjectName "YourProject" -MT5Path "C:\MetaTrader 5"# Create file-level symbolic links
.\tools\CreateFileSymlinks.ps1# Open configured environment
code .PortableMT5Dev/
βββ π setup/ # Initial setup scripts
βββ π tools/ # PowerShell automation tools
βββ π templates/ # Project templates
βββ π vscode/ # VS Code configuration
βββ π documentation/ # Comprehensive guides
βββ π examples/ # Usage examples
βββ π tests/ # Validation tests
βββ π .github/ # GitHub configuration
- Complete portable installation setup
- Configuration file management
- Path resolution solutions
- File-level symbolic links (not folder-level)
- Conflict prevention with naming conventions
- Automatic link creation and validation
- Task configuration for compilation
- Status bar buttons for one-click actions
- Problem matchers for error detection
- Extension recommendations
- Breakthrough discovery: Undocumented
/portableflag - Reliable PowerShell compilation scripts
- Error handling and logging
- Output validation
β Folder-Level Symlinks (Common Approach)
- Risk of entire folder conflicts
- Difficult to manage multiple projects
- Complex path resolution issues
β File-Level Symlinks (Our Approach)
- Precise control over individual files
- Unique naming prevents conflicts
- Clean, maintainable structure
- Easy to debug and troubleshoot
- Complete isolation from system installations
- Version control over MT5 environment
- Team collaboration with consistent setups
- No registry dependencies
- Easy backup and migration
Initialize-Environment.ps1- Complete environment setupConfigure-Project.ps1- Project-specific configurationValidate-Setup.ps1- Environment validation
CreateFileSymlinks.ps1- Create file-level symbolic linksValidateSymlinks.ps1- Verify symbolic link integrityRemoveSymlinks.ps1- Clean removal of symbolic links
Compile-MQL5.ps1- Advanced compilation scriptBuild-Project.ps1- Simple build scriptTest-Compilation.ps1- Compilation validation
Setup-VSCode.ps1- VS Code configurationInstall-Extensions.ps1- Extension managementConfigure-Tasks.ps1- Task setup
Run the complete test suite to validate your setup:
# Run all tests
.\tests\Run-AllTests.ps1
# Run specific test categories
.\tests\Run-Tests.ps1 -Category "SymbolicLinks"
.\tests\Run-Tests.ps1 -Category "Compilation"
.\tests\Run-Tests.ps1 -Category "VSCodeIntegration"- MQL5 Expert Advisors
- Custom Indicators
- Trading Scripts
- Libraries and Frameworks
- Portable development environments
- Isolated testing environments
- Team collaboration setups
- Version-controlled configurations
We welcome contributions! This project benefits from community input and improvements.
- Fork the repository
- Create a feature branch (
git checkout -b feature/amazing-feature) - Commit your changes (
git commit -m 'Add amazing feature') - Push to the branch (
git push origin feature/amazing-feature) - Open a Pull Request
- Other Application Support: Extend beyond MetaTrader 5
- Platform Support: Linux/macOS adaptations
- IDE Integration: Support for other IDEs
- Language Support: Additional programming languages
- Documentation: Translations and improvements
- Testing: Additional test cases and validation
- Follow existing code style and conventions
- Add tests for new functionality
- Update documentation for changes
- Ensure all tests pass before submitting
- Portable MetaTrader 5 setup
- File-level symbolic links
- VS Code integration
- Automated compilation
- Comprehensive documentation
- Support for other portable applications
- Linux/macOS compatibility
- Additional IDE integrations
- Enhanced testing framework
- Plugin system for extensions
- Community template library
- Automated setup wizard
- Integration with CI/CD pipelines
This project is licensed under the MIT License - see the LICENSE file for details.
- MetaQuotes for MetaTrader 5 platform
- Microsoft for Visual Studio Code
- PowerShell Community for automation tools
- Contributors who helped improve this project
- Documentation: Check the documentation directory
- Issues: Report bugs and request features via GitHub Issues
- Discussions: Join the conversation in GitHub Discussions
β If this project helps you, please give it a star! It helps others discover this solution.
Made with β€οΈ by the community for the community.