Test trading-strategy code (EA, indicator, Python bot, written rules)
test_strategy_codeReads trading-strategy code - an MT5/MT4 Expert Advisor or indicator (.mq5/.mq4/.mqh/.set), a Python trading bot (.py), a TradingView Pine Script (.pine), a cTrader cBot or NinjaTrader strategy in C# (.cs) or rules written in plain words (.txt) - and reports code faults: wrong server clock, modules never called, settings never used, missing include files, unchecked orders, martingale or grid sizing. Without an email it returns this free first read only and stores nothing. With the user's email it also opens a private Strategy Lab and returns its link: TrueTest rebuilds the strategy as plain-English rules, the user checks them on the lab page, then TrueTest backtests its own rebuilt copy on up to 16 years of prices with real costs, runs a luck check and keeps a forward watch. It never runs the uploaded code as given and never places trades. For a finished trade record use check_trading_record; compiled .ex5/.ex4 files cannot be read (test their Strategy Tester report instead). Files are kept up to 90 days; the lab 12 months after the user's last visit (https://truetest.uk/security).
Tool call template
This tool declares no required parameters. Add optional parameters from the input schema as needed.
{
"id": 1,
"jsonrpc": "2.0",
"method": "tools/call",
"params": {
"arguments": {},
"name": "test_strategy_code"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| code | No | One file's text, if you are not using files | |
| name | No | Optional name of the strategy | |
| No | The user's email address, only if the user wants the full backtest: it identifies the user's tests for the luck bar and the 3-free-labs-a-day limit. TrueTest sends no email to it for a request made through an assistant; the lab link comes back in this answer. Leave empty for the free first read alone | ||
| files | No | All the strategy's files together, e.g. the .mq5 plus its .mqh includes and .set settings; at most 20 files and about 1 MB in total through this connector (larger: upload on https://truetest.uk/strategy, up to 5 MB) | |
| symbols | No | Optional symbols to test, e.g. EURUSD, GBPUSD, XAUUSD | |
| ai_draft | No | True only if the user agreed that our AI service may read the code text to draft the rule card. It is run by an outside AI provider, on servers in a country the UK has not approved for data protection, so UK data protection rules may not protect the code the same way there. Emails, links, author lines and secret-looking values are removed first. False: a person writes it, within 2 working days. | |
| filename | No | That one file's name with its extension, e.g. MyEA.mq5. Give it whenever you have it; without it the language is guessed from the text. | |
| timeframe | No | Optional timeframe, e.g. M15 or H1 |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| note | Yes | ||
| files | No | free first read: the files read | |
| stored | No | free first read: always false (nothing is stored) | |
| lab_url | No | with an email: the private Strategy Lab link | |
| summary | Yes | ||
| compiled | No | free first read: true if a compiled file was sent | |
| findings | Yes | ||
| language | No | free first read: the language read | |
| reference | No | with an email: the submission reference | |
| rule_card | No | with an email: who writes the plain-English rule card | |
| read_as_from_text | No | true when a file had no name with a known extension, so its language was guessed from its text (the summary says which) |