Trading Bot Automation

JPTC Trading Bot: Complete Automation for Forex & Prop Firm Accounts

By JPTradingCapital April 6, 2026 15 min read

Why Manual Trading Fails at Scale

If you have ever tried to manage three or four prop firm accounts at once, you already know the pain. You spot an entry on your FTMO challenge account, switch to FundedNext, enter the same trade with adjusted lot sizing, then move to FXify and do it again. By the time you finish, the price has moved. You missed the entry on the second account, and the third one got a worse fill.

That latency gap between accounts is where traders lose money. It is not a skill problem—it is an execution bottleneck. JPTC was built to solve exactly this: a trading bot automation system that connects your strategy to every prop firm account through a single pipeline, using Discord as the command interface and a REST API for programmatic control.

No more copy-pasting lot sizes. No more switching between terminals. You issue one signal, and JPTC replicates it across every connected account in milliseconds. The rest of this article breaks down exactly how the system works, how to set it up, and how you can earn money by referring other traders to the platform.

How JPTC Works: From API to Discord Integration

At its core, JPTC is a three-layer system. Understanding each layer helps you troubleshoot, extend, and get the most out of the platform.

Layer 1: The Signal Source

Every trade starts as a signal. That signal can come from multiple sources:

Layer 2: The Execution Engine

Signals land in the JPTC execution engine, a Node.js service that handles authentication, validation, and routing. Here is what happens in sequence:

  1. The engine authenticates the incoming request using your API token.
  2. It validates the trade parameters: symbol, direction, lot size, stop loss, take profit.
  3. The risk manager checks the signal against each connected account's rules—maximum drawdown, daily loss limits, position sizing constraints.
  4. Validated trades are dispatched to every linked broker account in parallel.

Layer 3: The Admin Dashboard

The JPTC admin dashboard gives you real-time visibility into every trade across all connected accounts. You can see execution timestamps, fill prices, slippage metrics, and account equity curves. The dashboard is built with React and Vite, backed by a Supabase database for real-time subscriptions. When a trade executes, you see the update within seconds—no manual refresh needed.

The dashboard also supports 6 languages (English, Dutch, Portuguese, Spanish, German, and French), making it accessible to traders across Europe and beyond.

Trade Copier Setup for Multiple Prop Firm Accounts

The trade copier is the most practical feature in JPTC for anyone running prop firm challenges. Here is how the trade copier setup works in practice.

Connecting Your Accounts

Each prop firm account connects to JPTC through an API token. You generate this token from your broker or prop firm dashboard (FTMO, FundedNext, and FXify all support API access on MetaTrader accounts). Then you add the token in the JPTC admin panel under Account Connections.

The system supports an arbitrary number of accounts. Whether you have two or twenty, the execution engine fans out signals to all of them simultaneously.

Per-Account Configuration

Not every account should trade the same lot size. A $100k FTMO challenge has different risk parameters than a $10k FundedNext account. JPTC handles this with per-account configuration:

Real-world example: A trader running FTMO challenges on three account sizes ($25k, $50k, $100k) configures lot multipliers of 0.5x, 1.0x, and 2.0x respectively. One signal from their algo strategy places correctly sized trades on all three accounts within 200ms.

Monitoring Execution Quality

Execution latency matters when prop firms measure your drawdown to the cent. The admin dashboard tracks the time between signal dispatch and broker fill for every trade, on every account. If one account consistently shows higher latency, you know to investigate that broker's infrastructure.

Node.js & MQL5: Why This Combination Works

Building a Node.js trading bot that communicates with MetaTrader might seem unusual if you come from a pure MQL5 background. But this architecture is deliberate, and there are good reasons for each technology choice.

Why Node.js for the Execution Layer

Node.js is non-blocking and event-driven. When a signal arrives, the engine does not wait for one account to fill before sending to the next. It dispatches all requests concurrently using async/await patterns and resolves them in parallel. That is critical when you have ten accounts and need sub-second execution on all of them.

The ecosystem also matters. Supabase has a mature JavaScript SDK for real-time database subscriptions. Discord.js handles the bot integration. Express (or Fastify) serves the REST API. All of these are battle-tested Node.js libraries that JPTC builds on top of.

Here is a simplified example of how the execution engine dispatches a trade signal to multiple accounts:

Node.js trade-dispatcher.js
import { createClient } from '@supabase/supabase-js';

const supabase = createClient(
  process.env.SUPABASE_URL,
  process.env.SUPABASE_SERVICE_KEY
);

