I am developing a forecasting platform, ML Foundry, and a macOS viewer app, ML Trading, on my own so I can trade Japanese stocks short term in my spare time. I built them as a hobby, for my own use. They are not a company service. The system does not use common technical indicators. It builds entry and exit candidates from the output of forecasting models, and I use them to decide my actual trades.

I set up a 1-year backtest environment on top of OSS, and tested and tuned several models whose forecast lines behave differently. Candidates come from an ensemble of these models. In the morning, parallel analysis with 16 scenario methods finishes about 7 minutes after the information cutoff (09:01). After that, the system forecasts entry and exit candidates from the current price every 1 minute.

I have also built a mechanism that runs automated trading in a browser with a tuned OSS model. I do not use it now, because a malfunction would have a large impact. I check candidates in the app and then place orders by hand on my broker’s screen. I do not disclose the trading strategy logic. This article explains the system structure, the speedups, and the design that keeps future information out.

Recording of the whole workflow (4 minutes 16 seconds, no audio). From 0:00 it shows the overall screen layout, from 0:29 a backtest comparison, from 1:29 the intraday chart for 2026-11-11 and teacher-label recording, and from 3:44 Dagster behind the app and the forecast settings screen. Stock names and account information are hidden with a mosaic.

Development time and repeated speed work

ML Trading started as viewing screens built in Grafana. I wanted more freedom to change the display and controls, so I moved it to a Tauri desktop app. The UI took shape in about 1 week. The core of the forecasting platform (ML Foundry), speed improvements and tuning, mechanisms that fit practical trading constraints, and validation on 1 year of backtests took about 2 months.

Grafana dashboard first used for viewing and backtest comparison
The Grafana screen I first used for viewing and comparing backtests. I moved to a Tauri desktop app so I could build the controls and display freely.

The parts I redid many times were optimizing the step that analyzes 16 scenario methods in parallel, rewriting code for CuPy, and backtest validation. For speed, I tried hot-loading models and data before the market opens, precomputing whatever could run ahead of time, and rewriting matrix operations for CuPy so calculations finish faster.

For prototyping and choosing what to keep, I used parallel Git worktrees. I had AI implement several improvement ideas at the same time, each in its own worktree, and also run the validation and write a result report. Then I compared them. I kept the ones that improved speed and results.

Running screens side by side: the ML Trading demo view, GPU monitoring (nvtop) on the Compute server, and the Dagster live forecast log
The screen during a live demo. The ML Trading demo view is on the left, GPU activity on the Compute server is at the top right, and the Dagster live forecast log is at the bottom right (cutoff 09:01, published 09:08, about 7 minutes). Amounts, stock names, and stock codes are hidden.

From the trading-day screen to review and improvement

I check and review trades in ML Trading. Around 1:29 in the video, the toggle at the top right of the screen is set to “Backtest” (バックテスト), and 2026-11-11 is open as the trading day.

The account summary is on the left, the stock list and detail panel are in the middle, and trade candidates are on the right. When you select a stock, the “Intraday chart” (当日チャート) shows that day’s actual prices with the forecasts overlaid.

ML Trading intraday chart. The white actual-price line is shown with quantile bands for the morning and afternoon sessions and forecast lines for each model, with the teacher-label fields at the bottom
The intraday chart around 2:44 in the video. You can compare the white actual-price line with the forecast bands (q10 to q90), whose cutoffs are just after the morning and afternoon sessions open, and the forecast line from each model.

The intraday chart shows forecasts with cutoffs just after the morning session (09:01) and the afternoon session (12:31) open. You can follow how the actual price moved across the lunch break, in 1-minute steps or as candlesticks. Widgets can be added to or removed from the detail panel. You can lay out a 20-trading-day forecast on daily bars, peer PER, margin balances, futures, and more, and save the layout.

Add-widget menu for stock information, listing a 7-day forecast, 20-day forecast, intraday chart, intraday analysis, margin balance, and more
The "Add widget" (ウィジェット追加) menu. You can pick only the indicators you need and save the layout (stock names and values in the background are hidden).
20-trading-day forecast chart overlaying the white actual line, yellow scenario lines, a blue q10 to q90 forecast band, and the q50 center line
Daily chart of the 20-trading-day forecast (price scale and dates are omitted).

Reopening the same trading day a few days later shows the same results. The app reads back the forecast records tied to the original run ID and cutoff time instead of recalculating on each view. For past days with no collected 1-minute bar records, it switches automatically to 1-minute bar snapshots built from the finalized execution data available after the close.

