AutomationMart
Home/Browse/Discord Forex AI trading assistant w/ proper position sizing (metatrader5)
n8n

Discord Forex AI trading assistant w/ proper position sizing (metatrader5)

n8nn8n40 modulesv1.0
GmailNotionAirtableGoogle SheetsDiscordOpenAI

AI Trading Assistant with Metatrader5 and position sizing capabilities Trade or buy/sell forex and xauusd/gold assets with this n8n template. It demonstrates an AI-powered Discord bot that monitors trading commands in a private server channel and automatically executes them on MetaTrader 5, using natural language processing to parse flexible trade syntax and manage signal queues with correct position sizing for lot sizes. Use cases are many: Try creating a private Discord trading room w

At a glance

Discord Forex AI trading assistant w/ proper position sizing (metatrader5) is a ready-made n8n workflow you import as a workflow JSON file — no build required. It connects Gmail, Notion, Airtable, Google Sheets. It's free to download. Follow the 5-step import below to go live in minutes.

Platform
n8n
Connects
Gmail, Notion, Airtable, Google Sheets, Discord, OpenAI
Modules
40
Price
Free
Version
v1.0
Discord Forex AI trading assistant w/ proper position sizing (metatrader5) workflow diagram

About this workflow

AI Trading Assistant with Metatrader5 and position sizing capabilities Trade or buy/sell forex and xauusd/gold assets with this n8n template. It demonstrates an AI-powered Discord bot that monitors trading commands in a private server channel and automatically executes them on MetaTrader 5, using natural language processing to parse flexible trade syntax and manage signal queues with correct position sizing for lot sizes. Use cases are many: Try creating a private Discord trading room where you can execute MT5 trades with simple messages like "buy EU 1% 30 pip SL 3R TP", building a shared trading server where team members can post signals that auto-execute on everyone's MT5, or developing a trading journal bot that logs and executes your strategy calls in real-time! Good to know Always test on demo accounts first - this bot executes real trades based on Discord messages, so thorough testing is critical Requires OpenAI API key for natural language processing (GPT-4o-mini model) - costs approximately $0.0001-0.0003 per trade command Discord OAuth2 authentication required - you'll need to create a Discord application and configure webhook permissions The workflow polls Discord every 7 seconds by default - adjust the Schedule Trigger interval to balance responsiveness vs. API rate limits Only processes messages from specified users without emoji reactions - prevents duplicate processing and allows filtering by username MT5 Trading Signal Handler workflow must be running - this bot sends orders to the webhook endpoints from the companion workflow Supports both market orders (instant execution) and limit orders (pending at specific price) Uses two-stage parsing: regex-based parser for speed, with LLM fallback for complex or ambiguous commands No message history - only processes the most recent Discord message per polling cycle Built-in signal management commands - users can check pending signals or clear the queue via natural language How it works Scheduled Polling: The Schedule Trigger fires every 7 seconds, setting Discord server ID and channel ID credentials, then fetching the most recent message from the specified channel Message Filtering: The workflow filters messages to only process those from the specified username (e.g., "elijahfx") that haven't been reacted to yet, preventing duplicate processing Processing Indicator: Once a valid message is detected, the bot reacts with a 🔄 emoji to show it's working, providing immediate user feedback AI Classification: The first LLM (GPT-4o-mini) classifies the message intent into six categories: tradeexecution, tradeinquiry, signalquery, signalclear, helprequest, or offtopic Regex Parsing: For trade execution messages, a JavaScript Code node attempts to extract parameters using regex patterns, detecting order type (market vs limit), direction (buy/sell), asset shortcuts (EU→EURUSD, GU→GBPUSD), risk percentage, stop loss, and take profit LLM Fallback: If the regex parser can't confidently extract all required parameters (needsllmreview: true), a second LLM validates completeness and extracts missing fields, ensuring flexible syntax handling Parameter Validation: The workflow checks if all required parameters are present - market orders need direction, asset, risk%, and SL pips; limit orders additionally require entry price Order Type Routing: A Switch node routes complete orders to the appropriate HTTP endpoint - market orders to /webhook/mt5-market-order, limit orders to /webhook/mt5-limit-order MT5 Execution: HTTP Request nodes send the parsed parameters to your local MT5 webhook endpoints, which execute the trades via the companion MT5 Trading Signal Handler workflow Response Handling: The workflow receives confirmation from MT5, then posts a Discord message confirming successful execution or reporting errors with details Signal Management: For signalquery commands, the bot fetches and displays pending signals from the MT5 queue; for signalclear commands, it purges all pending signals via HTTP request Help System: When users request help, the bot posts comprehensive instructions covering trade syntax, asset shortcuts, required parameters, and example commands Query Handling: Non-trade questions about trading are answered directly by the AI, providing a conversational assistant experience How to use Create a Discord bot application at discord.com/developers and obtain OAuth2 credentials with message read/write and reaction permissions Configure Discord OAuth2 credentials in all Discord nodes (use the same credential across all nodes for consistency) Set your OpenAI API key in the three "4o mini" nodes for LLM processing Update the "set credentials and params" node with your Discord server ID and channel ID (right-click in Discord with Developer Mode enabled to copy IDs) Ensure the MT5 Trading Signal Handler workflow is imported, activated, and running on the same n8n instance (default: localhost:5678) Activate this workflow and verify the Schedule Trigger is set to your desired polling interval (7 seconds default) In the "only get user's message that has no reacts" Filter node, change the username from "elijahfx" to your Discord username Post "help" in your Discord channel to test connectivity and receive the command reference guide Try a test market order: buy EU 1% 30 pip SL 3R TP and watch for the 🔄 reaction and confirmation message Test a limit order: buy limit EU at 1.0850 1% risk 30 pip SL 2R TP Query pending signals: show me pending signals or any open signals? Clear the queue: clear all pending signals or cancel all signals Requirements n8n instance running locally or on a private VPS (cloud-hosted n8n may have network restrictions for localhost webhooks) Discord bot application with OAuth2 credentials and appropriate permissions (read messages, send messages, add reactions) OpenAI API account with access to GPT-4o-mini model (approximately $0.15 per 1 million input tokens) MT5 Trading Signal Handler workflow running on the same n8n instance (provides webhook endpoints) Discord server where you have admin permissions to add the bot MetaTrader 5 terminal with the custom EA running and polling the signal queue Basic understanding of Discord bot setup, n8n workflows, and trading concepts Customising this workflow Add multiple user support by removing the username filter or converting it to a whitelist of approved traders Implement authentication by checking for specific Discord roles before processing trade commands (prevents unauthorized trading) Add trade logging by inserting a database node (PostgreSQL, Airtable) after successful execution to maintain a trade journal Create Discord embeds instead of plain text responses using Discord's embed formatting for richer, more professional replies Add risk limits in a Code node before HTTP requests to cap maximum position sizes or enforce daily loss limits Build a dashboard by connecting to Google Sheets or Notion to track all executed trades, win rates, and performance metrics Implement approval workflows where limit orders post to a separate channel for review before execution Add TradingView alerts as an alternative input by creating a webhook trigger that accepts TradingView JSON payloads Create strategy templates where users can save and recall complete trade setups with a single command like "execute strategy A" Enable multi-account trading by routing orders to different MT5 instances based on user roles or command prefixes Try a popular use-case such as building a signal subscription service where premium Discord members get auto-execution while free members only see the signals! Purchasing this N8N workflow comes with the Metatrader5 and N8N Integration for Forex and Gold Trading via Webhooks Workflow too so it is sold together and vice versa as well along with the MQL code for the ExpertAdvisor listener all for the price of 120 usd total Questions? If you have questions or need help with this workflow, feel free to reach out: elijahmamuri@gmail.com elijahfxtrading@gmail.com --- Important Disclaimer: This workflow is provided for educational purposes and demo account testing only. It demonstrates how to build Discord bots with AI-powered natural language processing and webhook integrations. Always test thoroughly on demo accounts, implement proper authentication and security measures, and understand that automated trading involves substantial risk. The bot executes trades based on Discord messages - ensure only authorized users have access. No warranties, financial advice, or guarantees are provided. See the full disclaimer in the workflow for complete terms.

