futures-margin-calculator

期货保证金计算工具。计算各期货品种的交易所保证金、期货公司保证金、开仓所需资金。支持不同交易所、不同品种的保证金率查询。使用AkShare实时数据、交易所官方保证金标准。适用于资金管理、风险控制、交易策略制定。

105 stars

Best use case

futures-margin-calculator is best used when you need a repeatable AI agent workflow instead of a one-off prompt.

期货保证金计算工具。计算各期货品种的交易所保证金、期货公司保证金、开仓所需资金。支持不同交易所、不同品种的保证金率查询。使用AkShare实时数据、交易所官方保证金标准。适用于资金管理、风险控制、交易策略制定。

Teams using futures-margin-calculator should expect a more consistent output, faster repeated execution, less prompt rewriting.

When to use this skill

  • You want a reusable workflow that can be run more than once with consistent structure.

When not to use this skill

  • You only need a quick one-off answer and do not need a reusable workflow.
  • You cannot install or maintain the underlying files, dependencies, or repository context.

Installation

Claude Code / Cursor / Codex

$curl -o ~/.claude/skills/futures-margin-calculator/SKILL.md --create-dirs "https://raw.githubusercontent.com/aifinlab/FinClaw/main/skillsChoice/futures-suite/futures-margin-calculator/SKILL.md"

Manual Installation

  1. Download SKILL.md from GitHub
  2. Place it in .claude/skills/futures-margin-calculator/SKILL.md inside your project
  3. Restart your AI agent — it will auto-discover the skill

How futures-margin-calculator Compares

Feature / Agentfutures-margin-calculatorStandard Approach
Platform SupportNot specifiedLimited / Varies
Context Awareness High Baseline
Installation ComplexityUnknownN/A

Frequently Asked Questions

What does this skill do?

期货保证金计算工具。计算各期货品种的交易所保证金、期货公司保证金、开仓所需资金。支持不同交易所、不同品种的保证金率查询。使用AkShare实时数据、交易所官方保证金标准。适用于资金管理、风险控制、交易策略制定。

Where can I find the source code?

You can find the source code on GitHub using the link provided at the top of the page.

SKILL.md Source

# 期货保证金计算器

## 功能

- 交易所保证金率实时查询(接入AkShare)
- 期货公司保证金率设置
- 开仓资金计算
- 维持保证金监控
- 不同品种保证金对比
- 多交易所数据支持

## 数据源

- **AkShare实时数据**: `futures_comm_info()` 接口获取实时保证金率、手续费数据
- 支持交易所: 上期所、大商所、郑商所、能源中心、中金所、广期所
- 数据包括: 交易所保证金率(买开/卖开)、每手保证金金额、实时价格

## 核心指标

| 指标 | 说明 |
|------|------|
| 交易所保证金率 | 交易所要求的最低保证金比例(实时) |
| 期货公司保证金率 | 期货公司实际收取的保证金比例 |
| 合约价值 | 合约价格 × 合约乘数 |
| 保证金金额 | 合约价值 × 保证金率 |

## 使用方法

```bash
# 计算单个合约保证金
python main.py --symbol RB2505 --price 3200 --lots 2

# 使用AkShare实时价格(不指定--price)
python main.py --symbol RB2505 --lots 1

# 做空保证金计算
python main.py --symbol RB2505 --price 3200 --direction short

# 列出所有品种保证金率
python main.py --list

# 列出指定交易所品种
python main.py --list --exchange SHFE

# 对比多个合约保证金
python main.py --compare RB2505,HC2505,I2505 --lots 1
```

## 参数说明

| 参数 | 说明 | 示例 |
|------|------|------|
| --symbol | 合约代码 | RB2505, CU2506 |
| --price | 合约价格(可选,默认使用AkShare实时价) | 3500 |
| --lots | 手数 | 2 |
| --multiplier | 期货公司保证金倍数 | 1.2 |
| --direction | 交易方向(long/short) | long |
| --list | 列出保证金率 | - |
| --exchange | 指定交易所过滤 | SHFE/DCE/CZCE/INE/CFFEX/GFEX |
| --compare | 对比多个合约 | RB2505,HC2505 |

