๐Ÿ“Œ
TL;DR. Every trade you close is logged. The system computes R = P&L / stop-distance, then adjusts setup weights by realized expectancy. Multipliers split by sector ร— day-of-week ร— hold band ร— VIX regime. After ~50 closed trades the weights are personalized to your edge. Surfaces as learn-adjusted scores on every Play, Signal, Trade-of-the-Day, and AI Scout idea.
๐Ÿ” The Learning Pipeline
๐Ÿ“
Log Trade
Journal / Paper / Wizard
โ†’
๐Ÿ“Š
Close + R-Multiple
P/L รท stop dist
โ†’
โš–
Rebalance Weights
setup ร— context
โ†‘feeds backโ†‘
๐ŸŽฏ
Plays / Signals
show adjusted score
โ†
๐Ÿงฎ
Score Application
raw ร— base ร— conditional
Each cycle improves the next score. The longer you trade with it, the more personalized it gets.
Phase 1

๐Ÿ“ Recording Every Trade

Every trade you ever close gets logged to your browser's localStorage under the key bpleone_learn_v1. The schema is dead simple:

{
  id: 't_1778..._abc',
  ts: 1778788000000,          // open time
  closedTs: 1778799600000,    // close time
  symbol: 'NVDA',
  setup: 'macd-cross',        // or 'bull-flag', 'cup-handle', etc.
  sector: 'Semiconductors',
  bias: 'bull',               // or 'bear'
  vixRegime: 'low',           // captured at OPEN time
  score: 78,                  // the raw score when entered
  entry: 138.27,
  stop: 133.80,
  exit: 143.50,               // filled at this price
  pnl: 521.00,
  R: 1.17,                    // โ† THE key metric: pnl / |entry โˆ’ stop|
  result: 'win',              // 'win' if R โ‰ฅ 0
  holdDays: 1.3,
  closeReason: 'target'       // 'target', 'stop', 'manual', 'trail'
}

Where trades come from:

Seeded with 240 simulated trades so the system has signal from minute one. You can wipe with Settings โ†’ Reset โ†’ Edge Analytics, and start clean. Real trades dilute the seeds rapidly โ€” after ~50 real closes, the weights start reflecting your edge.
Phase 2

โš– Base Setup Weights โ€” Updated on Every Close

Each setup type accumulates a list of R-multiples from your closed trades. The base weight is then:

weight = clamp(1 + avgR ร— 0.3, 0.5, 1.6)

Three real worked examples:

macd-cross ยท 12 closed trades ยท sum of R = +7.2 ยท avg = +0.60R
weight = 1 + 0.60 ร— 0.3 = 1.18ร— (boost)
bull-flag ยท 8 closed trades ยท sum of R = โˆ’2.4 ยท avg = โˆ’0.30R
weight = 1 + (โˆ’0.30) ร— 0.3 = 0.91ร— (slight fade)
unusual-put ยท 5 closed trades ยท sum of R = โˆ’4.0 ยท avg = โˆ’0.80R
weight = 1 + (โˆ’0.80) ร— 0.3 = 0.76ร— (heavy fade)

Clamped to [0.5, 1.6] so the system can amplify or dampen without flipping direction. A bad setup is faded, not made bullish; a good setup is boosted, not made infinite.

Triggered by: Learn.closeTrade(id, exit, reason) โ†’ automatically calls Learn.rebalanceWeights() after every close.

Phase 3

๐ŸŽš Conditional Weights โ€” by Sector ร— DoW ร— Regime

Base weights tell you "macd-cross is good for me." Conditional weights tell you "macd-cross is good for me in Tech on Tuesdays in low-VIX regimes." The same math, partitioned:

// 4 dimensions tracked simultaneously
ctx = {
  sector: 'Semiconductors',
  dow:    'Tue',                // Mon/Tue/Wed/Thu/Fri
  hold:   '1โ€“3d',               // Intraday / 1-3d / 4-9d / 10-29d / 30d+
  bias:   'bull',
  regime: 'low'                 // low/normal/elevated/panic (VIX bucket)
}

// Per (setup ร— dim ร— bucket) with n โ‰ฅ 3:
adj = clamp(1 + expectancy ร— 0.18, 0.7, 1.35)

Conditional adjustments are gentler (0.18 vs base 0.30) and tighter-clamped โ€” they refine the base, they don't flip it.

macd-cross in Tech โ€” 14 trades, avg +0.9R
โ†’ adj = 1 + 0.9 ร— 0.18 = 1.16ร—
macd-cross on Friday โ€” 6 trades, avg โˆ’0.4R
โ†’ adj = 1 + (โˆ’0.4) ร— 0.18 = 0.93ร—

Triggered by: Learn.rebalanceConditional() โ€” runs alongside rebalanceWeights after every close.

Phase 4

๐Ÿงฎ Score Application โ€” How the Brain Surfaces Insight

When a new setup appears (a momentum scan, an unusual call sweep, an AI Scout idea), the raw heuristic score gets multiplied by base ร— conditional:

// Live code from learn.js
function adjustedScoreCtx(rawScore, type, ctx) {
  const base = state.weights[type] || 1.0;
  let mult = base;
  for (const dim in ctx) {
    const adj = state.conditional[type]?.[dim]?.[ctx[dim]]?.adj;
    if (adj) mult *= adj;
  }
  return clamp(0, 100, Math.round(rawScore ร— mult));
}

Worked example โ€” a fresh macd-cross signal on NVDA today:

raw      = 72   (MACD bullish + 50DMA reclaim + 1.84ร— volume)
base     = 1.18ร— (macd-cross has +0.6R avg in your history)
sector   = 1.16ร— (Tech has been favored for this setup)
dow      = 0.93ร— (Friday slightly worse)
regime   = 1.06ร— (low-VIX regimes have edge for you)
hold     = 1.04ร— (1-3d holds are your sweet spot)
โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€
final    = 72 ร— 1.18 ร— 1.16 ร— 0.93 ร— 1.06 ร— 1.04
         = 95   (clamped to 100)

You see this score on: Plays of the Day, Live Signals, Trade of the Day, Ticker Focus, AI Scout (Claude sees the learned weights and uses them in its reasoning), and Trade Plan Generator.

You can call it from the browser console anytime:

Learn.explain('macd-cross', {
  sector: 'Tech',
  dow: 'Thu',
  regime: 'low'
});
// โ†’ array of human-readable reasons + impact
Workflow

๐ŸŽฏ How To Actually Train It

The brain only gets smart if you feed it. Here's the 4-week shakedown to get the weights tuned to your edge:

  1. Week 1 โ€” Paper trade aggressively. Hit paper-trade.html daily during market hours. Aim for 3-5 trades a day. Every close auto-logs.
  2. Week 2 โ€” Add real (small) trades. If you find a setup with high learn-adjusted score and your discipline is clear, take it. Log it via journal.html the moment you close.
  3. Week 3 โ€” Audit the brain. Open learn-dashboard.html at week-end. Look at base weights โ€” anything fading hard? Anything boosted? Match it against your gut.
  4. Week 4 โ€” Trust + size up. By now you have ~80-100 closed trades. The conditional weights start telling you specific facts ("bull-flag on Mondays underperforms by 0.3R for me"). Trust the brain, size up the high-score setups, fade the low-score ones.
Rule of thumb on data volume:
โ€ข 0-20 trades โ†’ ignore the score, you're still seeded
โ€ข 20-50 trades โ†’ base weights starting to matter
โ€ข 50-100 trades โ†’ base + sector + DoW have signal
โ€ข 100+ trades โ†’ all 4 dimensions reliable, this is YOUR edge model

What to journal carefully: setup type (use the dropdown โ€” don't make up new ones), sector, entry, stop (this defines R!), exit, and close reason. The R-multiple is the entire engine โ€” if you don't log the stop accurately, the system can't learn.

Privacy

๐Ÿ”’ Where Your Data Lives

Everything is in your browser's localStorage. We don't have a backend, we don't see your trades, we don't track you. Your edge is yours.

localStorage keys used by the learn engine:
  bpleone_learn_v1        โ€” trades + signals + weights + conditional
  bpleone_journal         โ€” manual journal entries
  bpleone_paper_v1        โ€” paper-trade positions & fills
  bpleone_mindset_v1      โ€” daily check-ins (sleep, tilt, etc.)
  bpleone_watchlists      โ€” your saved symbol lists
  bpleone_alerts          โ€” your custom alerts

Backup: Settings โ†’ Export / Reset โ†’ "Download Backup" โ†’ JSON file you can save anywhere.
Restore: Same page โ†’ "Import Backup".
Reset: Same page โ†’ Danger Zone โ†’ reset journal, learn, watchlists individually.

Honest Caveat

โš  This is NOT a Black-Box ML Model

The bpleone "brain" is not a neural network. It's an expectancy-tracking heuristic with conditional bucketing. Here's what that means for you:

  • โœ… Transparent โ€” every adjustment is auditable. Call Learn.explain() and you see the multipliers.
  • โœ… Fast โ€” scoring is microseconds. No model loading, no inference cost.
  • โœ… Personalized โ€” your trades shape your weights.
  • โš  Doesn't discover novel patterns โ€” it can't tell you "macd-cross combined with 200DMA reclaim AND > 2ร— volume" is better than either alone. It scores what you tell it to score.
  • โš  Requires honest journaling โ€” garbage in = garbage out. If your setups aren't labeled accurately, the weights drift to noise.
  • โš  Doesn't backtest โ€” it's forward-only. The seeded 240 trades are a cold start, not history.

If you want true ML (gradient boosting, ensemble models, walk-forward analysis), that's a roadmap item. For now this engine is honest, fast, and personalized โ€” which beats most retail "AI" products that just rebrand RSI as "neural pattern detection."

๐Ÿš€ Start training the brain today

Open paper-trade.html, take 3 setups, close them out. Then come back and check the learn dashboard. You'll see your weights move.

๐ŸŽฎ Paper Trade Now ๐Ÿง  See the Brain ๐Ÿ““ Open Journal