ai newsFr., 4. Dez.
EilmeldungAlibaba Releases Qwen4-35B-A3B: Open-Weight MoE Model With 1M Context

Vier Claude-Subagenten als Anlagekomitee für die Börse Istanbul

Ein Autor hat für türkische Aktien ein System namens Borsa Zekâ gebaut: Vier Claude-Subagenten arbeiten als Anlagekomitee. Herkömmliche Chatbots verweigern bei solchen Fragen entweder die Antwort oder erfinden mit voller Zuversicht Kurse aus ihren Trainingsdaten.

dev.toMittwoch 14:00 · 02.12.DE5 Min. Lesezeit
Bild: dev.to

Fragt man einen Allzweck-Chatbot nach einer türkischen Aktie, erhält man eines von zwei Dingen: Entweder lehnt er höflich ab, oder er erfindet voller Selbstsicherheit einen Preis aus seinen Trainingsdaten. Beides hilft niemandem, der an einem Dienagnachmittag die Borsa Istanbul (BIST) im Blick hat.

Also habe ich Borsa Zekâ ("Marktintelligenz") gebaut, ein Open-Source-Claude-Code-Plugin, das Claude in einen BIST-Analysten verwandelt. Herzstück ist /borsa:komite, ein "Anlagekomitee": Vier spezialisierte Subagenten analysieren eine Aktie parallel, und ein Vorsitzender wägt ihre Einschätzungen zu einem Urteil ab, das seine Meinungsverschiedenheiten offenlegen muss.

Dieser Beitrag beschreibt, wie das Ganze aufgebaut ist und welche Designregeln es ehrlich halten. Außerdem geht es um ein paar Dinge, die ich beim Ausliefern gelernt habe und die für jeden gelten, der ein Claude-Code-Plugin entwickelt.

Alles Folgende dient nur der Information. Das Werkzeug ist eine Analysehilfe, keine Anlageberatung.

LLMs sind gut darin, über Märkte zu schlussfolgern, und schlecht darin, sich Marktdaten zu merken. Daraus folgt die Hauptregel des Plugins: Jeder Kurs, jeder Indikator und jede Schlagzeile muss aus einem Tool-Aufruf stammen. Die Aufgabe des Modells ist es zu lesen, abzugleichen und zu erklären.

src/lib (eine Engine) ├─ yahoo.ts Kurse, Verläufe, Fundamentaldaten, News ├─ indicators.ts RSI, MACD, ADX/DMI, Bollinger, ATR... ├─ analysis.ts Signale + zusammengesetzter Score (-100..100) └─ backtest.ts Strategien, ohne Blick in die Zukunft │ ├─► MCP-Server: stdio, 15 Tools, eine gebündelte.mjs ├─► Next.js-Web-App: Charts, Screener, Backtests └─► Remote-MCP: Streamable HTTP, zustandslos Vollbildmodus aktivieren Vollbildmodus beenden Eine Engine bedient drei Oberflächen. Der MCP-Server wird mit esbuild in eine einzelne Datei gebündelt, die im Plugin mitgeliefert wird, sodass Nutzer nichts außer Node benötigen. Die Web-App verwendet dieselben Funktionen für interaktive Charts.

Ein zustandsloser HTTP-Endpunkt stellt die schreibgeschützten Tools für Clients bereit, die keinen lokalen Code ausführen können.

Die Tools tragen türkische Namen ( hisse_analizi, piyasa_tarama, strateji_testi,...), weil das gesamte Produkt mit seinen Nutzern Türkisch spricht. Claude bewältigt das problemlos.

/borsa:komite TUPRS ist ein Skill (eine Markdown-Datei mit Anweisungen), kein Code. Er weist Claude an, die Rolle des Vorsitzenden einzunehmen und vier Dinge zu tun:

So sah das in einem echten Lauf mit TUPRS (Tüpraş, der türkische Raffineriekonzern) aus. Es dauerte 2 Minuten 37 Sekunden:

Urteil: Halten, 60 Prozent Konfidenz. Die These ist stichhaltig, aber der Zeitpunkt ist nicht bestätigt. Statt eines Kaufsignals gab der Vorsitzende zwei bedingte Pläne: Kauf bei einem Rücksetzer in ein benanntes Band oder Kauf bei einem Volumenausbruch über ein benanntes Niveau.

Genau diese Uneinigkeit ist der Sinn des Designs. Ein einzelner Prompt neigt dazu, zu einem selbstbewussten Ton zu verflachen. Die Aufteilung der Arbeit in enge Rollen, von denen eine dafür bezahlt wird, pessimistisch zu sein, erzeugt eine Spannung, die man nachvollziehen kann. Der vollständige Bericht liegt im Repo.

Manche Ehrlichkeit lässt sich nicht an Anweisungen delegieren.

Der Backtest kann die Zukunft nicht sehen. Ein Signal wird auf den Schlusskurs eines Balkens berechnet und zum Eröffnungskurs des nächsten Balkens ausgeführt. Stops und Take-Profits, die über eine Lücke hinweg ausgelöst werden, werden zur Eröffnung ausgeführt, nicht zu dem Kurs, den man sich gewünscht hätte:

// Signal des vorherigen Balkens zur Open dieses Balkens anwenden if (! inPos && target [ i - 1 ] === 1 ) { entryPrice = bar. open; /*... */ } // Intra-Balken-Stop: Lücke nach unten füllt zur Open, nicht zum Stop-Kurs if ( sl > 0 && bar. low <= entryPrice * ( 1 - sl ) ) exit ( i, Math. min ( bar. open, entryPrice * ( 1 - sl ) ), "stop" ); Vollbildmodus aktivieren Vollbildmodus beenden Die Daten müssen bereinigt werden, bevor Claude sie sieht. Yahoo ist bei den Fundamentaldaten der BIST inkonsistent. Manche Unternehmen (zum Beispiel Turkish Airlines) weisen ihre Finanzen in USD aus, während die Aktie in Lira handelt, was naive KGVs und KBVs um den Wechselkursfaktor verfälscht.

Die Engine erkennt die Währungsabweichung, korrigiert preisbasierte Kennzahlen und verbirgt absurde Werte, statt sie an das Modell weiterzureichen.

Der Score ist eine Zusammenfassung, keine Entscheidung. Der zusammengesetzte Score (-100 bis +100) gewichtet Trend mit 40 Prozent, Momentum mit 30 Prozent, Volumen mit 15 Prozent und Volatilität mit 15 Prozent. Die Server-Anweisungen sagen Claude, er solle Widersprüche innerhalb des Scores benennen, etwa einen starken Trend bei nachlassendem Momentum, statt bloß ein Label vorzulesen.

Renditen in türkischer Lira enthalten Inflation. Die Anweisungen erinnern Claude daran, die Performance am USD/TRY-Kurs und am BIST-100-Index zu messen, nicht in nominaler Lira.

Die Indikator- und Backtest-Logik hat Referenztests. Die CI führt Typprüfungen, Lint, die Tests und einen End-to-End-Smoke-Test des gebündelten MCP-Servers aus.

1. Plugins bestehen größtenteils aus Markdown. Der MCP-Server ist der einzige echte Code. Agenten, Kommandos, der Ausgabestil und die Orchestrierung sind Prosa. Die meisten Iterationen bestanden daraus, Anweisungen zu bearbeiten, nicht TypeScript.

2. Charts im Terminal lohnen sich. Ein terminal_grafik-Tool rendert ein Blockzeichen-Kursdiagramm mit Unterstützungs- und Widerstandsmarkierungen, und Claude zeigt es unverändert an. Es stellt sich heraus, dass das der beeindruckendste Teil der Ausgabe ist.

