Popular results
Position Sizer
Calculate risk-based position size directly in your MetaTrader platform and execute a trade in one click or a press of a button.What Is Forex
Learn what Forex is and how it works from this simple explanation.Supertrend
Download the Supertrend indicator for MT4 and MT5 to detect trend changes based on the price action.Position Size Calculator
Calculate your position size based on risk, stop-loss, account size, and the currencies involved. A simple online calculator for quick results.Command Console for MetaTrader 5
Managing your MetaTrader 5 trading platform can sometimes feel cumbersome when you need to perform multiple actions quickly. Our MT5 Console tool provides a powerful command-line interface that lets you control nearly every aspect of MT5 using simple text commands — from executing trades to managing charts and indicators.
What is MT5 Console?
The MT5 Console is an experimental command-line interface tool for MetaTrader 5 that provides a terminal-like window where you can type commands to control the platform. Instead of navigating through menus and dialogs, you can simply type commands like buy 0.1 or close all to execute trades instantly.
The console operates as a service that runs in the background, providing a separate window that stays on top of your MT5 platform. You can toggle it by pressing
Think of it as a command prompt for your trading platform — if you're comfortable with typing commands, you'll find this tool dramatically speeds up your workflow.
Warning!
MT5 Console is an experimental tool! It can destroy your data and mess up your trading positions. It is provided "as is" and without any warranty. Use only at your own risk!
Commands
MT5 Console offers an extensive set of commands covering trading, chart management, platform control, and more:
Trading commands
buy [symbol] <lots> [sl=<price>] [tp=<price>]: Open a buy position.sell [symbol] <lots> [sl=<price>] [tp=<price>]: Open a sell position.abuy/asell: Async versions of buy/sell for faster execution.close <symbol>orclose all: Close positions.aclose all: Async close all positions.positionsorpos: List all open positions.orders: List pending orders.history [period]: Show trade history.balanceorbal: Show account balance and equity.panic: Remove all EAs, close all positions, delete all pending orders.
Chart commands
info: Show information about the current chart.chart <symbol> [timeframe]: Open a new chart.tf <timeframe>: Change current chart timeframe (e.g.,tf h1).left/right(orl/r): Switch between open charts.line <price> [color]: Add horizontal line (supports word colors likeredand hex colors like0xFF8800).template <name>: Apply a chart template.scroll: Toggle chart auto-scroll.shift: Toggle chart shift.
Indicator and EA commands
add <indicator>: Add an indicator via MQL5 code (doesn't require confirmation).attach <indicator>: Attach an indicator to current chart (supports both standard and custom indicators).run <script>: Run a script.load <name>: Attach an expert advisor.unload: Remove EA from chart.remove <indicator>: Remove indicator from chart.list: List indicators, scripts, and EAs in your MQL5 folder.install <URL>: Install an indicator, expert advisor, or script from a URL (www.earnforex.com or some other).
Alert commands
alerts: List all configured MT5 alerts.alerts-add <symbol> <condition> <value>: Add a new alert (e.g.,alerts-add eurusd bid< 1.05).alerts-enable <n>/alerts-disable <n>: Enable/disable alert by number.alerts-del <n>: Delete an alert.
Platform commands
autooralgo: Toggle autotrading on/off.darkmode/lightmode/systemmode: Change MT5 color scheme.shutdown [delay]: Close MetaTrader 5.
Information commands
spec [symbol]: Show symbol specification.swaps [symbol]: Show swap rates.accountoracc: Show account details.server: Show MT5 server details.margin: Margin information.
Utility commands
helpor?: Show available commands.clearorcls: Clear console screen.undo: Undo last action (where supported).exit: Close console window (reopen with` ).
Why use MT5 Console?
The MT5 Console tool is designed for traders who prefer using fast keyboard commands over slow point-and-clicking with a mouse. Here are some scenarios where the MT5 Console can be advantageous:
- Fast trade execution: Type
buy 0.1instead of clicking through the order dialog. - Quick chart management: Switch timeframes with
tf m15or navigate charts withleft/right. - Emergency situations: The
paniccommand quickly removes all expert advisors from all charts and closes all positions/orders. - Repetitive tasks: Commands are faster than navigating menus, especially for frequent operations.
- Command history: Use arrow keys to recall and repeat previous commands, even after restarting the platform.
- Download & install: the
installcommand will handle downloading, installation, and compilation of any MT5 indicator, EA, or script from a given link. - Keyboard-centric workflow: Keep your hands on the keyboard instead of switching to the mouse.
If you prefer graphical interfaces and rarely need to perform rapid actions, MT5 Console might not be necessary. But for active traders, scalpers, or anyone who appreciates command-line efficiency, this tool can significantly improve the way you interact with MetaTrader 5.
Console interface
The MT5 Console appears as a separate window with a black background and green text, reminiscent of classic terminal interfaces. Key features of the interface include:
- Command prompt: Shows
MT5>where you type commands. - Command history: Use Up/Down arrow keys to navigate through previous commands.
- Scroll: Use Page Up and Page Down keys to scroll the console window up and down.
- Always on top: The console stays visible above other windows for quick access.
- Toggle visibility: Press
` (backtick) to show/hide the console. - No need to type complete commands: The console will detect the command by its first characters.
This MT5 Console service is free and open-source, so you can expand it with your own commands or otherwise modify it to accommodate your needs.
Download (ver. 1.00, 2026-02-02)
You can download our free MT5 Console tool using the link below.
Installation
To install the MT5 Console service, please follow these instructions:
- Download the Console.mq5 file.
- Open the MetaTrader 5 data folder (via File→Open Data Folder).
- Open the MQL5\Services\ folder (create it if it doesn't exist).
- Copy the Console.mq5 file to the MQL5\Services\ folder.
- Open MetaEditor (
F4 ). - In MetaEdtitor's Navigator, find Console under Services and double-click it to open.
- Find the Compile button in the toolbox menu.
- Click the Compile button and make sure there are no compilation errors.
- Return to MetaTrader 5 window.
- In the Navigator, expand the Services section.
- Double-click on Console to start the service.
- Check the Allow DLL imports option when prompted (required for Windows API access).
- After you start the Console service, its window can be toggled with
` (backtick key, located above Tab on most keyboards).
Warning!
MT5 Console won't likely run on Linux or macOS systems.
This tool requires MetaTrader 5 and cannot be used with MetaTrader 4. You can open a trading account with any of the brokers that offer MetaTrader 5 to use the MT5 Console.
Discussion
Do you have any suggestions or questions regarding this tool? You can always discuss MT5 Console with the other traders and coders on our forum.



