ProEA Lab · Honest notes on building & testing a real MT5 system · No income claims · Every number links to its source
AI

You Vibe-Coded a Trading Bot.

Describe a strategy, let AI write the bot, watch a gorgeous backtest in an afternoon. The screenshots online look insane. But you can't read the 2,000 lines now holding your money — and a demo that runs is not an engine that survives. Here's how a vibe-coded bot fails silently live, and the 20-minute audit that catches it before it empties your account.

PLProEA LabJun 5, 2026 · 12 min read
A lone human silhouette stands before a colossal green machine-oracle with glowing eyes, candlestick charts raining down as data through ruined columns — a person dwarfed by a system that trades their money and that they can't read.

You saw the screenshot.

$1,400 → $238,006. 11 days. "A trading bot I built with AI over a weekend."

Then another. A thousand dollars into fourteen thousand in forty-eight hours.

For every screenshot like that, a hundred bots bled out in silence. The winners post. The silent losers don't.

But the curve is seductive, so you opened the AI and described your strategy in plain English.

Buy when momentum turns up after a pullback.
Use a trailing stop. Avoid chop. Risk 1%.

And it worked. The code appeared, the backtest rendered, the curve climbed, the inputs were neatly named, and the comments sounded like they'd already passed due diligence. It felt like cheating — like you'd skipped ten years of learning to code and walked straight to the printer.

Here's the part the screenshot crops out.

You can't read what you just deployed. Two thousand lines of plausible code now stand between your account and the market, and you couldn't say what half of them do — where the order is sent, how the size is calculated, or which line quietly turns 1% risk into 10%.

You didn't build a trading bot. You typed a black box into existence — and handed it your account.

Not that AI can't code — it can. It's that a demo that runs once is not an engine that survives a thousand bad ticks, and you can't tell which one the AI gave you if you can't read it.

Save this before you fund a bot you can't read a single function of. And send it to the friend who just DM'd you a 90-degree equity curve and the words "AI built me a bot, bro." That friend may not have a bot. They may have a beautifully commented liability.

Two lanes from the same trading bot. The top demo lane is smooth with perfect ticks and instant fills, ending in a clean rising curve. The bottom live lane hits a spread spike, partial fill, broker disconnect, weekend gap, and API error, ending in a bleeding curve.
The AI wrote for the top lane. Your money trades the bottom one.
1,689

programs an AI-code security study generated across 89 security-relevant Copilot scenarios.

Pearce et al., NYU
~40%

of those generated programs contained real vulnerabilities. General code-security evidence — mapped here to trading-code risk.

Asleep at the Keyboard, 2021
confidence gap

people using an AI assistant wrote less secure code — while being MORE likely to believe it was secure.

Perry et al., Stanford, 2023

The 60-second version

AI is brilliant at producing code that looks right. It can write an Expert Advisor, build a Python bot, generate a backtest, and make the demo run. None of that is the same as building a live trading engine.

A live engine has to survive what a demo never sees: spread spikes, partial fills, broker rejections, duplicate orders on reconnect, weekend gaps, slippage, wrong lot math, margin rules, API errors. A vibe-coded bot usually handles the happy path. Live trading is not the happy path.

And the danger isn't that the code crashes. It's that it doesn't — it keeps running, quietly, wrongly, with real money attached. The fix isn't "never use AI." It's never deploying money-handling code you can't read. If you can't audit the lines that size, stop, and send orders, you don't have a bot — you have a bet on code you've never seen.

What the vibe-coded bot feels likeWhat's actually under the hood
"AI built me a working bot."AI built you a working demo. Live is a different machine.
"The backtest is beautiful."A clean backtest can hide a bug that only fires live.
"It runs with no errors."It runs with no errors you can see. Silent failure is the dangerous kind.
"I don't need to read it."You can't fix, trust, size, or stop what you can't read.
"If it breaks, I'll ask AI to fix it."You can't describe a silent bug in code you don't understand.

I — The dream: describe it, AI builds the bot

For most of trading history, the wall between an idea and a bot was code. You either learned to program or paid someone who did. That wall just fell. Now you describe a strategy in plain English — "trade the London breakout, avoid high spread, risk 1%, trail after 2R" — and AI writes the EA, the backtest, and a readme so polished it feels like it already passed due diligence.

This is genuinely magical for prototypes and for learning. But a trading bot is not a weekend toy. It's a machine that touches money, unattended, at speed, in an environment that's actively trying to take it — and the dream quietly assumes that "the code appeared and ran" is the same thing as "the code is correct."

Those are different claims. The gap between them is where live accounts bleed. AI made the first one easy. It didn't delete the second — it just made it easier to skip.

II — A demo runs. An engine survives.

A demo proves the bot can work when the world behaves. An engine proves the bot can fail safely when it doesn't. That second job is the real one — not avoiding every loss, but stopping one weird live condition from turning a normal loss into an account event.

