← back to Bertha
chore(alshi-dash): update 1 file (.js) [+118/-6]
2875eb9f5fc665a75a26411f1718d3c61749a5c4 · 2026-02-16 17:17:31 +0000 · DW Commit Agent
Files touched
Diff
commit 2875eb9f5fc665a75a26411f1718d3c61749a5c4
Author: DW Commit Agent <commit-agent@dw-agents.com>
Date: Mon Feb 16 17:17:31 2026 +0000
chore(alshi-dash): update 1 file (.js) [+118/-6]
---
kalshi-dash/server.js | 124 +++++++++++++++++++++++++++++++++++++++++++++++---
1 file changed, 118 insertions(+), 6 deletions(-)
diff --git a/kalshi-dash/server.js b/kalshi-dash/server.js
index 1f77e88..95e9332 100644
--- a/kalshi-dash/server.js
+++ b/kalshi-dash/server.js
@@ -2458,10 +2458,10 @@ function PortfoliosTab() {
return () => clearInterval(iv);
}, []);
- const stratColors = {aggressive:'#ef4444',conservative:'#3b82f6',weather:'#06b6d4',momentum:'#f59e0b',contrarian:'#8b5cf6',ai_enhanced:'#ec4899',mc_validated:'#a855f7',scalper:'#eab308',patient:'#22c55e',random:'#64748b'};
- const stratEmojis = {aggressive:'\\uD83D\\uDD25',conservative:'\\uD83C\\uDFDB\\uFE0F',weather:'\\u26C8\\uFE0F',momentum:'\\uD83D\\uDE80',contrarian:'\\uD83D\\uDD04',ai_enhanced:'\\uD83E\\uDDE0',mc_validated:'\\uD83C\\uDFB2',scalper:'\\u26A1',patient:'\\uD83D\\uDC22',random:'\\uD83C\\uDFB0'};
- const stratNames = {aggressive:'Alpha',conservative:'Beta',weather:'Storm',momentum:'Momentum',contrarian:'Contrarian',ai_enhanced:'Nova',mc_validated:'Oracle',scalper:'Shark',patient:'Turtle',random:'Wildcard'};
- const stratDesc = {aggressive:'High edge (>15%), low confidence — speculative swings',conservative:'High confidence (>70%) — quality over quantity',weather:'Weather/climate markets only',momentum:'High agreement + articles — follows the trend',contrarian:'BUY_NO only — bets against the crowd',ai_enhanced:'Gemini AI enhanced signals only',mc_validated:'Monte Carlo validated, tight spread',scalper:'Small edges (3-10%) — quantity plays',patient:'Needs everything: conf>80%, MC, 5+ articles',random:'20% random — control group for luck testing'};
+ const stratColors = {aggressive:'#ef4444',conservative:'#3b82f6',weather:'#06b6d4',momentum:'#f59e0b',contrarian:'#8b5cf6',ai_enhanced:'#ec4899',mc_validated:'#a855f7',scalper:'#eab308',patient:'#22c55e',random:'#64748b',penny_pincher:'#94a3b8',spray_pray:'#fb923c',nickel_slots:'#a78bfa',degen_lite:'#f43f5e',politics_junkie:'#0ea5e9',double_down:'#dc2626',volatility_rider:'#14b8a6',whale:'#1d4ed8',yolo:'#e11d48',full_send:'#b91c1c',kelly_criterion:'#059669',sharpe_sniper:'#7c3aed',bayesian_blend:'#0891b2',ensemble_lock:'#c026d3',mean_revert:'#d97706',info_ratio:'#2563eb',anti_fomo:'#16a34a',nightcrawler:'#4c1d95',heatseeker:'#ea580c',quant_core:'#0d9488'};
+ const stratEmojis = {aggressive:'\\uD83D\\uDD25',conservative:'\\uD83C\\uDFDB\\uFE0F',weather:'\\u26C8\\uFE0F',momentum:'\\uD83D\\uDE80',contrarian:'\\uD83D\\uDD04',ai_enhanced:'\\uD83E\\uDDE0',mc_validated:'\\uD83C\\uDFB2',scalper:'\\u26A1',patient:'\\uD83D\\uDC22',random:'\\uD83C\\uDFB0',penny_pincher:'\\uD83E\\uDE99',spray_pray:'\\uD83D\\uDCA6',nickel_slots:'\\uD83C\\uDFB0',degen_lite:'\\uD83D\\uDE08',politics_junkie:'\\uD83C\\uDFDB\\uFE0F',double_down:'\\u2B06\\uFE0F',volatility_rider:'\\uD83C\\uDFC4',whale:'\\uD83D\\uDC33',yolo:'\\uD83E\\uDDE8',full_send:'\\uD83D\\uDCA3',kelly_criterion:'\\uD83C\\uDFB0',sharpe_sniper:'\\uD83C\\uDFAF',bayesian_blend:'\\uD83E\\uDDEE',ensemble_lock:'\\uD83D\\uDD10',mean_revert:'\\u21A9\\uFE0F',info_ratio:'\\uD83D\\uDCCA',anti_fomo:'\\uD83E\\uDDD8',nightcrawler:'\\uD83E\\uDD87',heatseeker:'\\uD83D\\uDD2C',quant_core:'\\u2211'};
+ const stratNames = {aggressive:'Alpha',conservative:'Beta',weather:'Storm',momentum:'Momentum',contrarian:'Contrarian',ai_enhanced:'Nova',mc_validated:'Oracle',scalper:'Shark',patient:'Turtle',random:'Wildcard',penny_pincher:'Penny',spray_pray:'Spray',nickel_slots:'Nickel',degen_lite:'Degen',politics_junkie:'Capitol',double_down:'Doubler',volatility_rider:'Rider',whale:'Moby',yolo:'YOLO',full_send:'Cannon',kelly_criterion:'Kelly',sharpe_sniper:'Sniper',bayesian_blend:'Bayes',ensemble_lock:'Voltron',mean_revert:'Revert',info_ratio:'Signal',anti_fomo:'Zen',nightcrawler:'Shadow',heatseeker:'Heatseek',quant_core:'Quant'};
+ const stratDesc = {aggressive:'High edge (>15%), low confidence — speculative swings',conservative:'High confidence (>70%) — quality over quantity',weather:'Weather/climate markets only',momentum:'High agreement + articles — follows the trend',contrarian:'BUY_NO only — bets against the crowd',ai_enhanced:'Gemini AI enhanced signals only',mc_validated:'Monte Carlo validated, tight spread',scalper:'Small edges (3-10%) — quantity plays',patient:'Needs everything: conf>80%, MC, 5+ articles',random:'20% random — control group for luck testing',penny_pincher:'Any edge >=1% — micro bets, max volume',spray_pray:'Random 50% of all signals — luck vs skill',nickel_slots:'Edge >=2% + conf >=20% — low bar catcher',degen_lite:'Edge >=5%, ignores confidence — pure edge',politics_junkie:'Political markets only — elections/congress',double_down:'Edge >=20% — goes big on massive edges',volatility_rider:'High MC stddev + edge — volatile markets',whale:'Edge >=25% + conf >=60% — rare massive sniper',yolo:'Edge >=30% — max degen, no filters',full_send:'Takes EVERY signal — pipeline profitability test',kelly_criterion:'Kelly fraction: edge/(1+edge) — bankroll math',sharpe_sniper:'Signal-to-noise ratio >2.0 — edge/stddev',bayesian_blend:'Bayesian posterior: conf * evidence * edge',ensemble_lock:'ALL must align: AI + MC + conf + edge + articles',mean_revert:'High volatility + moderate edge — reversion play',info_ratio:'(articles * agreement) / noise — quality intel',anti_fomo:'Small edge + high conf — calm, certain plays',nightcrawler:'BUY_NO + AI + MC — sophisticated shorts',heatseeker:'Multi-factor composite: 40e + 30c + 20a + 10n',quant_core:'Geometric mean sqrt(edge*conf) — pure math'};
if (!data) return <div style={{textAlign:'center',padding:60,color:'var(--muted)'}}>Loading portFAUXlio data...</div>;
@@ -2844,8 +2844,8 @@ function MarketDataTab() {
];
const doubledTicker = tickerItems.concat(tickerItems);
- const stratColors = {aggressive:'#ef4444',conservative:'#3b82f6',weather:'#06b6d4',momentum:'#f59e0b',contrarian:'#8b5cf6',ai_enhanced:'#ec4899',mc_validated:'#a855f7',scalper:'#eab308',patient:'#22c55e',random:'#64748b'};
- const stratEmojis = {aggressive:'\\uD83D\\uDD25',conservative:'\\uD83C\\uDFDB\\uFE0F',weather:'\\u26C8\\uFE0F',momentum:'\\uD83D\\uDE80',contrarian:'\\uD83D\\uDD04',ai_enhanced:'\\uD83E\\uDDE0',mc_validated:'\\uD83C\\uDFB2',scalper:'\\u26A1',patient:'\\uD83D\\uDC22',random:'\\uD83C\\uDFB0'};
+ const stratColors = {aggressive:'#ef4444',conservative:'#3b82f6',weather:'#06b6d4',momentum:'#f59e0b',contrarian:'#8b5cf6',ai_enhanced:'#ec4899',mc_validated:'#a855f7',scalper:'#eab308',patient:'#22c55e',random:'#64748b',penny_pincher:'#94a3b8',spray_pray:'#fb923c',nickel_slots:'#a78bfa',degen_lite:'#f43f5e',politics_junkie:'#0ea5e9',double_down:'#dc2626',volatility_rider:'#14b8a6',whale:'#1d4ed8',yolo:'#e11d48',full_send:'#b91c1c',kelly_criterion:'#059669',sharpe_sniper:'#7c3aed',bayesian_blend:'#0891b2',ensemble_lock:'#c026d3',mean_revert:'#d97706',info_ratio:'#2563eb',anti_fomo:'#16a34a',nightcrawler:'#4c1d95',heatseeker:'#ea580c',quant_core:'#0d9488'};
+ const stratEmojis = {aggressive:'\\uD83D\\uDD25',conservative:'\\uD83C\\uDFDB\\uFE0F',weather:'\\u26C8\\uFE0F',momentum:'\\uD83D\\uDE80',contrarian:'\\uD83D\\uDD04',ai_enhanced:'\\uD83E\\uDDE0',mc_validated:'\\uD83C\\uDFB2',scalper:'\\u26A1',patient:'\\uD83D\\uDC22',random:'\\uD83C\\uDFB0',penny_pincher:'\\uD83E\\uDE99',spray_pray:'\\uD83D\\uDCA6',nickel_slots:'\\uD83C\\uDFB0',degen_lite:'\\uD83D\\uDE08',politics_junkie:'\\uD83C\\uDFDB\\uFE0F',double_down:'\\u2B06\\uFE0F',volatility_rider:'\\uD83C\\uDFC4',whale:'\\uD83D\\uDC33',yolo:'\\uD83E\\uDDE8',full_send:'\\uD83D\\uDCA3',kelly_criterion:'\\uD83C\\uDFB0',sharpe_sniper:'\\uD83C\\uDFAF',bayesian_blend:'\\uD83E\\uDDEE',ensemble_lock:'\\uD83D\\uDD10',mean_revert:'\\u21A9\\uFE0F',info_ratio:'\\uD83D\\uDCCA',anti_fomo:'\\uD83E\\uDDD8',nightcrawler:'\\uD83E\\uDD87',heatseeker:'\\uD83D\\uDD2C',quant_core:'\\u2211'};
return (<div>
{/* ═══ Hero P&L Banner ═══ */}
@@ -6317,6 +6317,94 @@ const PORTFOLIO_STRATEGIES = {
// Wildcard: Random 20% of signals — true control group. Lower chance than before to create separation.
random: (sig) => Math.random() < 0.20,
+
+ // ═══ RISKY PORTFAUXLIOS: Micro → Macro ═══
+
+ // Penny: Any edge >= 1%. Catches everything. Micro bets, max volume.
+ penny_pincher: (sig) => Math.abs(sig.edge) >= 0.01,
+
+ // Spray: Random 50% of ALL signals. Shotgun approach — tests luck vs skill.
+ spray_pray: (sig) => Math.random() < 0.50,
+
+ // Nickel: Low bar (edge >= 2%, conf >= 20%). Catches most signals.
+ nickel_slots: (sig) => Math.abs(sig.edge) >= 0.02 && sig.confidence >= 0.20,
+
+ // Degen: Edge >= 5%, ignores confidence entirely. Pure edge chaser.
+ degen_lite: (sig) => Math.abs(sig.edge) >= 0.05,
+
+ // Politics: Only political markets. KXPRES, KXSEN, KXGOV, KXCONGRESS, KXPRESPERSON, etc.
+ politics_junkie: (sig) => /KXPRES|KXSEN|KXGOV|KXCONG|KXHOUSE|KXELEC|KXPARTY|KXPRESPERSON|political|election|congress|senate|president|governor/i.test((sig.market_id || '') + ' ' + (sig.reasoning || '')),
+
+ // Double: Only high-edge signals (>20%). Goes big when edge is massive.
+ double_down: (sig) => Math.abs(sig.edge) >= 0.20,
+
+ // Night: Only signals with high MC stddev (>8%) — volatile markets others reject.
+ volatility_rider: (sig) => (sig.mc_stddev || 0) >= 0.08 && Math.abs(sig.edge) >= 0.05,
+
+ // Whale: Edge >25% AND confidence >60%. Rare but massive. The sniper.
+ whale: (sig) => Math.abs(sig.edge) >= 0.25 && sig.confidence >= 0.60,
+
+ // YOLO: Edge >30%. Doesn't care about anything else. Max degen.
+ yolo: (sig) => Math.abs(sig.edge) >= 0.30,
+
+ // Full Send: Takes EVERY signal. Max exposure. Tests whether the signal pipeline itself is profitable.
+ full_send: (sig) => true,
+
+ // ═══ CPU-POWERED: Computational / Multi-Factor Strategies ═══
+
+ // Kelly: Only trades when Kelly fraction (edge / odds) > 0.10. Classic bankroll math.
+ // Kelly f* = (bp - q) / b where b=odds, p=prob_win, q=prob_lose. Simplified: edge/(1+edge).
+ kelly_criterion: (sig) => {
+ const e = Math.abs(sig.edge);
+ const kelly = e / (1 + e); // simplified Kelly fraction
+ return kelly >= 0.10 && sig.confidence >= 0.40;
+ },
+
+ // Sharpe: Signal-to-noise ratio. edge / mc_stddev > 2.0. High SNR = clean signal, low noise.
+ sharpe_sniper: (sig) => {
+ const snr = Math.abs(sig.edge) / Math.max(sig.mc_stddev, 0.01);
+ return snr >= 2.0 && sig.mc_consistent;
+ },
+
+ // Bayesian: Combines confidence with article count as evidence weight.
+ // More articles = stronger prior. posterior = conf * (1 - 1/(1+articles)) * edge_factor.
+ bayesian_blend: (sig) => {
+ const evidenceWeight = 1 - 1 / (1 + (sig.num_articles || 0));
+ const posterior = sig.confidence * evidenceWeight * (1 + Math.abs(sig.edge));
+ return posterior >= 0.55;
+ },
+
+ // Ensemble: ALL factors must align — AI + MC + confidence + edge. Maximum consensus required.
+ ensemble_lock: (sig) => sig.ai_enhanced && sig.mc_consistent && sig.confidence >= 0.60 && Math.abs(sig.edge) >= 0.10 && (sig.num_articles || 0) >= 2,
+
+ // Mean Revert: High MC volatility (stddev > 10%) + moderate edge. Bets on reversion to mean.
+ mean_revert: (sig) => (sig.mc_stddev || 0) >= 0.10 && Math.abs(sig.edge) >= 0.08 && Math.abs(sig.edge) <= 0.25,
+
+ // Info Ratio: (articles * agreement) / max(mc_stddev, 0.01). Quality of information per unit noise.
+ info_ratio: (sig) => {
+ const ir = ((sig.num_articles || 0) * (sig.agreement || 0)) / Math.max(sig.mc_stddev, 0.01);
+ return ir >= 15 && Math.abs(sig.edge) >= 0.05;
+ },
+
+ // Anti-FOMO: Small edge (<12%) but HIGH confidence (>75%). Calm, certain, steady plays.
+ anti_fomo: (sig) => Math.abs(sig.edge) >= 0.03 && Math.abs(sig.edge) <= 0.12 && sig.confidence >= 0.75,
+
+ // Nightcrawler: BUY_NO only + AI enhanced + MC consistent. Sophisticated short-bias strategy.
+ nightcrawler: (sig) => sig.direction === 'BUY_NO' && sig.ai_enhanced && sig.mc_consistent,
+
+ // Heatseeker: Composite multi-factor score. Weighted blend of all signal dimensions.
+ // score = edge*40 + conf*30 + agreement*20 + min(articles/10,1)*10. Trade when score > 35.
+ heatseeker: (sig) => {
+ const score = Math.abs(sig.edge) * 40 + sig.confidence * 30 + (sig.agreement || 0) * 20 + Math.min((sig.num_articles || 0) / 10, 1) * 10;
+ return score >= 35;
+ },
+
+ // Quant: Geometric mean of edge and confidence, weighted by MC consistency. Pure math bot.
+ // geoMean = sqrt(edge * conf). Trade when geoMean > 0.15 and MC agrees.
+ quant_core: (sig) => {
+ const geo = Math.sqrt(Math.abs(sig.edge) * Math.max(sig.confidence, 0.001));
+ return geo >= 0.15 && (sig.mc_consistent || sig.confidence >= 0.80);
+ },
};
// Position sizing per strategy — differentiated risk profiles
@@ -6331,6 +6419,30 @@ const PORTFOLIO_SIZING = {
scalper: (edge, conf) => 1, // Always 1 (high volume, small bets)
patient: (edge, conf) => Math.max(3, Math.min(5, Math.round(conf * 6))), // 3-5, big when confident
random: (edge, conf) => Math.max(1, Math.min(3, Math.ceil(Math.random() * 3))), // 1-3 random
+
+ // ═══ RISKY SIZING: Micro → Macro ═══
+ penny_pincher: () => 1, // Always 1 — micro
+ spray_pray: () => Math.ceil(Math.random() * 2), // 1-2 random
+ nickel_slots: () => 1, // Fixed 1
+ degen_lite: (edge) => Math.max(1, Math.min(3, Math.round(Math.abs(edge) * 20))), // 1-3, edge-scaled
+ politics_junkie: (edge, conf) => Math.max(2, Math.min(3, Math.round(conf * 4))), // 2-3, confidence
+ double_down: (edge) => Math.max(4, Math.min(8, Math.round(Math.abs(edge) * 30))), // 4-8, big edge bets
+ volatility_rider: (edge) => Math.max(2, Math.min(4, Math.round(Math.abs(edge) * 25))), // 2-4, edge-weighted
+ whale: (edge, conf) => Math.max(5, Math.min(10, Math.round(conf * 12))), // 5-10, confidence-heavy
+ yolo: (edge) => Math.max(8, Math.min(15, Math.round(Math.abs(edge) * 40))), // 8-15, MAX edge scale
+ full_send: (edge, conf) => Math.max(1, Math.min(25, Math.round(Math.abs(edge) * conf * 50))),// 1-25, edge*conf scaled
+
+ // ═══ CPU-POWERED SIZING: Computational approaches ═══
+ kelly_criterion: (edge, conf) => Math.max(1, Math.min(8, Math.round((edge / (1 + edge)) * 20))), // Kelly fraction scaled to 1-8
+ sharpe_sniper: (edge, conf) => Math.max(2, Math.min(6, Math.round(conf * 8))), // 2-6, conf-weighted (high SNR = trust it)
+ bayesian_blend: (edge, conf) => Math.max(1, Math.min(5, Math.round(Math.sqrt(edge * conf) * 15))), // 1-5, geometric scaling
+ ensemble_lock: (edge, conf) => Math.max(3, Math.min(7, Math.round((edge + conf) * 5))), // 3-7, sum-scaled (all factors aligned)
+ mean_revert: (edge, conf) => Math.max(1, Math.min(4, Math.round(edge * 15))), // 1-4, moderate sizing for reversion plays
+ info_ratio: (edge, conf) => Math.max(2, Math.min(5, Math.round(conf * 6))), // 2-5, confidence-driven
+ anti_fomo: (edge, conf) => Math.max(2, Math.min(4, Math.round(conf * 5))), // 2-4, steady sizing for calm plays
+ nightcrawler: (edge, conf) => Math.max(1, Math.min(3, Math.round(conf * 4))), // 1-3, conservative shorts
+ heatseeker: (edge, conf) => Math.max(2, Math.min(6, Math.round((edge * 20 + conf * 3) / 2))), // 2-6, composite score-driven
+ quant_core: (edge, conf) => Math.max(2, Math.min(8, Math.round(Math.sqrt(edge * conf) * 25))), // 2-8, geometric mean heavy
};
let tradeCounter = 0; // For wildcard portfolio
← a53e7ad chore(alshi-dash): update 1 file (.js) [+209/-56]
·
back to Bertha
·
Ken portFAUXlio: chart integration, sortable columns, SWOT t 87be00a →