## 更新日志

- 2025-03-25: 接入AkShare实时数据源,替换静态配置

Related Skills

trust-income-calculator

105
from aifinlab/FinClaw

## 描述

securities-margin-analyzer

105
from aifinlab/FinClaw

券商两融业务分析工具。获取融资融券余额、担保比例、维保比例等数据。分析两融余额变化、行业分布、个股集中度。使用交易所、AkShare数据。适用于两融业务研究、信用风险分析、市场杠杆监测。

futures-volume-analyzer

105
from aifinlab/FinClaw

期货成交量持仓分析工具。分析各期货品种的成交量、持仓量变化、量价关系、资金流向。识别主力合约切换、异常交易信号。使用AkShare期货数据、交易所公开数据。适用于交易信号识别、市场情绪判断。

futures-risk-analyzer

105
from aifinlab/FinClaw

期货风险分析工具。计算期货品种波动率、最大回撤、VaR等风险指标。分析价格跳空、涨跌停风险、流动性风险。使用AkShare期货历史数据。适用于风险管理、仓位控制、止损设置。

futures-position-tracker

105
from aifinlab/FinClaw

期货持仓分析工具。获取期货品种持仓排名(前20名期货公司)、持仓结构(多头/空头)、持仓集中度。分析主力资金动向、持仓变化信号。使用交易所持仓数据、AkShare数据。适用于主力资金跟踪、市场情绪判断。

futures-market-overview

105
from aifinlab/FinClaw

期货市场概览工具。获取期货市场整体数据,包括成交持仓量、成交额、各品种活跃度、交易所统计等。使用上期所、大商所、郑商所、中金所、上期能源官方数据,以及AkShare期货数据。适用于期货市场研究、活跃度分析、投资策略制定。

futures-macro-correlation

105
from aifinlab/FinClaw

期货与宏观相关性分析工具。分析期货品种与宏观经济指标(PMI、CPI、利率、汇率)的相关性。使用AkShare期货数据、宏观数据。适用于宏观对冲策略、经济周期交易。

futures-delivery-analyzer

105
from aifinlab/FinClaw

期货交割分析工具。获取期货品种交割信息、交割仓库、交割成本、仓单数据。分析交割月流动性变化、逼仓风险。使用AkShare仓单数据、交易所交割规则。适用于交割月策略、期现回归交易。

futures-arbitrage-analyzer

105
from aifinlab/FinClaw

期货套利分析工具。分析跨期套利、跨品种套利、跨市场套利机会。计算价差、价差历史分位、套利成本。使用AkShare期货数据、交易所数据。适用于套利策略制定、无风险收益机会识别。

financial-futures-analyzer

105
from aifinlab/FinClaw

金融期货专项分析工具。分析股指期货(IF、IC、IH、IM)、国债期货(T、TF、TS)等金融衍生品。获取基差、贴水率、期现价差、持仓结构等。使用AkShare期货数据、中金所数据。适用于对冲策略、期现套利、资产配置。

commodity-futures-analyzer

105
from aifinlab/FinClaw

商品期货专项分析工具。分析有色金属、黑色金属、能源化工、农产品等商品期货板块。获取板块指数、产业链关系、季节性规律。使用AkShare期货数据、交易所数据。适用于商品期货投资、产业链研究、季节性交易。

portfolio-diagnosis-margin

105
from aifinlab/FinClaw

客户持仓诊断助手 - 两融客户版,专用于融资融券客户的持仓分析和风险诊断。 以下情况请主动触发此技能: - 用户需要为两融客户做持仓诊断和风险评估 - 用户描述两融客户维保比例、持仓、负债情况 - 用户问"两融客户风险大吗""需要追加保证金吗" - 用户准备两融客户回访、风险提示、追保沟通 - 用户问两融策略、杠杆使用、平仓风险等问题 输出含维保比例分析、平仓风险、杠杆适当性的专业诊断。 不要等用户明确说"两融诊断"——只要涉及两融客户持仓分析、风险评估,就应主动启动此技能。