async function dispatchTrade(signal) {
  // Fetch all active accounts from Supabase
  const { data: accounts } = await supabase
    .from('connected_accounts')
    .select('*')
    .eq('status', 'active');

  // Dispatch to all accounts in parallel
  const results = await Promise.allSettled(
    accounts.map(account => executeTrade(account, signal))
  );

  // Log results to the dashboard
  for (const [i, result] of results.entries()) {
    await supabase.from('trade_logs').insert({
      account_id: accounts[i].id,
      signal_id: signal.id,
      status: result.status,
      fill_price: result.value?.price ?? null,
      latency_ms: result.value?.latency ?? null,
      error: result.reason?.message ?? null,
    });
  }
}

async function executeTrade(account, signal) {
  const start = Date.now();
  const adjustedLot = signal.lot * account.lot_multiplier;

  // Validate against account risk rules
  if (account.daily_loss_used + estimateRisk(adjustedLot) > account.max_daily_loss) {
    throw new Error(`Daily loss limit reached for ${account.name}`);
  }

  const response = await fetch(account.broker_api_url, {
    method: 'POST',
    headers: {
      'Authorization': `Bearer ${account.api_token}`,
      'Content-Type': 'application/json',
    },
    body: JSON.stringify({
      symbol: signal.symbol,
      side: signal.direction,
      volume: adjustedLot,
      sl: signal.stop_loss,
      tp: signal.take_profit,
    }),
  });

  const data = await response.json();
  return { price: data.fill_price, latency: Date.now() - start };
}

Why MQL5 on the Strategy Side

MetaTrader is where most forex strategies run. MQL5 Expert Advisors have direct access to tick data, chart patterns, and indicator calculations without any external dependency. Rather than trying to replace that, JPTC adds a thin HTTP layer on top of it. The EA runs your strategy logic, and when it decides to trade, it fires an HTTP request to the JPTC API instead of placing the trade locally.

This means your strategy stays in MetaTrader where it belongs, but execution scales across every connected account. Here is what the MQL5 bot API integration looks like inside an EA:

MQL5 jptc-signal-sender.mq5
// JPTC Signal Sender for MetaTrader 5
#include <Trade\Trade.mqh>

input string JPTC_API_URL   = "https://api.jptradingcapital.com/v1/signal";
input string JPTC_API_TOKEN = ""; // Your API token
input double BaseLotSize    = 0.1;

int OnInit() {
   Print("JPTC Signal Sender initialized");
   return(INIT_SUCCEEDED);
}

void SendSignalToJPTC(string symbol, string direction,
                      double lot, double sl, double tp) {
   string payload = StringFormat(
      "{\"symbol\":\"%s\",\"direction\":\"%s\","
      "\"lot\":%.2f,\"stop_loss\":%.5f,\"take_profit\":%.5f}",
      symbol, direction, lot, sl, tp
   );

   char post_data[];
   char result_data[];
   string result_headers;

   StringToCharArray(payload, post_data, 0, WHOLE_ARRAY, CP_UTF8);

   string headers = "Content-Type: application/json\r\n"
                  + "Authorization: Bearer " + JPTC_API_TOKEN + "\r\n";

   int res = WebRequest(
      "POST", JPTC_API_URL, headers,
      5000, post_data, result_data, result_headers
   );

   if (res == 200)
      Print("JPTC signal dispatched: ", symbol, " ", direction);
   else
      Print("JPTC signal failed, HTTP code: ", res);
}

void OnTick() {
   // Your strategy logic here
   // Example: simple moving average crossover
   double ma_fast = iMA(_Symbol, PERIOD_H1, 20, 0, MODE_EMA, PRICE_CLOSE);
   double ma_slow = iMA(_Symbol, PERIOD_H1, 50, 0, MODE_EMA, PRICE_CLOSE);

   static bool was_above = false;
   bool is_above = ma_fast > ma_slow;

   if (is_above && !was_above) {
      // Bullish crossover detected
      double sl = SymbolInfoDouble(_Symbol, SYMBOL_BID) - 0.0050;
      double tp = SymbolInfoDouble(_Symbol, SYMBOL_BID) + 0.0100;
      SendSignalToJPTC(_Symbol, "BUY", BaseLotSize, sl, tp);
   }

   was_above = is_above;
}

The Bridge Between Both Worlds

This separation of concerns—MQL5 for strategy, Node.js for execution and infrastructure—gives you flexibility that a monolithic MQL5 setup cannot match. You can swap strategies without rebuilding your execution pipeline. You can add new accounts without modifying your EA. And you can monitor everything from a web dashboard instead of staring at multiple MetaTrader windows.

Affiliate Marketing with JPTC: Generating Passive Income

Beyond trading, JPTC includes a built-in forex affiliate program that pays real commissions for referring new traders. This is not an afterthought—the referral system is integrated directly into the admin dashboard with full tracking and transparency.

How the Referral Program Works

Every JPTC user gets a unique referral link. When someone signs up through that link and becomes an active customer, you earn a flat commission. Here is the structure:

Unique Referral Links

Generated per user with click and conversion tracking built in.

Milestone Bonuses