When a promising candidate appears, I use it for real trades in my spare time. Since around November the market has felt rough to me, so I keep working to make the backtests and candidates more resilient.

Most of the analysis data can be passed to AI as typed data through MCP. Lately I give the analysis data to AI, have it propose improvements, and take them through validation and reporting in parallel worktrees. This is how I look for combinations of models and strategies whose results hold up when the market changes. The mechanism below the chart that records my own entries and exits as teacher labels is also part of this improvement work.

Design choices

Separate systems for producing (ML Foundry) and viewing (ML Trading)

I split the roles into 2 systems so that collection and forecasting keep running during trading even when my Mac is not open, and so that heavy backtests do not get in the way of using the app.

RoleML Foundry (forecasting platform)ML Trading (macOS viewer app)
Where it runsLinux servers in my homelabMy local Mac (built with Tauri 2)
ResponsibilitiesData collection, parallel analysis and inference, backtestsChart display, candidate review, paper trading, teacher-label recording, CSV import
Data handlingWrites to and stores data in PostgreSQL, MinIO, and NATSRead-only access to PostgreSQL and a local cache
Inference and ordersInference in network-isolated GPU containers (no order placement)No inference and no automated orders

ML Trading uses only read-only transactions against the database. It caches up to 32 backtest comparison results locally to keep screen switching light. AI agents can read summaries and teacher labels through an MCP server that runs as a separate process.

Keeping forecasts, actuals, backtests, paper trades, and executions apart

If data finalized later or practice orders get mixed with real forecasts or account records, correct validation is not possible. ML Trading keeps the following 5 apart through the mode at the top of the screen and where each is stored.

CategoryWhat it recordsBoundary that keeps it separate
ForecastPrice ranges and paths calculated only from what was available at the information cutoffCutoff time, publish time, and run ID are fixed and never overwritten later
ActualCurrent prices during trading hours, or finalized 1-minute bars after the closeKept as data separate from forecasts and only overlaid on screen
BacktestResults of replaying the shared execution calculation on saved forecasts and actualsAlways records whether data was observed live or reconstructed from past data
Paper trading (demo)Practice virtual trades tried locally against live candidatesConfined to a dedicated local account and never touches live account records
Executions (live)Trades that filled after I placed orders by hand on my broker’s screenExecutions are never inferred from forecasts. They are confirmed only when the broker’s CSV is imported

In “Live” (本番) mode, the app only notifies and displays candidates, and it stores data separately from the virtual trades in “Demo” (デモ) mode. Actual share holdings and trade history are confirmed only when a CSV file exported from the broker is imported.

Time constraints and offline execution that keep future information out

I use a paid J-Quants plan for forecasting and training. Same-day price data is normalized by my own collection process, and the charts are also built from J-Quants data.

If future information leaks into past forecasts in a backtest, only the apparent performance improves. ML Foundry applies 4 ordering constraints to incoming data, covering the time it became publishable, the time it was fetched, the time it was stored, and the time it was delivered. At each normalization stage, SQL tests also reject data whose order is broken.

When forecasts are reconstructed retroactively from past data, the system records that distinction and the reason, so they do not mix with real-time observations. Writes to object storage or local files cannot overwrite an existing key. The system also records hashes of the code and settings, and stops a backtest if a hash changes partway through.

ML Foundry workspace running on Dagster, with a selector for the quantile-band model, the 16 scenario methods, and toggles for auxiliary inputs
The ML Foundry settings screen around 4:00 in the video. In Dagster, you select the foundation models, the 16 scenario methods, and auxiliary inputs such as futures and VI, and then start forecasts or backtests.

Forecasts combine 3 time-series foundation models (TimesFM 2.5, Chronos-2, Timestral-209M) with 16 scenario methods. The GPU containers that run inference are cut off from external networks, and the model weight hashes are pinned. Backtests are started from the same screen. They use the same execution and cost calculator as live runs, so validation and real operation follow the same calculation rules.

Operating constraints and where the design applies

Because I place orders by hand, the app has to absorb differences in character encoding and format between the broker’s execution history CSV (which arrives a few days late) and the same-day execution CSV. Also, the macOS local network permission can block connections from outside the app. So tasks such as teacher-label sync can also run from the terminal or a batch job.

To keep experimenting with the forecasting logic, I set up boundaries that keep future information out, comparison of improvement ideas in parallel worktrees, and a review environment that separates live use from validation. The same approach can be used when developing data platforms for business systems or AI integration.