Portfolio Optimizer
virtual-trading MCPの価格情報とautomatic-investment-strategy/analysisのニュース分析を 組み合わせてポートフォリオを最適化し、割安資産の購入・割高資産の売却を実行する。 年率7%以上を目標とし、買い判断・売り判断・リバランス提案を行う。 ユーザーが「ポートフ... Skill: Portfolio Optimizer Owner: kackyt Summary: virtual-trading MCPの価格情報とautomatic-investment-strategy/analysisのニュース分析を 組み合わせてポートフォリオを最適化し、割安資産の購入・割高資産の売却を実行する。 年率7%以上を目標とし、買い判断・売り判断・リバランス提案を行う。 ユーザーが「ポートフ... Tags: latest:0.1.0 Version history: v0.1.0 | 2026-05-17T10:15:08.176Z | user Initial release of portfolio-optimizer - Integrates virtual-trading MCP price data with news analysis (automatic-investment-strategy
Rank
62
Safety
84
Downloads
1.1k
Updated
Oct 11, 2026
Version
0.1.0
Source
CLAWHUB
About
What it does, and when to use it.
Capability contract not published. No trust telemetry is available yet. 1.1K downloads reported by the source. Last updated 10/11/2026.
Avoid when
- Contract metadata is missing or unavailable for deterministic execution.
Risk flags: missing_or_unavailable_contract, trust_data_unavailable, schema_references_missing
Public facts
Every fact links back to the source it came from.
- Vendor
- Clawhubvendor · observed Oct 11, 2026
- Protocol compatibility
- OpenClawcompatibility · observed Oct 11, 2026
- Adoption signal
- 1.1K downloadsadoption · observed Oct 11, 2026
- Latest release
- 0.1.0release · observed May 17, 2026
- Handshake status
- UNKNOWNsecurity
Install and run
Setup complexity: low.
clawhub skill install s170tjamgsnr766epb4s1pqgjx86xh6j:portfolio-optimizer- Setup complexity is LOW. This package is likely designed for quick installation with minimal external side-effects.
- Final validation: Expose the agent to a mock request payload inside a sandbox and trace the network egress before allowing access to real customer data.
Contract: missing
curl -s "https://www.xpersona.co/api/v1/agents/clawhub-kackyt-portfolio-optimizer/snapshot"
Documentation
CLAWHUB
9,178 characters of source documentation, loaded on request.
Extracted files
5 files captured from the source.
SKILL.md
--- name: portfolio-optimizer description: >- virtual-trading MCPの価格情報とautomatic-investment-strategy/analysisのニュース分析を 組み合わせてポートフォリオを最適化し、割安資産の購入・割高資産の売却を実行する。 年率7%以上を目標とし、買い判断・売り判断・リバランス提案を行う。 ユーザーが「ポートフォリオを最適化して」「割安な資産を買って」「リバランスして」 「投資戦略を実行して」などと依頼したときにトリガーすること。 --- # ポートフォリオ最適化 Workflow virtual-trading MCP の価格データと analysis/ のニュース分析スコアを統合し、 S&P500を上回るリターンを目標とした売買判断・注文執行を行う。 ## ワークフロー概要 ``` 1. 現状把握 → ポートフォリオ残高・価格取得 2. 分析読込 → 直近のニュース分析スコア集計 3. バリュエーション → 価格トレンド+ニューススコアで割安/割高判定 4. 判断 → 買い/売り/ホールドの資産リスト作成 5. 執行 → virtual-trading MCP で注文 6. サマリー → 実行結果と次回推奨をレポート ``` ## Step 1: 現状把握 以下の virtual-trading MCP ツールで現状を取得する。 ``` get_portfolio → 保有資産一覧・数量・平均取得コスト get_prices → 対象資産の現在価格(または PromQL で過去1週間の高値/安値) get_balance → 現金残高 ``` PromQL で価格トレンドを見る場合: [references/virtual-trading-api.md](./references/virtual-trading-api.md) 参照。 ## Step 2: ニュース分析スコア集計 git pull あるいは ``` git clone [email protected]:kackyt/automatic-investment-strategy.git ``` を実行して最新のニュース分析を取得する `analysis/` ディレクトリの構造と読み方: [references/news-analysis-format.md](./references/news-analysis-format.md) 参照。 - 直近 3〜7 日分の bloomberg.md / coindesk.md を読む - 投資対象となる資産クラスの **平均スコア** を算出する - 株式 (Stocks): bloomberg スコア (株式) の平均 - 暗号資産 (Crypto): coindesk スコアの平均 *(注: 現金は USD で保有し、債券は取引対象外のためスコア集計から除外する)* ## Step 3: 戦略の一貫性維持(Stateful Strategy Memory の読み込み) 10分ごとの実行(Tick)において方針がブレるのを防ぐため、前回の戦略状態を読み込む。 - `automatic-investment-strategy/analysis/strategy_state.md` ファイルを確認する(存在しなければ新規作成を想定)。 - 記載されている「長期軸(Long-term View)」と「短期軸(Short-term View)」を読み込み、直近の動きとの差分をとらえ、適宜更新していく。 ## Step 4: マクロ環境による「Risk-On / Risk-Off」の判定 各アセットクラスの `news_score` を用いて、相場全体の地合いを判定し、攻めと守りのスイッチを切り替える。ベンチマークである「SPYの100%バイアンドホールド」のドローダウンを回避することが目的である。 - **Risk-On(強気相場)**: アセットクラスの `news_score` が **0より大きい** 場合。このクラスの銘柄への投資を許可する。 - **Risk-Off(弱気相場)**: `news_score` が **0以下** の場合。暴落回避のため、このクラスの銘柄は**すべて売却し、100%現金(USD)に退避**する。 ## Step 5: 個別銘柄のモメンタム判定と目標配分計算 売買対象銘柄(`SPY`, `BKCH`, `MSFT`, `GOOGL`, `BTC`, `ETH`, `LINK`)について、価格の勢い(モメンタム)を評価し、強い銘柄に資金を集中させる。 ```text R = (現在価格 - 直近7日安値) / (直近7日高値 - 直近7日安値) // 0なら底値、1なら高値 モメンタムスコア = R × 100 総合確信度スコア = (ニューススコア平均 × 5) + モメンタムスコア ``` - **投資条件**: 総合確信度スコアが **+60 以上** の銘柄のみを投資対象とする。 - **目標割合(%)**: `確信度スコア` の数値そのままを目標割合(%)とする(例: スコア70なら70%)。 - **上限設定**: 分散を強制するため、**1銘柄あたりの上限は 30%** とする。 - **現金バッファ**: 条件を満たす銘柄の割合合計が100%に満たない場合は、残りをUSD(現金)として保持する。合計が100%を超える場合のみ、100%になるよう等比率で縮小(正規化)する。 ## Step 6: 取引コストと決済ラグへの対応(Hysteresis) 10分周期の実行に対して毎回細かく売買すると、取引手数料(0.25%)により資金(初期$10,000)が枯渇する(Fee Bleed)。また、株式の翌日決済により資金ロックが発生する。 - **リバランス閾値(不感帯)**: 各銘柄の「現在の保有割合」と「目標割合」の差が**絶対値で 15% 以上**乖離していない限り、売買は実行しない(ホールド継続)。これにより微細なノイズによる取引を防止する。 - **注文時の残高確認(決済対応)**: `buy_asset` 発注前に必ず利用可能なUSD残高(Settled Cash)を確認する。株式の売却代金が未決済(翌日反映)である場合は、手元の現金残高の範囲内でのみ買い注文を出す。 ## Step 7: 注文執行 virtual-trading MCP の `sell_asset` および `buy_asset` で注文を執行する。 (※ 売り注文を先に行い、現金を確保してから買い注文を行うこと) 執行後は `get_portfolio` で最新の状況を確認する。 ## Step 8: サマリーレポートと戦略の更新 以下の形式でレポートを出力するとともに、次回のTickに向けて `strategy_s
_meta.json
{
"ownerId": "kn73mne930v2mg1peg6pkb9ann86wqam",
"slug": "portfolio-optimizer",
"version": "0.1.0",
"publishedAt": 1779012908176
}references/news-analysis-format.md
# ニュース分析ファイルのフォーマット `automatic-investment-strategy/analysis/<YYYY-MM-DD>/` に毎日 2 ファイルが生成される。 ## ファイル一覧 | ファイル | 内容 | |----------|------| | `bloomberg.md` | 日本・米国の株式/債券/為替に関するニュース分析 | | `coindesk.md` | 暗号資産市場のニュース分析 | ## bloomberg.md のスコア読み取り方 各記事に以下の形式でスコアが記載される: ```markdown * **影響評価**: * **株式 (Stocks)**: +7 (説明文) * **債券 (Bonds)**: -3 (説明文) * **為替 (Forex)**: +4 (説明文) ``` - スコア範囲: -10〜+10 - 複数記事のスコアを**算術平均**して資産クラスのセンチメントとする ## coindesk.md のスコア読み取り方 ```markdown * **評価スコア**: **+8** ``` - ファイル末尾の `**総合スコア: +X**` を使うと効率的 - なければ全記事の評価スコアを平均する ## 資産クラスとスコアのマッピング | 資産クラス | 参照ファイル | 使用するスコア | 備考 | |------------|-------------|---------------|------| | 株式 (VOO, 個別株) | bloomberg.md | 株式 (Stocks) スコア平均 | 投資対象 | | 暗号資産 (BTC/ETH/SOL) | coindesk.md | 総合スコア or 個別平均 | 投資対象 | | 債券 | bloomberg.md | 債券 (Bonds) スコア平均 | 取引不可(参考値) | | 円/ドル | bloomberg.md | 為替 (Forex) スコア平均 | 現金はUSD保有のため参考値 | ## 分析ファイルが存在しない場合 - 直近の日付フォルダを使う (例: 休日は前営業日分) - 7 日以上古い場合はニューススコアを 0 (中立) として扱い、 モメンタムスコアのみで判断する
references/virtual-trading-api.md
# Virtual Trading MCP API リファレンス
virtual-trading MCP で利用可能なツール群。実際のツール名は MCP 接続時に確認すること。
## 主要ツール
| ツール名 | 用途 |
|----------|------|
| `get_portfolio` | 保有資産一覧 (銘柄, 数量, 平均取得価格) |
| `get_prices` | 資産の現在価格一覧 |
| `get_balance` | 現金残高 |
| `place_order` | 買い/売り注文の発行 |
| `query_metrics` | PromQL でメトリクス時系列取得 |
## PromQL で価格トレンドを取得する例
7 日間の高値/安値を取得する PromQL:
```promql
# 過去 7 日の高値
max_over_time(asset_price{asset="BTC"}[7d])
# 過去 7 日の安値
min_over_time(asset_price{asset="BTC"}[7d])
# 現在価格
asset_price{asset="BTC"}
```
`query_metrics` ツールに上記クエリを渡し、レスポンスの value を使う。
## place_order パラメータ例
```json
{
"asset": "BTC",
"side": "buy",
"quantity": 0.01,
"order_type": "market"
}
```
- `side`: `"buy"` または `"sell"`
- `quantity`: 数量(通貨・株式の単位)
- `order_type`: `"market"` (成行) / `"limit"` (指値)
## エラー対処
- 残高不足: `get_balance` で現金を確認し、注文数量を調整する
- 保有不足(売り): `get_portfolio` で数量を確認し、保有量以下にする
- ツール名が合わない: MCP ツール一覧を `list_tools` 等で確認するskill-card.md
## Description: Portfolio Optimizer combines virtual-trading MCP price data with news analysis scores to recommend and execute virtual buy, sell, hold, and rebalance decisions. This skill is ready for commercial/non-commercial use. ## Publisher: [kackyt](https://clawhub.ai/user/kackyt) ### License/Terms of Use: MIT-0 ## Use Case: External users and developers use this skill to operate a virtual portfolio strategy that reads recent market-news sentiment, checks virtual portfolio state and prices, places virtual trades, and reports the resulting allocation and strategy state. ### Deployment Geography for Use: Global ## Known Risks and Mitigations: Risk: The skill can change a connected virtual portfolio by placing buy and sell orders. Mitigation: Require confirmation or dry-run review before order execution, especially when testing a new strategy configuration. Risk: The skill can overwrite persistent strategy state used by later runs. Mitigation: Review proposed strategy_state.md changes before writing them and keep recoverable history for prior state. Risk: The skill fetches mutable external news-analysis content through unpinned git updates. Mitigation: Use a trusted analysis source and pin or review the exact revision before relying on its scores. ## Reference(s): - [ClawHub skill page](https://clawhub.ai/kackyt/skills/portfolio-optimizer) - [News analysis format](references/news-analysis-format.md) - [Virtual Trading MCP API reference](references/virtual-trading-api.md) ## Skill Output: **Output Type(s):** [text, markdown, shell commands, API calls, files, guidance] **Output Format:** [Markdown report with inline commands, virtual-trading MCP tool calls, and strategy state updates] **Output Parameters:** [1D] **Other Properties Related to Output:** [Produces virtual trading actions and may update strategy_state.md between runs.] ## Skill Version(s): 0.1.0 (source: server release evidence) ## Ethical Considerations: Users should evaluate whether this skill is appropriate for their environment, review any generated or modified files before relying on them, and apply their organization's safety, security, and compliance requirements before deployment.
AionUi
Free, local, open-source 24/7 Cowork app and OpenClaw for Gemini CLI, Claude Code, Codex, OpenCode, Qwen Code, Goose CLI, Auggie, and more | 🌟 Star if you like it!
activepieces
AI Agents & MCPs & AI Workflow Automation • (~400 MCP servers for AI agents) • AI Automation / AI Agent with MCPs • AI Workflows & AI Agents • MCPs for AI Agents
cherry-studio
AI productivity studio with smart chat, autonomous agents, and 300+ assistants.
CopilotKit
The Frontend for Agents & Generative UI. React + Angular
Machine-readable data
The same record, as JSON, for agents and crawlers.
{
"facts": [
{
"factKey": "vendor",
"category": "vendor",
"label": "Vendor",
"value": "Clawhub",
"href": "https://clawhub.ai/kackyt/skills/portfolio-optimizer",
"sourceUrl": "https://clawhub.ai/kackyt/skills/portfolio-optimizer",
"sourceType": "profile",
"confidence": "medium",
"observedAt": "2026-10-11T05:43:04.468Z",
"isPublic": true
},
{
"factKey": "protocols",
"category": "compatibility",
"label": "Protocol compatibility",
"value": "OpenClaw",
"href": "https://www.xpersona.co/api/v1/agents/clawhub-kackyt-portfolio-optimizer/contract",
"sourceUrl": "https://www.xpersona.co/api/v1/agents/clawhub-kackyt-portfolio-optimizer/contract",
"sourceType": "contract",
"confidence": "medium",
"observedAt": "2026-10-11T05:43:04.468Z",
"isPublic": true
},
{
"factKey": "traction",
"category": "adoption",
"label": "Adoption signal",
"value": "1.1K downloads",
"href": "https://clawhub.ai/kackyt/portfolio-optimizer",
"sourceUrl": "https://clawhub.ai/kackyt/portfolio-optimizer",
"sourceType": "profile",
"confidence": "medium",
"observedAt": "2026-10-11T05:43:04.468Z",
"isPublic": true
},
{
"factKey": "latest_release",
"category": "release",
"label": "Latest release",
"value": "0.1.0",
"href": "https://clawhub.ai/kackyt/portfolio-optimizer",
"sourceUrl": "https://clawhub.ai/kackyt/portfolio-optimizer",
"sourceType": "release",
"confidence": "medium",
"observedAt": "2026-05-17T10:15:08.176Z",
"isPublic": true
},
{
"factKey": "handshake_status",
"category": "security",
"label": "Handshake status",
"value": "UNKNOWN",
"href": "https://www.xpersona.co/api/v1/agents/clawhub-kackyt-portfolio-optimizer/trust",
"sourceUrl": "https://www.xpersona.co/api/v1/agents/clawhub-kackyt-portfolio-optimizer/trust",
"sourceType": "trust",
"confidence": "medium",
"observedAt": null,
"isPublic": true
}
],
"events": [
{
"eventType": "release",
"title": "Release 0.1.0",
"description": "Initial release of portfolio-optimizer - Integrates virtual-trading MCP price data with news analysis (automatic-investment-strategy/analysis) for portfolio optimization. - Executes buy/hold/sell and rebalancing decisions to target 7%+ annual returns, outperforming the S&P500. - Implements a workflow combining valuation, momentum, and news sentiment; Risk-On/Risk-Off switching enabled. - Includes mechanisms to reduce over-trading and manages execution lags and transaction costs. - Generates summary reports and maintains state between runs for consistent strategy.",
"href": "https://clawhub.ai/kackyt/portfolio-optimizer",
"sourceUrl": "https://clawhub.ai/kackyt/portfolio-optimizer",
"sourceType": "release",
"confidence": "medium",
"observedAt": "2026-05-17T10:15:08.176Z",
"isPublic": true
}
]
}Record generated Oct 11, 2026.
