@timmeck/trading-brain 2.31.81 → 2.31.82
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md
CHANGED
|
@@ -5,9 +5,9 @@
|
|
|
5
5
|
[](LICENSE)
|
|
6
6
|
[](https://github.com/timmeck/brain-ecosystem)
|
|
7
7
|
|
|
8
|
-
**Adaptive Trading Intelligence & Signal Learning System for Claude Code — 181 MCP Tools,
|
|
8
|
+
**Adaptive Trading Intelligence & Signal Learning System for Claude Code — 181 MCP Tools, 117+ Engines**
|
|
9
9
|
|
|
10
|
-
Trading Brain is an MCP server that gives Claude Code a persistent trading memory. It learns from every trade outcome — strengthening connections between signals, strategies, and results through a Hebbian synapse network ("signals that win together wire together"). Paper trading with live market data (CoinGecko, Yahoo Finance, CCXT WebSocket). Over time, it develops statistical confidence in signal combinations, adapts calibration parameters, and runs
|
|
10
|
+
Trading Brain is an MCP server that gives Claude Code a persistent trading memory. It learns from every trade outcome — strengthening connections between signals, strategies, and results through a Hebbian synapse network ("signals that win together wire together"). Paper trading with live market data (CoinGecko, Yahoo Finance, CCXT WebSocket). Over time, it develops statistical confidence in signal combinations, adapts calibration parameters, and runs 117+ autonomous engines in a 68-step feedback cycle to discover patterns, reason about causality, evolve strategies genetically, and improve itself. Full intelligence suite: RAG, Knowledge Graph, feedback learning, tool tracking, user model, proactive suggestions. Multi-provider LLM (Anthropic + Ollama). PortfolioOptimizer with Kelly criterion position sizing and HHI diversification scoring. StrategyMutator for evolutionary strategy breeding (mutation, crossover, tournament selection). Engine Governance with formal profiles, runtime influence tracking, 4 anti-pattern detectors, and active control (throttle/cooldown/isolate/escalate/restore). 518 tests. Workflow checkpointing, structured LLM output, observability tracing, agent training, dynamic tool scoping.
|
|
11
11
|
|
|
12
12
|
## Quick Start
|
|
13
13
|
|
|
@@ -52,7 +52,7 @@ That's it. One command configures MCP, hooks, and starts the daemon.
|
|
|
52
52
|
- **Rate Limiting** — Per-hour and per-day token budgets with automatic throttling
|
|
53
53
|
- **Usage Tracking** — Calls, tokens, latency, cache hit rate, cost tracking
|
|
54
54
|
|
|
55
|
-
###
|
|
55
|
+
### 117+ Autonomous Engines
|
|
56
56
|
|
|
57
57
|
The ResearchOrchestrator runs a 51-step feedback cycle every 5 minutes:
|
|
58
58
|
|
|
@@ -87,7 +87,7 @@ DataMiner bootstraps all historical trades into engines at startup.
|
|
|
87
87
|
|
|
88
88
|
| Dashboard | Port | What It Shows |
|
|
89
89
|
|-----------|------|--------------|
|
|
90
|
-
| **Command Center** | 7790 |
|
|
90
|
+
| **Command Center** | 7790 | 13-page: Overview, Entity, Learning, Trading, Marketing, Intelligence, Cross-Brain, Activity, Debates, Desires, Forge, Infrastructure, Progress |
|
|
91
91
|
|
|
92
92
|
### Memory & Sessions
|
|
93
93
|
- **Persistent Memory** — Preferences, decisions, context, facts, goals, lessons
|
|
@@ -99,7 +99,7 @@ DataMiner bootstraps all historical trades into engines at startup.
|
|
|
99
99
|
- **MCP HTTP/SSE** — For Cursor, Windsurf, Cline, Continue (port 7780)
|
|
100
100
|
- **REST API** — Full HTTP API on port 7779
|
|
101
101
|
|
|
102
|
-
## MCP Tools (
|
|
102
|
+
## MCP Tools (181 tools)
|
|
103
103
|
|
|
104
104
|
**Trading Core**: trading_record_outcome, trading_signal_weights, trading_signal_confidence, trading_explain_signal, trading_dca_multiplier, trading_grid_params, trading_calibration, trading_calibration_history, trading_rules, trading_chains, trading_query, trading_learn, trading_reset
|
|
105
105
|
|
|
@@ -162,7 +162,7 @@ trading import <file> Import trades from JSON
|
|
|
162
162
|
| [Brain](../brain) | Error memory, code intelligence, full autonomy & self-modification | 7777 / 7778 / 7790 |
|
|
163
163
|
| **Trading Brain** (this) | Adaptive trading intelligence with signal learning & paper trading | **7779** / 7780 |
|
|
164
164
|
| [Marketing Brain](../marketing-brain) | Content strategy, social engagement & cross-platform optimization | 7781 / 7782 / 7783 |
|
|
165
|
-
| [Brain Core](../brain-core) | Shared infrastructure —
|
|
165
|
+
| [Brain Core](../brain-core) | Shared infrastructure — 117+ engines | — |
|
|
166
166
|
|
|
167
167
|
## Support
|
|
168
168
|
|
|
@@ -1,7 +1,11 @@
|
|
|
1
1
|
import type { SynapseRecord } from '../db/repositories/synapse.repository.js';
|
|
2
2
|
/**
|
|
3
3
|
* Hebbian strengthen — "neurons that fire together wire together"
|
|
4
|
-
*
|
|
4
|
+
* Bounded multiplicative: w_new = min(1.0, w_old * (1 + learningRate))
|
|
5
|
+
*
|
|
6
|
+
* Unlike the old additive formula (w + (1-w)*rate) which saturated to ~1.0
|
|
7
|
+
* too fast, multiplicative growth preserves relative weight differences
|
|
8
|
+
* and doesn't collapse all synapses to the ceiling.
|
|
5
9
|
*/
|
|
6
10
|
export declare function strengthen(synapse: Omit<SynapseRecord, 'created_at'>, learningRate: number): void;
|
|
7
11
|
/**
|
package/dist/synapses/hebbian.js
CHANGED
|
@@ -1,11 +1,15 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* Hebbian strengthen — "neurons that fire together wire together"
|
|
3
|
-
*
|
|
3
|
+
* Bounded multiplicative: w_new = min(1.0, w_old * (1 + learningRate))
|
|
4
|
+
*
|
|
5
|
+
* Unlike the old additive formula (w + (1-w)*rate) which saturated to ~1.0
|
|
6
|
+
* too fast, multiplicative growth preserves relative weight differences
|
|
7
|
+
* and doesn't collapse all synapses to the ceiling.
|
|
4
8
|
*/
|
|
5
9
|
export function strengthen(synapse, learningRate) {
|
|
6
10
|
synapse.wins++;
|
|
7
11
|
synapse.activations++;
|
|
8
|
-
synapse.weight
|
|
12
|
+
synapse.weight = Math.min(1.0, synapse.weight * (1 + learningRate));
|
|
9
13
|
synapse.last_activated = new Date().toISOString();
|
|
10
14
|
}
|
|
11
15
|
/**
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"hebbian.js","sourceRoot":"","sources":["../../src/synapses/hebbian.ts"],"names":[],"mappings":"AAEA
|
|
1
|
+
{"version":3,"file":"hebbian.js","sourceRoot":"","sources":["../../src/synapses/hebbian.ts"],"names":[],"mappings":"AAEA;;;;;;;GAOG;AACH,MAAM,UAAU,UAAU,CAAC,OAA0C,EAAE,YAAoB;IACzF,OAAO,CAAC,IAAI,EAAE,CAAC;IACf,OAAO,CAAC,WAAW,EAAE,CAAC;IACtB,OAAO,CAAC,MAAM,GAAG,IAAI,CAAC,GAAG,CAAC,GAAG,EAAE,OAAO,CAAC,MAAM,GAAG,CAAC,CAAC,GAAG,YAAY,CAAC,CAAC,CAAC;IACpE,OAAO,CAAC,cAAc,GAAG,IAAI,IAAI,EAAE,CAAC,WAAW,EAAE,CAAC;AACpD,CAAC;AAED;;;GAGG;AACH,MAAM,UAAU,MAAM,CAAC,OAA0C,EAAE,aAAqB;IACtF,OAAO,CAAC,MAAM,EAAE,CAAC;IACjB,OAAO,CAAC,WAAW,EAAE,CAAC;IACtB,OAAO,CAAC,MAAM,IAAI,aAAa,CAAC;IAChC,OAAO,CAAC,cAAc,GAAG,IAAI,IAAI,EAAE,CAAC,WAAW,EAAE,CAAC;AACpD,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@timmeck/trading-brain",
|
|
3
|
-
"version": "2.31.
|
|
3
|
+
"version": "2.31.82",
|
|
4
4
|
"description": "Adaptive trading intelligence system with Hebbian synapses, spreading activation, Wilson Score confidence, and adaptive calibration",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "dist/index.js",
|
|
@@ -41,7 +41,7 @@
|
|
|
41
41
|
},
|
|
42
42
|
"dependencies": {
|
|
43
43
|
"@modelcontextprotocol/sdk": "^1.0.0",
|
|
44
|
-
"@timmeck/brain-core": "2.36.
|
|
44
|
+
"@timmeck/brain-core": "2.36.92",
|
|
45
45
|
"better-sqlite3": "^11.7.0",
|
|
46
46
|
"ccxt": "^4.5.42",
|
|
47
47
|
"chalk": "^5.6.2",
|