StockMachinapaper · forward test

A trading system
that shows its work.

StockMachina trades US equities on its own: one momentum strategy, two price forecasters, a language model as second pair of eyes, and thirteen risk checks that run before every order. Every decision is written down so it can be audited and graded later.

29,515
signals evaluated
321
orders filled
183
trades closed
+$4,879
paper P&L

Paper account at Interactive Brokers, 2026-04-15 to 2026-08-26. Roughly one signal in a hundred becomes an order.

What it actually trades

One strategy, live. The rest of the code exists to decide when not to trust it.

  • Momentum on 50 US stocks and ETFs. RSI 14, EMAs 9 and 21, ATR 14, on 1-, 3- or 5-minute bars depending on how liquid the name is.
  • Long or short. A buy needs a momentum score of 0.55 and a trigger; a short needs 0.50 and a stronger case than the long side.
  • Every entry ships with its exits. Stop at 1.5–2× ATR, target at 2–3× ATR, tighter when confidence is lower. Once a trade is one risk unit in profit the stop moves to entry and trails the price.
  • Patient entries. Orders rest as limits at the signal price for up to 30 minutes, then cancel. No chasing.
  • Intraday by default. No entries in the first 40 or last 60 minutes; everything is flat five minutes before the close.
Mode
Paper
Universe
50 symbols
Capital in play
$100,000
Risk per trade
0.5–1.5% by conviction
Open positions
4 max
Daily loss stop
3%
Broker
Interactive Brokers, bracket orders

Follow a signal

Eight gates, always in this order. Pick an example and see where it passes and where it dies. The reasons are the real ones.

Executed. Everything lines up. Order goes out as a resting limit with its stop and target attached.

  1. Data 01

    1-min bars, 0.4 s old. Six months of daily bars loaded.

  2. Strategy 02

    Momentum score 0.68 ≥ 0.55, EMA 9 above 21, RSI 63. Stop 2×ATR, target 3×ATR.

  3. Context 03

    Sentiment +0.2, confluence +0.35. Two sources agree. 1-hour trend up.

  4. Screener 04

    qwen3.8-flash-next: GO. Jev shadow logged GO 0.60 · WEAK 0.36 · SKIP 0.04.

  5. Forecasts 05

    Kronos up, confidence 0.71 → boost +0.10. TimesFM agrees, below boost.

  6. Regime 06

    BULL. VIX 16. Full size.

  7. Risk 07

    13 checks pass. Heat 2.1% + 0.9% ≤ 6%. Third open position of four.

  8. Order 08

    Buy limit at 181.40, stop 178.10, target 186.35. Waits 30 min, then cancels.

1
Data

Live bars from IBKR plus six months of daily bars. Data older than three minutes blocks new entries.

2
Strategy

Momentum proposes the trade with its stop and target already sized to volatility.

3
Context

Vetoes buys on very negative sentiment (Dow Jones, Briefing.com and Finnhub headlines scored by FinBERT), asks two sources to agree, refuses to fight the one-hour trend.

4· fails open
Screener

A local language model (qwen3.8-flash-next) answers GO, WEAK or SKIP. If it is down, the signal passes.

5· fails open
Forecasts

Kronos and TimesFM project five days. They veto when confidently opposed, boost when confidently aligned.

6
Regime

SPY, QQQ and VIX set the weather. Sideways markets block entries; against the trend needs 0.80 confidence; VIX over 25 halves size.

7
Risk

Thirteen checks in sequence. The first failure rejects, and so does any error inside a check.

8
Order & exit

Resting limit with bracket. Break-even at 1R, then a trailing stop at 5 ATR long, 3 ATR short. Flat by 15:55 ET.

Marked gates fail open: if a model is unreachable the system keeps trading without that opinion. Risk, reconciliation and stale data fail closed: when in doubt, no order.

Risk decides last, and decides closed