n8n

How to import this n8n workflow

  1. 1

    Download the workflow JSON file after purchase.

  2. 2

    Open n8n → click the menu → Import from File.

  3. 3

    Select the downloaded JSON and import.

  4. 4

    Set up credentials for each node that requires them.

  5. 5

    Click Execute Workflow to test, then activate.

Setup guide

Setup guide included

Purchase to unlock the full step-by-step guide

Related N8n workflows

Shorten a URL using YOURLS and add it to a Google Sheets spreadsheet

Use this template to automatically shorten a new link in a Google Sheets spreadsheet with YOURLS. The template uses this [example spreadsheet](https://docs.google.com/spreadsheets/d/1Q4RWkjkbge4hajelXvpG1wRciD4LN43NRoFjkBe71cY/edit?usp=sharing).

Free

Create new persons in Nutshell from new rows in a Google Sheets spreadsheet

This template periodically checks for new rows in a Google Sheets spreadsheet and uses the retrieved information to create new persons in Nutshell. The template is using [this sample](https://docs.google.com/spreadsheets/d/17n_wjJ8f2DPJRfbaXkg358Y-dN_YF6DsaYI3pBKRw6U/edit?usp=sharing) Google Sheets spreadsheet as a source of the data. You should make a copy of it before configuring the template. The template is scheduled to run every 15 minutes. You can change the schedule after you set up the

Free

Automate Google Meet notes with GPT-4.1-mini, Notion, Slack & Gmail distribution

An intelligent automation system that turns Google Meet recordings into structured meeting notes — integrating Fireflies.ai, OpenAI GPT-4.1-mini, Notion, Slack, Google Drive, and Gmail via n8n. 🎥 Demo: Watch the Loom walkthrough --- ⚙️ What It Does The Google Meet Notes Generator & Distributor automates the entire post-meeting workflow. Workflow Summary: 1. Fetches Google Meet transcript via Fireflies.ai webhook. 2. Aggregates and summarizes transcript using OpenAI GPT-4.1-mini into: Title Sum

Free

Filter and update rows in Google Sheets based on specific criteria

Automatically filter Google Sheets rows based on criteria, switch conditions, and update rows to streamline data management and enhance productivity. Before setting up this workflow, please prepare a google spreadsheet containing a column titled `3`.

Free

Create tasks in Onfleet from new rows on Google Sheets

Every time you already got all your action items on a spreadsheet Google Sheets, Make will automatically create a Task in Onfleet. The template uses this [example spreadsheet.](https://docs.google.com/spreadsheets/d/1ThcB9t1LxphP0bfBO-Dw1uFzHpdn0_2UXiD4U3kf_EI/edit?usp=sharing)

Free

Generate email responses using ChatGPT and Google Sheets data

Automatically generate email responses using Perplexity AI and ChatGPT by filtering Google Sheets data, creating completions, and sending emails with Google Email.

Free

Automate docker container updates with Telegram approval system

Who is this for? This workflow is for DevOps engineers, system administrators, and Docker users who want to automate the process of checking for updates, verifying them, and applying updates to their Docker-based deployment in a controlled manner. For example, this workflow is used to update the n8n Docker image. What does this workflow do? - Fetches the latest Docker image version from GitHub. - Compares it with the currently running version on the server. - Sends a Telegram message requesting

Free

Monitor website performance with PageSpeed Insights and send alerts

Monitor website performance with PageSpeed Insights and save to Google Sheets with alerts This n8n template automatically monitors website performance using Google's PageSpeed Insights API, compiles detailed reports, and tracks performance trends over time in Google Sheets. Use cases: Agency client monitoring, competitor analysis, performance regression detection, SEO reporting, site migration monitoring, A/B testing performance impact, and maintaining performance SLAs. Who's it for - Digital ag

Free

Reviews

No reviews yet

Be the first to buy and share your experience.

Leave a review

Sign in to share your experience with this workflow.

Log in to review
Free
No ratings yet

Create a free account to purchase workflows.

  • JSON blueprint — instant download
  • Setup guide PDF included
  • 5 downloads · valid 30 days
  • Works with n8n

Need help setting this up?

Book a 3-hour live setup session with an Agility consultant.

₹2,499/ session
3 hrs · video call
  • Configure live on Google Meet / Zoom
  • Free follow-up if workflow has defects
  • Platform expert assigned to you
Book installation session
Free