Inspiration

Trading strategy reports often count every partial exit as an independent trade. A single setup with multiple profit targets can therefore appear as several unrelated trades, distorting win rate, expectancy, drawdown, and the engineering conclusions drawn from the results.

StrategyPilot AI was inspired by the need for a disciplined audit workflow that separates verified calculations from AI interpretation. The goal is not to predict trades. It is to help developers convert trading-result exports into reproducible evidence that can guide testing and software improvements.

What it does

StrategyPilot AI converts a raw trading-result CSV into a deterministic, setup-level engineering audit.

The application can:

  • validate uploaded trade rows
  • reconstruct complete setups from multi-leg exits
  • calculate setup-level win rate, net profit, profit factor, expectancy, gross profit, gross loss, drawdown, average winner, average loser, and win/loss ratio
  • visualize cumulative setup equity
  • visualize drawdown from the running equity peak
  • analyze results by direction and trading session
  • display a traceable evidence table and reconstructed setup ledger
  • identify measurable engineering concerns
  • generate prioritized engineering tasks
  • define regression checks for future strategy versions
  • export the completed audit as Markdown

The included public sample contains 31 trade legs that are reconstructed into 24 complete setups.

How it works

The architecture deliberately separates deterministic evidence from model interpretation.

Python performs validation, reconstruction, grouping, chronological equity calculations, drawdown analysis, and all verified performance metrics. These calculations do not depend on a language model.

The optional GPT audit path receives aggregate evidence JSON rather than raw trade rows. GPT can interpret the verified evidence and help organize engineering findings, but it does not calculate or replace the deterministic metric values.

The public deployment runs safely in offline Demo Audit mode without requiring an API key. This allows judges to test the complete deterministic workflow immediately.

Deterministic evidence architecture

The audit pipeline follows these stages:

  1. Load the included sample or upload a compatible CSV.
  2. Validate the trade-leg schema and numeric values.
  3. Group related legs into complete setups.
  4. Calculate setup-level performance metrics.
  5. Construct chronological equity and drawdown series.
  6. Segment results by direction and session.
  7. Create evidence-backed engineering findings.
  8. Produce prioritized tasks and regression checks.
  9. Export the audit as a Markdown report.

This design makes the results reproducible and testable. The same input produces the same verified metrics.

How I used Codex and GPT-5.6

Codex was used as the primary implementation partner throughout the project.

It helped with:

  • application architecture
  • setup-reconstruction logic
  • deterministic metric implementation
  • Streamlit interface development
  • chart and evidence-table integration
  • automated tests
  • debugging and edge-case correction
  • currency-formatting consistency
  • dark-theme visual QA
  • security and repository review
  • GitHub publication
  • Streamlit deployment validation

I retained responsibility for the product requirements, the deterministic-versus-AI architecture, acceptance criteria, testing decisions, release scope, and final QA.

GPT-5.6 also helped reason through the product positioning, evidence model, usability requirements, demo structure, and release validation. The final application maintains a strict boundary: Python calculates the verified evidence, while GPT interpretation remains optional.

Challenges I ran into

The most important challenge was avoiding misleading trade statistics when one setup contained multiple exit legs. The application needed to reconstruct the complete setup before calculating performance.

Other challenges included:

  • preserving chronological order for equity and drawdown
  • formatting negative monetary values consistently
  • distinguishing gross-loss and drawdown magnitudes clearly
  • maintaining chart readability in a dark Streamlit theme
  • making the application useful without exposing an API key
  • keeping the public repository free of private trading data and proprietary strategy logic

These issues were addressed through deterministic fixtures, automated tests, manual CSV-upload testing, visual QA, security review, and anonymous deployment testing.

Accomplishments

The completed public release includes:

  • 20 passing automated tests
  • deterministic reconstruction of 31 sample legs into 24 setups
  • setup-level metrics and diagnostic charts
  • evidence-backed engineering findings
  • prioritized development tasks
  • regression checks
  • Markdown audit export
  • a public Streamlit deployment
  • a public GitHub repository
  • no embedded secrets or private trading data

What I learned

The project reinforced that AI is most reliable in an engineering workflow when deterministic software establishes the factual baseline first.

A language model can help interpret evidence, organize findings, and accelerate development, but verified calculations should remain reproducible, inspectable, and covered by regression tests.

Supported platforms and installation

The hosted application works in a modern desktop web browser.

For local use, the project supports Python 3.10 or later on Windows, macOS, and Linux.

Local installation:

  1. Clone the public repository.
  2. Create and activate a Python virtual environment.
  3. Install the dependencies from requirements.txt.
  4. Run streamlit run app.py.
  5. Open the local Streamlit address shown in the terminal.

No OpenAI API key is required to run the deterministic sample audit. Model-backed interpretation is optional.

What's next

Potential future development includes additional import adapters, saved comparison baselines, expanded regression reporting, and controlled integrations with strategy-research workflows.

These are roadmap opportunities rather than unfinished requirements. The submitted deterministic audit workflow is complete and publicly testable.

Built With

Share this project:

Updates