KS Q Command Center: Remote Trade Management for MetaTrader 5

KS Q Command Center: Remote Trade Management for MetaTrader 5
Download ALL MT5 experts (1558)
YouTube Video Thumbnail

Similar MetaTrader Tools

KS Q Command Center: Remote Trade Management for MetaTrader 5

Info

The KS Q Command Center: Remote Trade Management for MetaTrader 5 is a Expert Advisor for MetaTrader 5 that this expert advisor (ea) is a powerful tool for quantitative fund managers, enabling remote monitoring and management of funded accounts from a mobile browser without the need for a vps. It establishes a two-way communication bridge between MetaTrader 5 and Google Sheets, offering both reporting and commanding capabilities.

Usage

This tool is typically used for automated trading on major forex pairs and gold.

Platform

This Expert Advisor works exclusively on MetaTrader 5 (both build 600+ and newer versions).

Setup

Place the downloaded file in MQL5/Experts folder via File ? Open Data Folder in MetaTrader 5.


How to Install and Use KS Q Command Center: Remote Trade Management for MetaTrader 5

1. Installation: Open the "File" menu, select "Open Data Folder," navigate to MQL/Experts, paste your file, and restart the terminal.

2. Activation: Drag the EA from the Navigator onto a chart, ensure "Allow live trading" is checked in the Common tab, and verify the AutoTrading button is green.

3. Optimization: Right-click your chart, choose "Expert List," click "Properties" to adjust inputs, and save your preferred setup as a set file for future use.

4. Maintenance: Regularly check the "Experts" tab in the terminal window to monitor trade logs and potential execution errors.

Frequently Asked Questions

Q: Why is my EA not opening trades? A: Check the "AutoTrading" button, ensure "Allow live trading" is enabled, and verify your broker allows automated trading on your account type.

Q: Can I run multiple EAs on one chart? A: No, each chart can only host one active EA; however, you can open multiple charts for different currency pairs to run several EAs.

Q: What does the "smiley face" icon mean? A: A smiley face in the top-right corner of the chart indicates the EA is successfully running; a frowny face means it is disabled.

What this tool does

This Expert Advisor (EA) is a powerful tool for quantitative fund managers, enabling remote monitoring and management of funded accounts from a mobile browser without the need for a VPS.

Typical Use Case

This Expert Advisor excels in automated trading and technical analysis on MetaTrader 5.

Compatible Platform & Setup

This Expert Advisor works on MetaTrader 5. Place the file in the MQL5/Experts folder and restart the terminal.

Description & Settings

Related: AS Q Command Desk - another powerful expert for MetaTrader 5 traders.

This Expert Advisor (EA) is a powerful tool for quantitative fund managers, enabling remote monitoring and management of funded accounts from a mobile browser without the need for a VPS.

Also recommended: FT CC I - similar expert with strong performance on MetaTrader 5.


It establishes a two-way communication bridge between MetaTrader 5 and Google Sheets, offering both reporting and commanding capabilities.


Push (Reporting):
The EA collects live account data, including balance, equity, margin, and open position metrics, and securely transmits this information as a JSON payload to a Google Apps Script Web App via HTTP POST.


Pull (Commanding):
The EA periodically polls a designated 'Commands' tab in the Google Sheet. When a user queues a command, the EA interprets the JSON instruction, executes the specified trade actions (e.g., closing positions, adjusting stop losses), and reports the outcome back to the sheet.


Symbol and Timeframe:
As a global trade management utility, the EA is independent of specific symbols and timeframes. It can be attached to a single major currency pair like EURUSD and will manage the entire account.
Recommended timeframes are H1 or higher to minimize resource usage on the VPS.


External Variables:

GoogleSheetWebAppURL:
The deployment URL of your Google Apps Script.

SheetPassword:
A security string to protect against unauthorized POST requests. This must match the password in the JavaScript backend.

DataPushInterval (Seconds):
Frequency of account data updates sent to the Google Sheet.

CommandPullInterval (Seconds):
Frequency of checking the Google Sheet for new commands.

SlippagePoints:
Maximum slippage allowed for remote trade execution.

EnableLogging:
Set to true for detailed communication logs in the MT5 Experts tab.


Critical Setup Instructions:
MT5 blocks external connections by default. To enable communication with Google servers, follow these steps:

- Whitelist WebRequest URLs: In MT5, go to Tools -> Options -> Expert Advisors. Enable 'Allow WebRequest for listed URL' and add the specified URLs.

- Install Google Sheets Backend: Create a blank Google Sheet, access Apps Script, and paste the provided JavaScript code. Deploy as a Web App with 'Execute as Me' and 'Access: Anyone' permissions. Copy the Web App URL and paste it into the EA's GoogleSheetWebAppURL parameter in MT5.

Magic Setup: Within 60 seconds of attaching the EA, the script will automatically format the Google Sheet, creating the Dashboard and Commands tabs.