A demo only asks whether the bot can enter and exit on historical data. An engine has to answer the questions the demo never poses: What happens when the broker rejects the order? On a partial fill? When the feed disconnects mid-trade, the weekend gaps, the spread blows out tenfold, or the bot restarts holding a position it's forgotten?

The demo doesn't care, because in the demo none of it happens. The demo is a polite little movie. Live trading is a drunk forklift in a warehouse full of fireworks. A real engine survives because someone wrote the boring, defensive code — order-state checks, retry limits, duplicate-order protection, a max daily loss, a hard kill switch. None of it is the screenshot. It's the difference between "the bot lost a trade" and "the bot kept firing orders after the first failure and now we're all learning humility."

A demo runs once. An engine survives a thousand bad ticks.

III — Five silent killers inside code you didn't read

When a vibe-coded bot fails, it usually doesn't fail loudly. No explosion, no red warning — just money leaving while the dashboard still looks calm. Here are the assassins hiding in unread code.

1. Swallowed errors

The AI wraps a risky call in a catch-everything block. The call fails, the bot catches the error — and keeps going. No alert, no halt, just a silent shrug from a machine that's managing money. The most dangerous bug is the one that never tells you it's there. A bot that trades through its own errors isn't robust. It's blind with confidence.

2. Hallucinated functions

AI confidently calls methods or parameters that don't exist or don't behave as named. Sometimes that fails loudly — annoying but survivable. Sometimes it "works" by doing the wrong thing: the wrong price, the wrong order type, the wrong unit. Now the bot isn't broken enough to stop. It's broken enough to trade. That's worse.

3. Money math, off by a decimal

Position sizing is where tiny mistakes get expensive — risk percent, pip value, contract size, leverage, lot step. One wrong constant and your "1% risk" bot is risking 10%, and the backtest still looks fine because it sized wrong consistently. Live only cares that you were wrong, bigger.

4. No kill switch

A human-built engine has brakes: a max daily loss, a max exposure, a circuit breaker, a hard stop. A vibe-coded bot often has only an entry and an exit. An engine without a kill switch isn't automated trading — it's an unattended accelerator.

5. Live-only edge cases

Backtesters rarely simulate the ugly stuff cleanly: slippage, requotes, partial fills, weekend gaps, a symbol that stops quoting, a duplicate order after reconnect. The AI didn't handle them because the happy path worked without them — and the happy path is where demos live. The ugly path is where accounts die.

None of these has to crash the bot. That's exactly why they're dangerous: they run clean in the demo and bite only live.

A stylized dark code panel with five highlighted zones labeled swallowed error, hallucinated function, lot-size math, missing kill switch, and live-only edge case.
Every one can run clean in the demo. Every one bites only live.

IV — The research: more bugs, more confidence

This isn't a trading superstition. AI-generated code has been measured, and the findings are exactly the kind of uncomfortable thing traders should sit with.

Researchers at NYU prompted GitHub Copilot across 89 security-relevant scenarios and generated more than 1,600 programs; about 40% contained a real vulnerability — actually exploitable, not stylistically off. That was general code-security research, not trading research, and the distinction matters: the claim isn't "40% of trading bots blow up." It's narrower and more useful — AI-generated code carries real defects at meaningful rates, and a trading bot is just code with your money wired to the output, where a "defect" becomes a silent risk bug.

Picture the most common one: the AI sizes orders in lots where the broker counts contracts, so a tidy "0.10, that's one percent" order quietly becomes ten times the risk. The backtest never flinches — it sized the same wrong way on every trade — and the curve looks flawless right up to the live margin call.

The second finding is the one that should change how you work. A Stanford team had developers solve security tasks with and without an AI assistant. The group using AI wrote measurably less secure code — and was more likely to believe their code was secure. More defects, more confidence. The seatbelt felt tighter while it was quietly unbuckled.

There's a way out hidden in that same study: the participants who trusted the AI least — who re-read, re-prompted, and questioned the output — produced the fewest vulnerabilities. The danger was never the AI writing code. It was the human trusting it without reading it.

AI doesn't only generate bugs. It generates the confidence that there aren't any.

V — You don't own it. You operate it.

If you can't read the bot, you can't answer the questions that decide whether your account survives: How does it size? Where does it stop? What does it do when an order fails? Does it ever risk more than you think? Those aren't developer questions — they're owner questions, and if you can't answer them, you don't own the bot. You're just the person whose money is in it.

"I'll ask AI to fix it when it breaks" doesn't save you either. To get a fix you have to describe the bug — but a silent failure in code you can't follow gives you nothing to describe, just a balance lower than yesterday and a creeping sense that the market hates you personally. You can't debug a black box by vibes.

