TrueTestHonest results, on the record.

Backtest a Python trading bot with costs

EA Trade TesterDemo labHow we testAll guidesFor AI agents

Published · methods v2.5 · by TrueTest

You can have a Python trading bot read and tested here without giving us a way to run it. We parse the .py file as text and never import, compile or run it. What our test cannot do: it cannot run your bot's own loop, its data feed or its broker calls, so anything the bot does outside its trading rules (a machine-learning model loaded from a file, a news feed, an order router) is not tested; the lab rebuilds the rules in our engine and says where the copy may differ from your code.

Check my Python bot freeSee a full example first

Drop your .mq5/.mq4 code, a Python bot or an MT5 report on the home page. The first read takes seconds and needs no sign-up; the lab verdict is free too. Only the full report is paid (GBP 49: a PDF to keep plus the interactive report). The price shown is the total price: no VAT is added. TrueTest is not VAT-registered in the UK. We read your code as text and never run it as given; an outside AI service drafts the rule card only if you tick the box (see Security). Not financial advice.

What does the first read look for in Python?

What we findWhy it matters
datetime.now() or time.localtime() with no time zonethe computer's clock decides the trading hours, so they move with the machine and with daylight saving
order_send with no check of the result codefailed orders pass silently and the bot thinks it is in a trade it never opened
except: passevery error is hidden, so a broken part fails without a word
a lot or position size multiplied after tradesthe martingale shape that can wipe an account
what looks like a password or API key in the filewe do not use it; remove it and change it
a syntax errorthe file cannot run as sent

Why is the .py file never run?

Running someone else's code on our servers would be a risk for every other customer, and it would test your bot on its own data feed, not on ours. Reading it as text is enough to find the faults above and to write its rules out as a rule card. You check the card, correct it, and only then is our rebuilt copy tested.

What does "approximate rebuild" mean?

When the rules use something our engine expresses differently (a pending order, an exit on an indicator, a different moving-average type), the lab lists each difference. The result is still shown, labelled approximate, and an approximate rebuild can never reach the verdict REAL. If you send your own trade list as well, the parity check compares our trades with yours.

What does the test add to my own backtest?

Recorded spreads by the hour, commission, overnight fees and a second run with extra costs, up to 16 years of prices for 8 symbols in three periods that never overlap, every calendar year, and the luck bar for the number of versions you tried. Most home-made Python backtests leave out at least one of these.

Related pages

Questions people ask

Do you run my Python code?

No. It is parsed as text only: never imported, compiled or run.

My bot trades crypto. Can you test it?

Our prices are EURUSD, GBPUSD, USDJPY, GBPJPY, EURJPY, AUDUSD, USDCAD, GOLD. A rule written for crypto can be tested on these, but that is a different market.

Can I send several .py files?

Yes, up to 20 files at once, with any settings file and a .txt describing the rules.

Is this financial advice?

No. It describes a test of a rebuilt copy. Not financial advice.