Google Apps Script Backend Code // ========================================================================= // KSQuants Command Center Backend (Auto-Building Version) // ========================================================================= const PASSWORD = "Secret"; // MUST match the SheetPassword in your MT5 EA function doPost(e) { try { var payload = JSON.parse(e.postData.contents); var ss = SpreadsheetApp.getActiveSpreadsheet(); // 0. Auto-Setup: Build tabs and headers if they don't exist ensureSetup(ss); // 1. Authenticate if (payload.password !== PASSWORD) { return createJsonResponse({ error: "Authentication Failed: Incorrect Password" }); } // 2. Route the Request if (payload.action === 'status_update') { return handleStatusUpdate(payload, ss); } else if (payload.action === 'get_commands') { return handleGetCommands(payload, ss); } else if (payload.action === 'mark_command_done') { return handleMarkCommandDone(payload, ss); } return createJsonResponse({ error: "Unknown action requested" }); } catch (error) { return createJsonResponse({ error: "Server Error: " + error.message }); } } // ------------------------------------------------------------------------- // THE MAGIC: Auto-Build Function // ------------------------------------------------------------------------- function ensureSetup(ss) { // 1. Setup Dashboard Tab var dashSheet = ss.getSheetByName("Dashboard"); if (!dashSheet) { // Try to rename 'Sheet1' var sheet1 = ss.getSheetByName("Sheet1"); if(sheet1) { sheet1.setName("Dashboard"); dashSheet = sheet1; } else { dashSheet = ss.insertSheet("Dashboard"); } dashSheet.clear(); } // 2. Setup Commands Tab var cmdSheet = ss.getSheetByName("Commands"); if (!cmdSheet) { cmdSheet = ss.insertSheet("Commands"); // Insert headers var headers = [["Row", "Status", "Account", "Symbol", "Command", "TargetValue", "MT5 Feedback", "Time Completed"]]; var headerRange = cmdSheet.getRange("A1:H1"); headerRange.setValues(headers); headerRange.setFontWeight("bold"); headerRange.setBackground("#d9ead3"); // Light green background cmdSheet.setFrozenRows(1); // Freeze top row cmdSheet.setColumnWidth(2, 100); // Status cmdSheet.setColumnWidth(5, 150); // Command cmdSheet.setColumnWidth(7, 300); // MT5 Feedback } } // ------------------------------------------------------------------------- // ROUTE 1: Handle Status Updates (Push from MT5) // ------------------------------------------------------------------------- function handleStatusUpdate(data, ss) { var dashSheet = ss.getSheetByName("Dashboard"); // Update Account Metrics dashSheet.getRange("A1:B6").setValues([ ["KSQuants Command Center", "Live Data"], ["Last Sync", new Date().toLocaleString()], ["Account Login", data.account.login], ["Balance", "$" + data.account.balance], ["Equity", "$" + data.account.equity], ["Margin Level", data.account.margin_level + "%"] ]); dashSheet.getRange("A1:B1").setFontWeight("bold").setBackground("#d9ead3"); // Update Open Positions dashSheet.getRange("D1:H500").clearContent(); dashSheet.getRange("D1:H1").setValues([ ["Ticket", "Symbol", "Type", "Volume", "Profit"] ]).setFontWeight("bold").setBackground("#cfe2f3"); if (data.positions && data.positions.length > 0) { var posData = data.positions.map(function(p) { return [p.ticket, p.symbol, p.type, p.volume, p.profit]; }); dashSheet.getRange(2, 4, posData.length, 5).setValues(posData); } else { dashSheet.getRange("D2").setValue("No Open Positions"); } return createJsonResponse({ status: "success", message: "Dashboard updated" }); } // ------------------------------------------------------------------------- // ROUTE 2: Send Pending Commands (Pull from MT5) // ------------------------------------------------------------------------- function handleGetCommands(data, ss) { var cmdSheet = ss.getSheetByName("Commands"); var values = cmdSheet.getRange(2, 1, cmdSheet.getLastRow() - 1, 6).getValues(); var pendingCommands = []; for (var i = 0; i < values.length; i++) { var status = String(values[i][1]).toUpperCase(); var acc = String(values[i][2]); if (status === "PENDING" && acc === String(data.account)) { pendingCommands.push({ row: i + 2, account: acc, symbol: String(values[i][3]), command: String(values[i][4]).toUpperCase(), targetValue: Number(values[i][5]) || 0 }); } } return createJsonResponse(pendingCommands); } // ------------------------------------------------------------------------- // ROUTE 3: Mark Commands as Done (Acknowledge from MT5) // ------------------------------------------------------------------------- function handleMarkCommandDone(data, ss) { var cmdSheet = ss.getSheetByName("Commands"); var row = data.row; var status = data.status; var details = data.details; cmdSheet.getRange(row, 2).setValue(status); cmdSheet.getRange(row, 7).setValue(details); cmdSheet.getRange(row, 8).setValue(new Date().toLocaleString()); if(status === "SUCCESS") { cmdSheet.getRange(row, 2).setBackground("#d9ead3"); } else { cmdSheet.getRange(row, 2).setBackground("#f4cccc"); } return createJsonResponse({ status: "cleared" }); } // ------------------------------------------------------------------------- // Utility Function // ------------------------------------------------------------------------- function createJsonResponse(jsonObject) { return ContentService.createTextOutput(JSON.stringify(jsonObject)) .setMimeType(ContentService.MimeType.JSON); }

You may also like: Exp Step Sto - excellent alternative for expert users on MetaTrader 5.


Leave your opinion, ask a question, share some knowledge

Limitations & Risk Warning

  • This tool is provided for educational and testing purposes only.
  • Past performance does not guarantee future results.
  • Trading involves substantial risk of loss. Use on a demo account first.
  • Results may vary depending on market conditions, broker, and settings.
  • We recommend thorough backtesting and forward testing before using with real funds.
RobotFX does not own any of the code provided on this platform. All tools are freely available on the internet; we simply index and re-offer them for download. We are not responsible for any financial losses that may occur. Trading responsibilities rely solely on the traders downloading and using the displayed Expert Advisors, indicators, and scripts. These tools are provided for educational purposes only and may require modification or optimization to align with a trader's specific strategy or needs.
© ROBOTFX - Best MetaTrader Expert Advisors & Indicators