計算交易成本對風險報酬比的非線性衰減影響。將固定佣金與點差整合為「成本密度」指標,揭示停損大小與策略效率的雙曲線關係,識別「獲利事件視界」閾值。
Ships in fatfingererr-macro-skills. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
Read when SKILL.md points to them; scripts run unread.
<essential_principles> 成本密度模型核心原則
1. 核心公式
所有計算基於以下關係:
Cost Density = (c/V + s) # 成本密度(pips 等效)
x = Cost Density / P # 負載係數
RR_net = (RR_g - x) / (1 + x) # 淨風險報酬比
WR_min = (1 + x) / (1 + RR_g) # 最低勝率
P_critical = CostDensity × (RR_g + 2) / RR_g # 效率減半點
2. 參數定義
| 參數 | 定義 | 單位 |
|---|---|---|
| RR_g | 毛風險報酬比(目標/停損) | 無單位 |
| P | 停損大小 | pips/points |
| c | 來回佣金(每手) | 帳戶貨幣 |
| s | 來回點差 | pips/points |
| V | 每 pip 價值(每手) | 帳戶貨幣/pip |
| R | 固定風險(可選,會抵消) | 帳戶貨幣 |
3. 關鍵洞察
4. 單位一致性規則
等待回應後再繼續。
| Response | Workflow | Description | |--------------------------------------|----------------------|----------------------| | 1, "compute", "calculate", "single" | workflows/compute.md | 單次計算成本密度指標 | | 2, "sweep", "grid", "curve", "range" | workflows/sweep.md | 網格掃描與閾值搜尋 | | 3, "analyze", "interpret", "explain" | workflows/analyze.md | 結果解讀與策略建議 |讀取工作流程後,請完全遵循其步驟。
<reference_index>
參考文件 (references/)
| 文件 | 內容 |
|---|---|
| formulas.md | 完整公式推導與數學證明 |
| theory.md | 市場微結構理論背景與文獻 |
| </reference_index> |
<workflows_index>
| Workflow | Purpose |
|---|---|
| compute.md | 單次計算成本密度與效率指標 |
| sweep.md | 網格掃描與閾值搜尋 |
| analyze.md | 結果解讀與策略建議 |
| </workflows_index> |
<templates_index>
| Template | Purpose |
|---|---|
| output-schema.yaml | 輸出 JSON schema |
| input-schema.yaml | 輸入參數 schema |
| </templates_index> |
<scripts_index>
| Script | Purpose |
|---|---|
| cost_density.py | Python 計算實作 |
| cost_density.ts | TypeScript 計算實作 |
| </scripts_index> |
<quick_start> 快速計算(XAU/USD 範例):
輸入:
{
"RR_g": 3.0,
"c": 7.0,
"s": 1.5,
"V": 10.0,
"P": 20
}
計算:
cost_density = 7.0/10.0 + 1.5 # = 2.2 pips
x = 2.2 / 20 # = 0.11
RR_net = (3.0 - 0.11) / (1 + 0.11) # = 2.60
WR_min = (1 + 0.11) / (1 + 3.0) # = 27.7%
P_critical = 2.2 * (3.0 + 2) / 3.0 # = 3.67 pips
輸出:
{
"cost_density": 2.2,
"x": 0.11,
"RR_net": 2.60,
"WR_min": 0.277,
"P_critical": 3.67,
"Loss_RR": 0.133
}
</quick_start>
<success_criteria> Skill 成功執行時:
examples/eurusd_low_cost.json (opens in a new tab)examples/high_frequency_warning.json (opens in a new tab)examples/xauusd_default.json (opens in a new tab)manifest.json (opens in a new tab)references/formulas.md (opens in a new tab)references/theory.md (opens in a new tab)scripts/cost_density.py (opens in a new tab)scripts/cost_density.ts (opens in a new tab)skill.yaml (opens in a new tab)templates/input-schema.yaml (opens in a new tab)templates/output-schema.yaml (opens in a new tab)workflows/analyze.md (opens in a new tab)workflows/compute.md (opens in a new tab)workflows/sweep.md (opens in a new tab)What SKILL.md sets; muted values are Claude Code's defaults
37 skills in this plugin
/analyze-copper-inventory-rebuild-signal用「庫存快速回補」作為短期警戒訊號,評估銅價是否接近短線高點,同時給出一個「長期是否偏便宜」的歷史分位數判讀。/analyze-copper-stock-resilience-dependency用跨資產訊號(全球股市韌性 + 中國利率環境)評估銅價能否突破關卡或進入「回補/回踩」到支撐的機率與路徑。/analyze-copper-supply-concentration-risk用公開資料量化「銅供應是否過度集中、主要產地是否結構性衰退、替代增量是否依賴少數國家」,並輸出可行的中期供應風險結論與情境推演。/analyze-gas-fertilizer-contract-shock用天然氣與化肥價格的日頻數據,檢驗「天然氣暴漲→化肥供應受限/毀約→化肥飆價」敘事是否成立,輸出可標註到圖上的關鍵轉折點與領先落後分析。/analyze-high-unemployment-high-gdp-growth-fiscal-deficit-scenarios在「失業率走高/勞動市場轉弱」但「名目或實質 GDP 仍維持高位(或仍在成長)」的情境下,依據歷史關聯估算美國財政赤字占 GDP(Deficit/GDP)可能擴張的區間,並生成對長天期美債(長久期 UST)供給/利率風險的情境解讀。支援視覺化圖表輸出。/analyze-investment-clock-rotation把「獲利成長 × 財務狀況(金融環境)」映射成「投資時鐘」,判斷目前落在哪個象限、近期是順時針還是逆時針旋轉、以及相對於上一輪循環的位置差異。Other plugins' skills for the same job
/fatfingererr-macro-skills:cost-density-net-rr-calculatorfrom fatfingererr-macro-skills
fatfingererr-macro-skills@cascade-code-general-misc-1 is listed by joshuarweaver/cascade-code-general-misc-1 — review the source before installing
npx claudepluginhub joshuarweaver/cascade-code-general-misc-1 --plugin fatfingererr-macro-skills