3. Das Claude-Plugin-Verzeichnis hat strenge, sinnvolle Regeln. Nicht verifizierte Organisationen dürfen keine Plugins einreichen, die Hooks, lokale MCP-Server oder Skripte mitliefern. Deshalb habe ich das vollständige lokale Plugin für den GitHub-Marktplatz behalten und aus derselben Quelle per Build-Skript eine Verzeichnis-Edition erzeugt. Diese Edition enthält die Agenten, die Kommandos und einen Remote-MCP-Server, aber keinen lokalen Code.

Der Validator bemängelte auch etwas, woran ich nicht gedacht hätte: Das README der Edition erklärte den Nutzern, wie man die andere Edition installiert. Das zählt als nicht deklarierter Server. Die Lösung bestand darin, die andere Edition zu beschreiben, ohne deren Installationskommando.

4. Das Demo muss reproduzierbar sein. Das GIF im README ist keine Bildschirmaufnahme. Es ist eine HTML-Szene, die über das Chrome DevTools Protocol Rahmen für Frame an ffmpeg übergeben wird, und jede Zahl darin stammt aus einem echten Lauf. Ändert sich das Ausgabeformat, kann das Demo neu erzeugt werden.

/plugin marketplace add Havali55/borsa-zeka /plugin install borsa@borsa-zeka Vollbildmodus aktivieren Vollbildmodus beenden Danach /borsa:hisse THYAO für eine einzelne Aktie, /borsa:brifing für eine Marktübersicht oder /borsa:komite ASELS, um das Komitee einzuberufen. Es wird kein API-Schlüssel benötigt, und die Marktdaten sind etwa 15 Minuten verzögert.

Der Code steht unter MIT-Lizenz: github.com/Havali55/borsa-zeka. Mit good first issue markierte Tickets behandeln Dividenden, Ichimoku und einen englischen Ausgabemodus. Beiträge sind willkommen.

Borsa Zekâ ist ein Analysewerkzeug. Nichts, was es erzeugt, ist Anlageberatung.

Automatisch übersetzt. Das Original auf Englisch ist unten aufklappbar.

Original (Englisch) anzeigen

Ask a general-purpose chatbot about a Turkish stock and you get one of two things. Either it politely refuses, or it invents a price from its training data with total confidence. Neither helps someone looking at Borsa Istanbul (BIST) on a Tuesday afternoon.

So I built Borsa Zekâ ("market intelligence"), an open-source Claude Code plugin that turns Claude into a BIST analyst. Its centrepiece is /borsa:komite, an "investment committee": four specialist subagents analyse a stock in parallel, and a chair weighs their views into a verdict that has to show its disagreements.

This post covers how it is put together and the design rules that keep it honest. It also covers a few things I learned shipping it, which apply to anyone building a Claude Code plugin.

Everything below is informational. The tool is an analysis aid, not investment advice.

LLMs are good at reasoning about markets and bad at remembering market data. The plugin's main rule follows from that: every price, indicator and headline must come from a tool call. The model's job is to read, reconcile and explain.

src/lib (one engine) ├─ yahoo.ts quotes, history, fundamentals, news ├─ indicators.ts RSI, MACD, ADX/DMI, Bollinger, ATR... ├─ analysis.ts signals + composite score (-100..100) └─ backtest.ts strategies, no look-ahead │ ├─► MCP server: stdio, 15 tools, one bundled.mjs ├─► Next.js web app: charts, screener, backtests └─► Remote MCP: Streamable HTTP, stateless Enter fullscreen mode Exit fullscreen mode One engine serves three surfaces. The MCP server is bundled with esbuild into a single file that ships inside the plugin, so users need nothing but Node. The web app reuses the same functions for interactive charts. A stateless HTTP endpoint exposes the read-only tools for clients that can't run local code.

The tools have Turkish names ( hisse_analizi, piyasa_tarama, strateji_testi,...) because the whole product speaks Turkish to its users. Claude handles that without any trouble.