Extra payouts at regular referral milestones to reward consistency.

Affiliate Dashboard

Real-time stats on clicks, signups, conversions, and payout history.

Multi-Language Support

Referral pages available in 6 languages to reach a broader audience.

Who Should Promote JPTC

The affiliate program works well for several types of people:

The referral tracking is handled server-side through Supabase, so there is no reliance on third-party cookies or browser storage. Your referrals are attributed reliably, even if the person signs up on a different device days later.

Tip for affiliates: The highest-converting approach is showing people your actual JPTC dashboard with live trade results. Proof of execution quality sells better than any marketing copy.

Security & Compliance: Tokens, Accounts, and Data

When you connect a trading account to any third-party system, security is the first question you should ask. Here is how JPTC handles it.

API Token Architecture

JPTC never asks for or stores your broker login credentials (username and password). Instead, it uses scoped API tokens that you generate from your broker or prop firm dashboard. These tokens typically have the following properties:

Account Isolation

Each connected account operates in its own execution context. If one account encounters an error (broker downtime, rejected order, insufficient margin), it does not affect the other accounts in the pipeline. The execution engine uses Promise.allSettled rather than Promise.all specifically for this reason—one rejection does not cancel the rest.

Data Handling

JPTC's backend runs on Supabase, which provides Row Level Security (RLS) out of the box. This means:

Compliance with Prop Firm Rules

Prop firms like FTMO and FundedNext have specific rules about automation. Most allow it as long as you are not using a shared strategy with identical trade timing across thousands of accounts (which looks like copy-trading abuse). JPTC mitigates this by supporting per-account timing jitter and individual lot sizing, so each account's trade history looks distinct even when originating from the same signal.

Security Checklist

  • TLS 1.3 encryption on all API communication
  • API tokens encrypted at rest in the database
  • No broker passwords stored anywhere in the system
  • Row Level Security on all Supabase tables
  • Per-account execution isolation
  • Configurable risk limits per connected account

Step-by-Step: Deploying JPTC

This section walks you through the full deployment process, from setting up the infrastructure to placing your first automated trade.

1

Set Up Supabase

Create a Supabase project. This serves as the database for user accounts, trade logs, referral tracking, and real-time subscriptions. Run the migration scripts to create the required tables: connected_accounts, trade_logs, referrals, and user_profiles.

Enable Row Level Security on every table and configure the RLS policies so users can only access their own data.

2

Configure the Discord Bot

Register a new application in the Discord Developer Portal. Create a bot user, copy the token, and add it to your environment variables. The JPTC Discord bot uses discord.js and listens for structured trade commands in designated channels.

Example command format: /trade EURUSD BUY 0.1 SL=1.0850 TP=1.0950

3

Deploy the Execution Engine

The Node.js execution engine deploys to Vercel as a serverless function or to a dedicated VPS if you need persistent WebSocket connections. For most use cases, Vercel's serverless model works well—each incoming signal triggers a function invocation that processes and dispatches the trade.

Set environment variables for your Supabase credentials, Discord bot token, and any broker API endpoints.

4

Connect Your Prop Firm Accounts

Log into the JPTC admin dashboard and navigate to Account Connections. For each prop firm account:

  • Enter the broker API endpoint URL.
  • Paste your API token.
  • Configure the lot multiplier and risk parameters.
  • Test the connection with a micro lot trade on a demo account first.
5

Set Up the MQL5 Expert Advisor

If you want signals originating from MetaTrader, install the JPTC signal sender EA on your chart. Configure it with your API token and the JPTC API URL. Make sure to whitelist the API domain in MetaTrader's Tools > Options > Expert Advisors > Allow WebRequest settings.

6

Build the Frontend Dashboard

The JPTC dashboard is a React + Vite application. Clone the repository, install dependencies, and configure the Supabase client with your project credentials. Deploy to Vercel with a single push to your Git repository.

Shell deployment commands
# Clone and install
git clone https://github.com/your-org/jptc-dashboard.git
cd jptc-dashboard
npm install

# Set environment variables
cp .env.example .env.local
# Edit .env.local with your Supabase URL, keys, and Discord config

# Run locally
npm run dev

# Deploy to Vercel
npx vercel --prod
7

Configure Mobile Access (Optional)

JPTC uses Capacitor to wrap the web dashboard into a native mobile app for Android and iOS. This lets you monitor trades, manage accounts, and check affiliate stats from your phone. Build the mobile app with:

Shell capacitor build
# Build the web app
npm run build

# Sync with Capacitor
npx cap sync

# Open in Android Studio
npx cap open android

# Or open in Xcode for iOS
npx cap open ios
8

Test and Go Live

