I Built a Trading Robot in One Weekend (and It Survived) — Publishing My First MQL5 Product

Image
My product page, live on the MQL5 Market, September 2026. The video version of this story, now live on my YouTube channel. It was just after midnight on Monday when I saw my trading robot pass its final test. Not a backtest on my own computer, where I control everything — the real test. The MQL5 Market validation server, running my code on symbols I had never tried, on a balance I had never imagined. The log stopped scrolling. The word PASSED appeared four times. And I just sat there in the dark thinking: I built a trading robot, and it works. This is the story of the VitalEdge Gold EA — the trading robot I published on the MQL5 Market this week, how it nearly died four times in one night, and why publishing it felt different from everything else I have done in this journey. Why a Trading Robot? I need to be honest about something first, because this diary only works if I tell the truth. I did not write every line of that robot's code by hand. I wrote it with AI assistan...

The MT5 Trading Robot: Building Automation While Losing Sleep

The robot doesn't sleep. It doesn't eat. It doesn't check its phone or get distracted by a YouTube video. At 2 AM, while I'm debugging a WordPress plugin, it's watching the gold market on MT5, waiting for a signal. When the RSI crosses below 30, it buys. When it crosses above 70, it sells. When it loses three trades in a row, it stops. It's a simple set of rules, and it took me three months to turn into code.

MT5 terminal running GoldTrader v3 on XAUUSD
MT5 terminal running GoldTrader v3 on XAUUSD

Why I Built a Trading Robot

The idea came from a place of frustration. I was spending eight hours a day on the affiliate business , writing blog posts, publishing YouTube videos, managing the WooCommerce store, posting on social media . and the income was inconsistent. Some months I earned $200 in affiliate commissions. Other months, $20. I needed a revenue stream that didn't depend on whether someone clicked a link or read a review.

Trading was the obvious answer, but I had two problems: I didn't have time to watch the markets, and I didn't have the emotional discipline to trade without panicking. Every time I opened a position manually, I'd stare at the chart, second-guess myself, move my stop loss, close too early, or hold too long. I was my own worst enemy.

