TradeMind
An interpretable algorithmic-trading research platform that models market states probabilistically and converts those forecasts into risk-aware analysis and portfolio-allocation recommendations.
What is the distribution of tomorrow’s return, given the recent market state sequence?
Rather than producing a single deterministic “up/down” call, TradeMind discretizes daily returns into a ten-state space and estimates conditional transition probabilities from recent state histories. A variable-order mechanism backs off to shorter contexts when a longer history has never been observed.
The broader engineering question is how to combine those probabilistic forecasts with conventional indicators in a system that remains transparent enough for a user to inspect why a recommendation was produced.
Primary objectives
- Probabilistic next-state forecasting
- Technical-indicator integration
- Risk classification
- Interpretable scoring
- Portfolio allocation
- Interactive visualization
From OHLCV data to state-conditional decisions
The deployed interface exposes the model, not only a recommendation.
Screens from the final report: the ranked watchlist with risk labels, indicators and a suggested allocation, and the empirical state-transition graph behind the forecasts.


An interpretable quantitative stack
Variable-order Markov model
Transition probabilities are estimated from historical state sequences with Laplace smoothing (a small pseudo-count that keeps every transition from having zero probability). The model uses the longest observed context available and backs off when needed.
Monte Carlo horizon forecast
Thousands of simulated state paths propagate the one-step transition model across configurable horizons, producing a distribution rather than one point estimate.
Technical & risk layer
RSI, moving averages, momentum and volatility are combined with the probabilistic forecast in a transparent multi-component scoring and risk-classification layer.
From recent history to a probability distribution.
The model describes each day by one of ten return ranges, for example “0.5% to 1%” or “below −3%”. These are its states, and the forecast is a probability for each of them.
Backoff, with an example
Suppose the last three states were (flat, small gain, large loss). If that exact sequence never occurred in the history, the model tries the last two states, then the last one, and if even that fails it uses the overall frequency of each state. The reason is sparsity: with ten states there are 10k possible histories of length k, about 100,000 for five days, and a two-year window holds only around 500 trading days, so long histories are rarely seen.
Monte Carlo over several days
For a multi-day horizon the model simulates 5,000 possible paths. At each step it draws the next state from the probabilities for the current history. The share of paths that end in each state is the horizon distribution, and the share ending in a positive-return state is the horizon positive probability. This shows the uncertainty around the forecast; it does not make the forecast more accurate than the model's probabilities.

The forecast is evaluated as a probability distribution.
The final system compares predicted next-state probabilities against the realized state using the Brier score: the average squared difference between the predicted probabilities and what happened (1 for the state that occurred, 0 for the others). Lower is better, and it rewards well-calibrated probabilities, not only a correct most-likely state.
Brier = (1/N) Σi Σj (pij − yij)²
The report says the probabilities were better than a naive uniform guess but does not publish a numeric Brier score, so none is quoted here. A forecast that spreads probability evenly over ten states would score 0.9 per prediction.
The application also exposes transition matrices, state distributions and the components of its recommendation score, keeping the modeling process inspectable.
Delivered system
- Automated yfinance data ingestion
- Python / FastAPI backend
- React dashboard
- Directed state-transition visualization
- Multi-asset analysis
- Live deployment
The difficult parts are exactly where quantitative systems usually break.
Non-stationarity
Transition behavior changes across regimes, so probabilities learned from one market environment can become stale.
State-space explosion
Longer context histories can become too sparse. Variable-order backoff is a direct response to this problem.
Trading frictions
The current system does not fully model slippage, transaction costs and short-borrow constraints, all of which matter for real deployment.
Forecast quality is not profitability
Well-calibrated probabilities describe how likely each outcome was; they say nothing by themselves about whether trading on them would be profitable after costs. The page reports model output and its validation, not trading performance.
Backtesting depth
The report identifies a comprehensive multi-cycle backtest against static benchmarks as an important next step before making stronger performance claims.
Related work
Data-Driven Risk-Adjusted Performance Analysis →
Tests when a structural price-path score adds information beyond classical risk ratios, across market regimes.
Stability of Leveraged ETF Performance →
Shows how entry timing and volatility change compounded outcomes, a reminder that path and regime matter.
Final report, source code and live application.
The student final report, the public repository and the deployed web application.
A working research prototype, not a black-box “trading signal.”
TradeMind’s main contribution is the integration of probabilistic state modeling, simulation, transparent diagnostics, and a usable software interface into one end-to-end system.