VI — "But it backtested great"

The reflex defense is always the equity curve: if the code were bad, the backtest would show it. It wouldn't — and this is where two earlier traps stack on top of the vibe-coding one.

A bot can backtest beautifully for reasons that don't survive live. It may be quietly reading data it wouldn't have in real time — a forming bar, a same-bar close, a repainting indicator — so it "predicts" trades it could never actually take. We pulled that bug apart in "Your AI Bot Reads the Future." Or it may be the lucky survivor of a giant search: try enough variations and one looks perfect by chance, which is "AI Found You a Perfect Backtest."

Vibe coding stacks a third failure on top: the curve was generated by the same unread code that will trade live, inside a simulation with perfect fills and no disconnects — exactly the conditions that hide the bugs that matter most. The prettier the curve, the more you should ask what the code did to earn it, in a language you can actually read.

VII — The fix: AI writes, you read

This isn't an anti-AI article — AI is the best coding accelerator traders have ever had. The fix is to change what you treat as done. AI writing the bot is the start of the work; it ends when you can read and defend the path that touches your money.

Let AI write the 2,000 lines. You must read the 200 that touch your money. Those are the lines that size a position, set risk, send and close orders, place the stop, handle errors, and trip the kill switch. Read those first, then do three things:

  • Make AI red-team its own bot. Paste the code back and order it to attack itself — the silent failures, the unhandled cases, the missing brake, the wrong units. (Prompt below.) The model that wrote the happy path is surprisingly good at finding it once you tell it to look.
  • Force a failure on purpose. On demo, disconnect the feed mid-trade, feed a bad symbol, reject an order, restart with an open position. A real engine fails safe. A demo improvises.
  • Demand a brake. No bot touches live money without a max daily loss and a hard kill switch you wrote and understand.

The goal isn't to become a developer. It's to refuse to deploy money-code you can't read — a much smaller bar, and still high enough to save you.

VIII — The same trap when you buy a bot

This matters even if you never vibe-code anything yourself. The instant you buy, copy, or rent a black-box bot — an EA you can't see inside, a signal service, a sealed system with a glossy curve — you're doing the same thing, one level removed: trusting unread code with your account. The only difference is that a stranger typed the black box into existence, and they're the one showing you the screenshot.

Maybe they're honest and the bot is good. But if you can't inspect it, you can't verify the things that decide whether your account survives — how it sizes, where it stops, what it does when an order fails, what shuts it down. A closed bot asks for belief. Readable source allows verification. That's the whole reason we sell MTR as source you read, not a box you trust — it's why "we sell the source, not signals."

Neither guarantees profit; a readable system can lose and a black box can win. But the black box denies you the one right every trader should keep: to inspect what's touching the account. If you wouldn't deploy your own unread AI bot, why deploy someone else's? Same trap. Better packaging.

Make your bot confess — the hostile audit prompt

Whenever AI hands you a trading bot, make it attack its own code before you run it. Paste the code into this prompt and read the verdict honestly.

You are a hostile code reviewer auditing a trading bot you did NOT write.
Assume it will run unattended with real money.
Your job is to find every way it fails SILENTLY. Do not praise it.
Do not rewrite it yet. Be specific and cite line numbers.

CODE:
[paste the full bot here]

Audit, in order:

1. MONEY-PATH MAP — list every line/function that sizes a position, sets risk,
   sends/modifies/closes an order, places a stop, disables trading, or reads
   signal data. Explain each in plain English.

2. ERROR HANDLING — find every place an error could be swallowed or ignored
   (catch-all blocks, unchecked order/API results, missing retry limits, no
   alert on failure). For each, say what the bot does AFTER the failure.
   Flag anything that keeps trading on error.

3. ORDER LIFECYCLE — for each, mark HANDLED / PARTIAL / MISSING:
   rejected order, partial fill, requote, disconnect, reconnect,
   duplicate order, restart with an open position, symbol stops quoting,
   spread spike.

4. RISK + MONEY MATH — show exactly how it sizes a position. Verify equity used,
   risk %, stop distance, pip/point value, tick value, contract size, lot step,
   min/max lot, leverage/margin, currency conversion. Is there ANY path where it
   risks more than intended? Show the worst case.

5. KILL SWITCH — check for max daily loss, max open risk, max orders/day,
   spread halt, manual kill switch, stop-after-consecutive-failures.
   If missing, say plainly: NO BRAKE.

6. DATA INTEGRITY — does it ever read data it wouldn't have in real time
   (forming bar, same-bar close, repainting indicator, future bar,
   full-sample stat, look-ahead normalization)? Flag possible look-ahead.

7. HALLUCINATED API — list every function/parameter you are not certain exists
   and behaves as named. Mark each VERIFY AGAINST OFFICIAL DOCS.