Before running on live capital, test the entire pipeline end-to-end:

  1. Send a signal through Discord or the API.
  2. Verify it appears in the admin dashboard trade logs.
  3. Confirm execution on a demo account with the correct lot size and parameters.
  4. Check that the risk manager rejects trades that violate your configured limits.
  5. Validate that affiliate links are tracking correctly by opening your referral URL in an incognito window.

Once everything checks out on demo, switch your connected accounts to live and start trading.

Advanced Configuration: Webhooks, Email, and Notifications

JPTC integrates with Resend for transactional email. This powers several automated notifications:

You can also configure webhook URLs for custom integrations. Every trade event publishes a JSON payload that you can consume in Zapier, Make, or your own backend:

JSON webhook payload example
{
  "event": "trade.executed",
  "timestamp": "2026-04-06T14:32:18.442Z",
  "signal": {
    "id": "sig_a8f3c91d",
    "symbol": "EURUSD",
    "direction": "BUY",
    "lot": 0.1,
    "stop_loss": 1.085,
    "take_profit": 1.095
  },
  "executions": [
    {
      "account": "FTMO-100K",
      "status": "filled",
      "fill_price": 1.09012,
      "adjusted_lot": 0.2,
      "latency_ms": 147
    },
    {
      "account": "FundedNext-50K",
      "status": "filled",
      "fill_price": 1.09014,
      "adjusted_lot": 0.1,
      "latency_ms": 163
    }
  ]
}

This payload structure makes it straightforward to build external dashboards, alert systems, or even feed data into a Google Sheet for manual analysis.

Performance and Scaling Considerations

Running a prop firm account automation system at scale introduces real engineering challenges. Here is how JPTC addresses the most common ones.

Execution Latency

The round trip from signal receipt to broker fill depends on three factors: your server location, the broker's API response time, and network conditions. JPTC minimizes the first factor by deploying on Vercel's edge network, which places the execution engine close to major financial data centers. For the Amsterdam, London, and New York regions, typical signal-to-dispatch latency is under 50ms.

Rate Limiting and Backpressure

Brokers impose rate limits on their APIs. If you send 20 trade requests per second, some will get throttled. JPTC handles this with a configurable queue that respects per-broker rate limits. Requests are batched efficiently, and if a broker responds with a rate-limit header, the engine backs off automatically.

Database Performance

Supabase (PostgreSQL under the hood) handles the trade log volume well for typical JPTC deployments. If you are processing thousands of trades per day across dozens of accounts, consider enabling Supabase's read replicas and connection pooling to keep dashboard queries fast.

Scaling the Discord Bot

If your Discord server has hundreds of users sending trade commands simultaneously, the bot scales horizontally using Discord's sharding API. Each shard handles a subset of guilds, and signals are forwarded to the same execution engine regardless of which shard received them.

Frequently Asked Questions

Yes. JPTC never stores broker credentials on its servers. Authentication uses read-only API tokens scoped to trade execution, and all communication is encrypted via TLS 1.3. The system respects prop firm drawdown rules and risk parameters, so it will not place trades that violate your challenge constraints. Each account session is isolated, meaning a failure on one account cannot cascade to others.

Absolutely. The trade copier is built specifically for multi-account management. You can run a single master strategy and replicate it across FTMO, FundedNext, FXify, and other prop firm accounts simultaneously. Each account gets its own lot-size scaling, risk parameters, and execution monitoring through the admin dashboard.

JPTC provides a dedicated affiliate dashboard inside the admin panel. Every referral is tracked via unique links, and you earn a flat commission per referred customer plus milestone bonuses. The dashboard shows real-time stats including clicks, signups, conversions, and payout history. Earnings are processed on a regular cycle with full transparency.

You need a broker or prop firm account that supports API access (most MetaTrader 4/5 brokers do). Generate an API token from your broker's dashboard, then enter it in the JPTC admin panel. The token should have trade execution permissions but does not need withdrawal access. JPTC validates the token on first connection and alerts you if scopes are insufficient.

Building a trading bot from scratch can cost anywhere from a few hundred dollars for a basic MQL5 Expert Advisor to tens of thousands for a full-stack automated system with API integrations, monitoring, and multi-account support. JPTC eliminates that development cost by providing the entire infrastructure out of the box—including the Discord bot, trade copier, admin dashboard, and affiliate system. You focus on your strategy; JPTC handles the plumbing.

Start Automating Your Trading Today

Stop losing trades to manual execution delays. JPTC gives you a complete infrastructure for prop firm automation, trade copying, and affiliate earnings—all from a single dashboard.

Get Started with JPTC
Risk Disclaimer

Trading forex and CFDs involves significant risk and is not suitable for all investors. Past performance does not guarantee future results. You should not invest money you cannot afford to lose. The content on this page is for informational purposes only and does not constitute financial advice. JPTradingCapital does not accept liability for any loss or damage arising from reliance on the information provided. Always conduct your own research before making trading decisions.