/borsa:komite TUPRS is a skill (a Markdown file of instructions), not code. It tells Claude to act as the chair and to do four things:

Here is what that looked like in a real run on TUPRS (Tüpraş, the Turkish refiner). It took 2 min 37 s:

Verdict: Hold, 60% confidence. The thesis is sound but the timing isn't confirmed. Instead of a buy signal the chair gave two conditional plans: buy on a pullback to a named band, or buy on a volume breakout above a named level.

That disagreement is the point of the design. A single prompt tends to flatten into one confident tone. Splitting the work into narrow roles, with one role paid to be pessimistic, gives you tension you can read. The full report is in the repo.

Some honesty can't be delegated to instructions.

The backtest can't see the future. A signal is computed on a bar's close and executed at the next bar's open. Stops and take-profits that gap are filled at the open, not at the level you wished for:

// apply the previous bar's signal at this bar's open if (! inPos && target [ i - 1 ] === 1 ) { entryPrice = bar. open; /*... */ } // intrabar stop: a gap down fills at the open, not at the stop price if ( sl > 0 && bar. low <= entryPrice * ( 1 - sl ) ) exit ( i, Math. min ( bar. open, entryPrice * ( 1 - sl ) ), "stop" ); Enter fullscreen mode Exit fullscreen mode The data has to be cleaned before Claude sees it. Yahoo's BIST fundamentals are inconsistent. Some companies (Turkish Airlines, for example) report financials in USD while the stock trades in lira, which makes naive P/E and P/B wrong by a factor of the exchange rate. The engine detects the currency mismatch, corrects price-based ratios, and hides absurd values instead of passing them to the model.

The score is a summary, not a decision. The composite score (-100 to +100) weights trend 40%, momentum 30%, volume 15% and volatility 15%. The server instructions tell Claude to call out contradictions inside the score, for example strong trend with fading momentum, instead of reading out a label.

Turkish lira returns include inflation. The instructions remind Claude to judge performance against USD/TRY and the BIST 100 index, not in nominal lira.

Indicator and backtest logic has reference tests. CI runs type checks, lint, the tests, and an end-to-end smoke test of the bundled MCP server.

1. Plugins are mostly Markdown. The MCP server is the only real code. Agents, commands, the output style and the orchestration are prose. Most iterations were editing instructions, not TypeScript.

2. Charts in a terminal are worth it. A terminal_grafik tool renders a block-character price chart with support and resistance markers, and Claude shows it as-is. It turns out to be the most "wow" part of the output.

3. The Claude plugin directory has strict, sensible rules. Organizations that aren't verified can't submit plugins that ship hooks, local MCP servers or scripts. So I kept the full local plugin for the GitHub marketplace and generated a directory edition from the same source with a build script. That edition has the agents, the commands and a remote MCP server, and no local code.

The validator also flagged something I wouldn't have thought of: the edition's README told users how to install the other edition. That counts as an undeclared server. The fix was to describe the other edition without its install command.

4. Make the demo reproducible. The README GIF isn't a screen recording. It's an HTML scene rendered frame by frame through the Chrome DevTools Protocol into ffmpeg, and every number in it comes from a real run. If the output format changes, the demo can be rebuilt.

/plugin marketplace add Havali55/borsa-zeka /plugin install borsa@borsa-zeka Enter fullscreen mode Exit fullscreen mode Then /borsa:hisse THYAO for a single stock, /borsa:brifing for a market briefing, or /borsa:komite ASELS to convene the committee. No API key is needed, and market data is about 15 minutes delayed.

The code is MIT-licensed: github.com/Havali55/borsa-zeka. Issues tagged good first issue cover dividends, Ichimoku and an English output mode. Contributions are welcome.

Borsa Zekâ is an analysis tool. Nothing it produces is investment advice.

Originaltitel: I built an investment committee of four Claude subagents for Borsa IstanbulQuelle: dev.to (dev.to). Original öffnen