8. LIVE FAILURE TESTS — give me five demo tests that intentionally break it
   (disconnect feed, reject order, widen spread, restart mid-position,
   bad/missing data). State the expected fail-safe behavior for each.

9. VERDICT — choose one: DO NOT RUN / RUN ONLY ON DEMO /
   NEEDS FIXES BEFORE LIVE / READABLE AND DEFENSIBLE.
   Then give the single change that most reduces the risk of a silent blowup.

Be blunt. Do not soften findings. Assume real money.

The point isn't that AI becomes the final auditor — it doesn't. It's that you force the code to confess where the danger lives. Then you verify.

The 20-minute "can I actually read my bot?" audit

Run this before a single live dollar.

Minutes 0–5 — Find the money lines. Locate every spot the bot sizes a position, sets risk, and sends or cancels an order. If you can't find them — or can find them but can't explain them — stop. That alone means you can't run this live yet.

Minutes 5–10 — Read the error handling. Look for catch-all blocks and unchecked results, and ask one question: if this call fails, does the bot stop, alert, or keep trading blind? A bot that trades through its own errors drains quietly.

Minutes 10–15 — Check the brake and the math. Confirm there's a max daily loss and a kill switch you understand. Then hand-check one position-size calculation with real numbers. If "1% risk" doesn't come out to 1%, you found a silent killer.

Minutes 15–20 — Break it on purpose. On demo, disconnect the feed mid-trade, feed a bad symbol, or force a rejected order. If the bot does anything other than fail safe, it isn't ready — no matter how good the backtest looked.

Where this meets what we build

This is exactly why MTR is source you read, not a box you trust.

Anyone can generate a bot and a beautiful curve now — that's the easy part. The hard, honest part is letting you check the work: full MT5 source you can read line by line, a backtest whose assumptions are stated out loud, and a 155-strategy research log that shows what failed, not just what survived. You can run all of it past your own AI auditor before you risk a cent.

That doesn't make MTR safe, and it guarantees nothing — it's a process, not a prophecy, and MTR can lose like any system. But "here's every line, audit it, try to break it" is a fundamentally different offer than "trust this curve from a bot you'll never see inside." One you can verify. The other you can only believe.

Use AI to write code at superhuman speed. Just never wire your account to code you haven't read.

Disclosure

We sell source and evidence you can inspect — not outcomes, not certainty, not a bot that prints. AI code assistants are genuinely powerful, but independent studies find a meaningful share of AI-generated code carries real defects, and that users tend to overestimate its correctness — a dangerous mix when the output is wired to live money. The studies cited here are general code-security research, not trading-bot performance studies; the mapping is simply that code wired to live orders turns silent defects into financial risk. Reading the code, forcing failures, and demanding a kill switch reduce that risk — they don't remove it. Viral "I turned $X into $Y with an AI bot" posts are unverified and survivorship-biased. MTR can lose. Any bot can lose. Backtests are simulations of the past, not promises about the future. The point isn't that AI can't code — it's that you should never deploy money-code you can't read.

One question before you run a single AI-built bot

Don't ask whether the backtest looks good. Ask:

Can I read the line that sends the order, and the line that stops the loss, and explain exactly what each one does?

If the answer is no, you don't have a trading bot. You have a black box with your account number in it.

Let AI write the code. Just never trade a line you can't read.

More from ProEA Lab

Extreme Fear Is Not a Signal.

The fear index just printed the kind of number your feed calls a bottom — and the screenshot is everywhere: the same gauge, the same Buffett quote, the same certainty. Here's what the index actually measures, why the 'every time before' chart is survivorship in a costume, and the four questions that separate a contrarian from a person trading a JPEG.

Jun 12 · ProEA Lab

Green woodcut panic scene: a screaming face in storm clouds above a fear gauge pinned deep in the red, panicked traders below, beside the words 'Extreme fear is not a signal.'

You Wanted to Buy SpaceX Yesterday.

The biggest IPO in the history of money priced and traded while the whole internet watched. What follows is the pre-mortem we wrote before the open — the push alert, the open print, the chase — published unchanged. Score yourself against it, and keep the card for the next time.

Jun 12 · ProEA Lab

Vintage green-and-black engraving of a crowd watching a SpaceX rocket launch beside a candlestick chart, with 'missed it' marked at the bottom and 'today' at the top.

Do Forex EAs Actually Work?

The honest answer from a team that sells one. The regulator numbers nobody quotes, the four ways trading robots actually die, the marketplace-rating trap, and the 20-minute test that separates a tool from a slot machine — all on one page.

Jun 11 · ProEA Lab

Green engraved robot pondering beside the question 'Do forex EAs actually work?', with deliberately modest stats — profit factor 1.07, win rate 47.3% — floating over a candlestick landscape.
You Vibe-Coded a Trading Bot. · ProEA Blog