A trading strategy can finish a backtest with a profit while hiding individual trades that experienced severe temporary drawdown before recovering. Standard reports emphasize final outcomes, while the path between entry and exit may contain important information about risk.
TradePath AI was inspired by a real BTCUSD cTrader backtest containing several unusually deep drawdown patterns that we call “teeth.”
The goal of the project is to make those hidden trade paths easier to inspect without changing the trading strategy before the evidence is understood.
What it does
The current public prototype is a standalone C# and .NET command-line analyzer.
It reads a text log containing structured PAIN12 RECOVERY DIAG records that were previously generated by private diagnostic instrumentation inside a cTrader cBot.
The public analyzer does not currently:
- parse
report.html, - reconstruct every trade directly from raw cTrader history,
- generate the Pain12 records by itself,
- contain the commercial trading strategy.
For each structured Pain12 record, the analyzer reads:
- position ID,
- trade direction and status,
- pips and net result at Pain12,
- worst and best movement after Pain12,
- additional drawdown after Pain12,
- whether the position returned to breakeven,
- time to breakeven and worst drawdown,
- final or current net result.
The analyzer then:
- separates records by an additional-drawdown threshold,
- reports threshold breaches and non-breaches,
- calculates combined NetAt12,
- calculates the combined final or current result,
- reports recovery after Pain12,
- prints detailed result tables,
- exports the analysis to
tradepath-summary.csv.
The default additional-drawdown threshold is 6,000 pips, but a different threshold can be supplied when the program is started.
Demonstration dataset
The public sample contains 13 structured Pain12 records.
Using the default 6,000-pip threshold, the analyzer reports:
- 7 threshold breaches,
- 6 non-breaches,
- combined NetAt12 of -38.76 EUR,
- combined final or current result of -3.97 EUR,
- recovery after Pain12 in 13 out of 13 records.
These results show that, in this specific dataset, immediately closing every affected position at Pain12 would have produced a worse combined result than the recorded final or current outcomes.
They also show that the seven largest drawdown cases continued at least 6,480 pips farther against the position, while the remaining six cases continued no more than 4,600 pips farther.
These findings apply only to the included sample and are not presented as a universal trading rule.
Pain12
In the original private diagnostic workflow, Pain12 was defined as a position reaching at least 2,000 negative pips after 12 M5 candles.
The public analyzer does not calculate this event from market data. It analyzes structured records that were already generated after the Pain12 condition occurred.
Pain12 is treated as a diagnostic alarm, not as an automatic instruction to close a position.
How we built it
The project was developed in two separate parts.
The first part was private diagnostic instrumentation inside an existing commercial cTrader cBot. Its purpose was to observe trade behavior and produce structured log records without changing entry, exit or position-management logic.
The second part is the public standalone analyzer included in this repository. It safely processes the exported Pain12 records without exposing the commercial strategy, licensing system or trading logic.
Codex was used as an engineering partner to:
- review the existing C# code,
- design passive diagnostic structures,
- identify exact code insertion points,
- introduce one isolated change at a time,
- preserve the original trading behavior,
- build and validate the standalone analyzer,
- test the parsing and CSV-export workflow.
The private diagnostic additions were compiled and checked against a control backtest after each change.
The control backtest retained the same trading results:
- Net Profit: 68.83 EUR
- Ending Balance: 1081.25 EUR
- Ending Equity: 1068.83 EUR
GPT-5.6 was used to:
- review the generated diagnostic logs,
- compare groups of Pain12 records,
- interpret the results,
- challenge premature conclusions,
- explain the findings in plain language,
- help document the project accurately.
The current public executable is deterministic and does not call an AI model while it is running. Codex and GPT-5.6 were used during engineering, analysis and documentation.
Challenges
The first challenge was collecting detailed diagnostic information without affecting order execution, stop loss, take profit, position management or backtest results.
The second challenge was separating the safe diagnostic analyzer from the private commercial trading code.
The third challenge was avoiding conclusions based only on final trade outcomes. A position that eventually returns near breakeven may still expose the account to a severe temporary loss.
The project therefore separates observation from decision-making.
What we learned
In this sample, the Pain12 warning alone was not sufficient to identify the seven deepest drawdown cases.
The additional path after Pain12 created a clearer separation between the largest drawdown cases and the remaining records.
This suggests that post-entry path analysis can reveal risk that is hidden by final trade results alone.
It does not prove that the current thresholds will work for other strategies, symbols, brokers or market periods.
What's next
Future versions may add:
- direct parsing of raw cTrader logs and reports,
- automatic reconstruction of complete trade paths,
- a graphical interface for uploading files,
- visual timelines for individual trades,
- comparison with normal trades,
- additional configurable diagnostic thresholds,
- plain-language AI-assisted explanations,
- exportable reports for developers.
These functions are planned and are not part of the current public prototype.
TradePath AI is a diagnostic research and developer tool.
It is not a trading signal, does not provide financial advice, does not guarantee profits and does not automatically change or close trades.
Log in or sign up for Devpost to join the conversation.