A robot ( an Expert Advisor in MT5 terminology : solves both problems. It watches the markets 24/5. It executes trades without emotion. It follows rules exactly as written, without the cognitive dissonance that makes human trading so destructive. I just needed to write the rules.

Learning MQL5

MetaQuotes Language 5 is the programming language used to write Expert Advisors for MetaTrader 5. It's similar to C++ but simpler, with built-in functions for trading operations and technical indicators. I had some programming experience from building the YouTube pipeline , Python, bash, basic API calls . but MQL5 was a different beast.

I spent two weeks on the MQL5 documentation. I read every tutorial I could find. I watched YouTube videos of people explaining RSI, MACD, and moving average strategies. I started with a simple moving average crossover bot , buy when the fast MA crosses above the slow MA, sell when it crosses below. It lost money immediately. The strategy was too simple for the gold market, which whipsaws constantly.

I added RSI as a filter. Only buy when RSI is oversold (below 30). Only sell when RSI is overbought (above 70). The losses decreased but didn't stop. I added MACD as a trend confirmation. I added ATR (Average True Range) for dynamic stop loss placement. I added a maximum daily loss limit . if the bot loses three trades in a row, it stops trading for the day.

Image 2

Before Architecture of GoldTrader v3

The final version, which I called GoldTrader v3, had the following rules. It traded XAUUSD (gold against the US dollar) on the 15-minute timeframe. It used a combination of RSI (14), MACD (12, 26, 9), and a 50-period moving average to determine entry signals. The stop loss was set at 1.5 times the ATR, which meant it adapted to market volatility , wider stops in volatile markets, tighter stops in quiet markets. The take profit was set at 2 times the stop loss, giving a risk-reward ratio of 1:2.

The daily loss limit was three consecutive losing trades. If the bot hit that limit, it would close all positions and stop trading until the next day. This was the most important rule . not because it prevented losses, but because it prevented the death spiral that kills most trading accounts: trying to win back losses with bigger positions.

The position sizing was fixed: $10 per trade, which on a standard lot in gold trading meant trading 0.01 lots. This kept the risk small enough that even a bad week wouldn't blow the account. I funded the Exness account with $100 ( money I could afford to lose, and honestly expected to lose.So First Month of Live Tradingh2>

I deployed GoldTrader v3 on a VPS : a virtual private server in London that stayed online 24/7, ensuring the bot never missed a signal because my laptop was asleep or my internet was down. The first week, it made four trades. Two wins, two losses. Net profit: $3.20. Not life-changing, but the system worked. It executed trades without emotion, followed the rules exactly, and didn't panic when a trade went against it.

The second week was better. Six trades, four wins, two losses. Net profit: $11.40. The third week was the best: five trades, four wins, one loss. Net profit: $18.20. For a moment, I felt the intoxicating rush that every algorithmic trader feels , the possibility of infinite, passive, emotionless income.

Then the fourth week happened. Seven trades, one win, six losses. The daily loss limit triggered three times. Net loss: -$22.40. The bot wasn't broken . the market was just in a range-bound state that the trend-following strategy couldn't handle. RSI would signal oversold, the bot would buy, and the price would keep falling. MACD would signal a trend reversal that never materialized. Every signal was a false positive.

Before Reality of Algorithmic Trading

2>

Over three months, GoldTrader v3 made 67 trades. 38 wins, 29 losses. A 57% win rate. The average win was $8.40. The average loss was $6.20. Net profit: $156.80. On a $100 account, that's a 157% return in three months, which sounds incredible until you realize it's $156.80. It's not a salary. It's not even a side hustle. It's pocket money that took three months and a hundred dollars of capital to generate.

But it proved something more valuable than the money: the system worked. The robot could trade without me. It could generate returns while I slept. It could follow rules without emotion. The question wasn't whether algorithmic trading worked , it did. The question was whether it could scale to something meaningful.

Image 3

The Fiverr Pivot

The scaling question led to an unexpected answer. Instead of trying to trade with a bigger account (which I couldn't afford to risk), I sold the skill itself. I created a Fiverr gig offering to install and configure MT5 Expert Advisors for other traders. The gig was simple: send me your EA file, your broker login, and your risk parameters, and I'll set it up on your VPS within 24 hours.

The first order came in within a week. $15 for installing an EA on a VPS. It took me twenty minutes. The second order was $25 for a custom configuration. The third was $35 for backtesting and optimization. Within two months, the Fiverr gig was earning more than the trading bot itself. I was making more money helping other people trade than I was from trading.

This is the irony of the trading robot: the robot itself was a modest success, but the skills I built creating it . MQL5 programming, VPS management, trading system design , became a product. The journey was the destination, and the destination was a Fiverr gig.

Image 3

What the Robot Taught Me

GoldTrader v3 is still running. On a $100 account, with $10 trades, it generates maybe $50 a month. I check on it once a week, review the trades, and occasionally adjust the parameters. It's not my main income — the affiliate business earns more — but it's the most passive income I have. It's the one revenue stream that truly works while I sleep.

The robot also taught me something about myself: I'm better at building systems than executing them manually. The same trait that made me a terrible manual trader — emotional decision-making, second-guessing, inability to stick to a plan — is exactly the trait that makes me a good system builder. I can design rules. I just can't follow them. A robot follows the rules I can't, and we complement each other.

In a way, that's the story of this entire journey. I build systems — affiliate pipelines, YouTube automations, trading bots — because I'm not good at doing things manually. The systems compensate for my weaknesses. And slowly, one system at a time, they add up to something that resembles a business.

Coding MQL5 in the Dark During Loadshedding

Developing GoldTrader v3 for MetaTrader 5 was one of the most mentally taxing engineering projects I've ever tackled. I spent three agonizing months teaching myself MQL5, MetaQuotes' proprietary C++-like object-oriented language. Coding algorithmic trading logic at 2:30 AM during Stage 6 load shedding in Johannesburg is an experience etched deep in my memory. With my laptop screen dimmed to 20% brightness to preserve battery life and a cheap rechargeable R350 desk lamp illuminating my notepad, I debugged indicator array calculations line by line.

The core algorithm combined a 14-period Relative Strength Index (RSI) with a 200-period Exponential Moving Average (EMA) to filter macro trend direction on XAUUSD (Gold). When gold price action traded above the 200 EMA and the 14 RSI dropped below 30 on the 15-minute timeframe, the robot automatically executed a Buy limit order with a strict 250-pip stop loss and a 500-pip take profit target. If three consecutive trades resulted in stop-loss hits within a rolling 12-hour window, the expert advisor automatically locked execution for 24 hours to prevent algorithm drawdowns during unpredictable fundamental news releases.

Fixing memory leaks and array out-of-bounds errors in the MetaEditor IDE required immense concentration. One single misplaced bracket or incorrect bar index offset in MQL5 can cause an Expert Advisor to freeze during live market ticks, missing crucial execution orders or miscalculating position sizes. I ran over 500 historical backtests on historical XAUUSD tick data from 2021 to 2023, tweaking parameters until the profit factor stabilized above 1.65 with a maximum drawdown under 12%.

The Emotional Rollercoaster of Live Market Execution

Backtesting on historical data and paper trading on a demo account is easy because virtual money carries zero psychological pressure. The true acid test came when I deposited $50 (approximately R920) of my hard-earned savings into a live broker account via FNB credit card transfer. Watching the trading robot take its very first live trade on XAUUSD while I was eating a R25 bunny chow at a local takeout joint in Joburg sent my adrenaline spiking.

At 15:30 SAST, when the New York market session opened and US CPI inflation figures were announced, gold prices moved violently. The robot entered a long position, immediately dipped into a -$12 unrealized drawdown within five seconds, and then violently reversed upward to smash through the take-profit target for a +$22 gain. That moment proved that my code worked under real market liquidity conditions. But it also revealed how nerve-wracking algorithmic automation can be when real money is on the line. Two days later, a sudden geopolitical news spike triggered the 3-loss emergency stop, wiping out $14 in twenty minutes. The safety net saved the trading account from a total margin call, but the physical knot in my stomach was very real.

That emotional strain forced me to realize that automated trading isn't a passive walk in the park. It requires constant risk monitoring, spread checking, and server uptime management. Running an EA on a home laptop over volatile South African Wi-Fi was far too risky, so I had to allocate $10 a month for a dedicated Forex VPS in London to ensure sub-10ms broker latency.

Turning MT5 Code Into a Freelance Service on Fiverr

Realizing that live market trading carries inherent market volatility and drawdowns, I made a strategic decision to monetize my MQL5 programming skills directly by offering MetaTrader 5 bot setup, custom indicator coding, and EA installation services on Fiverr. While trading returns vary unpredictably day to day, freelance technical service income provides reliable, guaranteed cash flow.

I published basic setup gigs ranging from $25 to $50 (equivalent to R450 to R900 in local currency). Within two weeks, international clients from Europe, Asia, and North America were messaging me to convert their manual price-action strategies into automated MT5 Expert Advisors or debug broken MQL4/MQL5 code. I walked clients through MT5 terminal setup, VPS configuration, and broker API authorization via remote Zoom sessions and WhatsApp calls. This steady freelance revenue helped cover my monthly internet bundles, domain fees, and hosting expenses while keeping GoldTrader v3 running safely on a micro account in the background.

Building the MT5 trading robot taught me invaluable lessons about software architecture, risk management, and emotional discipline. It showed me that automated systems don't eliminate risk—they transform manual operational effort into structured risk parameters that you must manage with precision.

Comments

Popular posts from this blog

One Year In: Still Small, Still Going — Here's Why

The Instagram Shadowban: Posting Into the Void

The Day the Whole World Could Open My Website — Except Me