Thirteen checks, in the order they run. Each one can end the order on its own.

  1. 1Kill switch · file, dashboard or phone
  2. 2Trading hours · 9:30–15:59 ET, weekdays
  3. 3Fresh data · bars under 180 s old
  4. 4Reconciliation · ledger matches the broker
  5. 5Trades per day · 10 max
  6. 6Daily loss · 3% of capital, then stop
  7. 7Position size · 15% long, 10% short, $25k per order
  8. 8Portfolio heat · open risk ≤ 6% of capital
  9. 9Buying power · asked to the broker
  10. 10Correlation · ≤ 50% in one sector
  11. 11Symbol regime · ADX and ATR against chop
  12. 12Bar anomaly · range > 2× its median
  13. 13Protections · 3 losses → 30 min pause; 5% drawdown → halt

Kill switch, three ways. A file on disk, a button on the dashboard, or the phone. Any of them cancels every order and flattens every position.

Sizing is risk-based. Shares are computed from the distance to the stop, capped at 15% of capital per name and $25,000 per order. Fractional Kelly only caps, and only after 30 clean trades.

Capital is the lower number. If the internal ledger and the broker disagree by more than 10%, the system trades on the smaller figure until someone looks.

What changes by itself, and what only measures

Automation is allowed inside a fence. Everything else is telemetry until the data says otherwise.

Changes by itself, inside a fence

  • Nightly reflector. Reads 14 days of trades and may move 12 forecaster thresholds, at most 10% per night and three at a time. Needs 20 closed trades and forecast coverage above 50%.
  • Parameter sweep. 100 Optuna trials on 30 days of bars. A winner is applied only if it beats the baseline by 5% and survives a correction for having picked the best of 100.
  • Symbol memory. A name that keeps losing on one side gets penalized, then blocked, on that side only.

Only measures

  • Screener scorecard. Every GO and SKIP is stored with the price, then graded against what the market did next.
  • Jev, in shadow. A typed-decision model answers the same question as the screener, with calibrated probabilities. Its answers sit next to the LLM's until there are enough pairs to compare.
  • Shadow sources. StockTwits, RSS news, insider filings and an attention detector collect data without touching an order.
  • Bias diagnostics. Revenge trading, overtrading and momentum chasing, detected in the system's own history.

It made money. It has not yet proven why.

183 closed trades over 66 sessions, 2026-04-15 to 2026-08-26, paper account. Duplicated rows removed.

Where the result came from

Shorts · 50+$7,331
Longs · 133−$2,451
Multi-day exits (time) · 43+$6,400
Intraday exits (stop / target / flatten) · 39−$162

The profitable trades were the opposite of the configured mode: shorts that stayed open for days. The intraday machinery loses slightly. That is the main open question of the forward test.

Profit factor · gross wins ÷ gross losses

1.50
all trades
1.08
without the best (+$4,093)
0.85
without the best three

Win rate 47%, median trade −$0.85. Small sample, heavy dependence on a few trades. The bar before any real money: 100 trades with a profit factor above 1.3.

Where it runs

Everything decides and stores on one machine. GPUs on the local network serve the models. Nothing goes to the cloud.

Two DGX Spark
GPU boxes, models only
  • Kronos · price forecast
  • TimesFM · price forecast
  • FinBERT · headline sentiment
  • qwen3.8-flash-next · screener, via vLLM
Mac Studio
the bot, the ledger, the dashboard
  • Trading bot · Python, event-driven
  • IB Gateway · auto-login
  • Dashboard and mobile API
  • 12 scheduled jobs · reports, reflector, sweep, watchdog
  • SQLite ledger · trades, signals, equity
Outside
broker, data, you
  • Interactive Brokers · orders, bars, Dow Jones and Briefing.com news
  • Finnhub, FRED, TradingView · context
  • SEC EDGAR · measurement only
  • iOS app and widget · start, stop, kill switch

Built to be audited, not admired.

This is a research system running on a paper account. It is not financial advice and it is not for sale. The code is private while the forward test runs.

status updated Sep 22, 2026