金融计算器:投资与定价工具 - Openclaw Skills

作者:互联网

2026-03-26

数值计算

什么是 金融计算器?

金融计算器是一款专为需要精确财务建模和预测能力的专业人士及开发人员设计的强大工具。该技能提供了一系列用于计算终值、现值、复利和零售定价策略的计算器。通过将其集成到 Openclaw Skills 中,用户可以自动化复杂的财务分析,或部署专用的 Web 仪表板进行实时预测和情景规划。

它通过 Python API 提供的编程访问和可视化对比图表,填补了简单手动计算与复杂电子表格建模之间的空白。无论您是预测退休增长还是制定商业定价策略,该技能都能为现代财务工作流提供所需的数学准确性和界面灵活性。

下载入口:https://github.com/openclaw/skills/tree/main/skills/tarigha/financial-calculator

安装与下载

1. ClawHub CLI

从源直接安装技能的最快方式。

npx clawhub@latest install financial-calculator

2. 手动安装

将技能文件夹复制到以下位置之一

全局模式 ~/.openclaw/skills/ 工作区 /skills/

优先级:工作区 > 本地 > 内置

3. 提示词安装

将此提示词复制到 OpenClaw 即可自动安装。

请帮我使用 Clawhub 安装 financial-calculator。如果尚未安装 Clawhub,请先安装(npm i -g clawhub)。

金融计算器 应用场景

  • 预测长期投资增长和退休规划方案。
  • 通过现值分析计算贷款估值和债券定价。
  • 为业务运营确定零售加价和折扣策略。
  • 使用自动化表格比较不同利率和时间段下的多个财务场景。
金融计算器 工作原理
  1. 根据特定的计算要求选择所需的金融模块,如终值、现值或加价率。
  2. 通过 CLI 参数或 Web UI 提供输入参数,包括本金金额、利率和复利频率。
  3. 该技能处理数学公式以生成精确的财务输出或多场景对比数据表。
  4. 在终端查看结果进行快速检查,或通过基于 Flask 的 Web 界面查看详细的移动端响应式视觉分析。

金融计算器 配置指南

该技能需要 Python 3.7+ 和 Flask 用于 Web 界面。请按照以下步骤开始使用 Openclaw Skills 的这部分内容:

# 进入技能目录
cd skills/financial-calculator

# 创建虚拟环境并安装依赖项
python3 -m venv venv
source venv/bin/activate
pip install flask

# 在特定端口启动交互式 Web UI
./scripts/launch_ui.sh 5050

金融计算器 数据架构与分类体系

金融计算器通过每种计算器类型的标准化输入和输出组织数据,确保 Openclaw Skills 组件之间的一致性:

组件 处理的数据 格式
CLI 脚本 本金、利率、周期、频率 位置参数
Web UI 基于表单的财务输入 HTML/JSON
表格 多利率和多周期数组 可排序的 Markdown/HTML
API 计算对象和结果 Python 字典

数学公式记录在参考目录中,以确保透明度和可审计性。

name: financial-calculator
description: Advanced financial calculator with future value tables, present value, discount calculations, markup pricing, and compound interest. Use when calculating investment growth, pricing strategies, loan values, discounts, or comparing financial scenarios across different rates and time periods. Includes both CLI and interactive web UI.

Financial Calculator

Comprehensive financial calculations including future value, present value, discount/markup pricing, compound interest, and comparative tables.

Quick Start

CLI Usage

# Future Value
python3 scripts/calculate.py fv 10000 0.05 10 12
# PV=$10,000, Rate=5%, Years=10, Monthly compounding

# Present Value
python3 scripts/calculate.py pv 20000 0.05 10 12
# FV=$20,000, Rate=5%, Years=10, Monthly compounding

# Discount
python3 scripts/calculate.py discount 100 20
# Price=$100, Discount=20%

# Markup
python3 scripts/calculate.py markup 100 30
# Cost=$100, Markup=30%

# Future Value Table
python3 scripts/calculate.py fv_table 10000 0.03 0.05 0.07 --periods 1 5 10 20
# Principal=$10,000, Rates=3%,5%,7%, Periods=1,5,10,20 years

# Discount Table
python3 scripts/calculate.py discount_table 100 10 15 20 25 30
# Price=$100, Discounts=10%,15%,20%,25%,30%

Web UI

Launch the interactive calculator:

./scripts/launch_ui.sh [port]
# Default port: 5050
# Opens at: http://localhost:5050
# Auto-creates venv and installs Flask if needed

Or manually:

cd skills/financial-calculator
python3 -m venv venv  # First time only
venv/bin/pip install flask  # First time only
venv/bin/python scripts/web_ui.py [port]

Features:

  • 7 calculator types with intuitive tabs
  • Real-time calculations
  • Interactive tables
  • Beautiful gradient UI
  • Mobile-responsive design

Calculators

1. Future Value (FV)

Calculate what an investment will be worth in the future with compound interest.

Use cases:

  • Investment growth projections
  • Savings account growth
  • Retirement planning

Inputs:

  • Principal amount
  • Annual interest rate (%)
  • Time period (years)
  • Compounding frequency (annual/quarterly/monthly/daily)

2. Present Value (PV)

Calculate the current value of a future amount (discounted value).

Use cases:

  • Loan valuation
  • Bond pricing
  • Investment analysis

Inputs:

  • Future value
  • Annual discount rate (%)
  • Time period (years)
  • Compounding frequency

3. Discount Calculator

Calculate final price after applying percentage discount.

Use cases:

  • Retail pricing
  • Sale calculations
  • Cost savings analysis

Inputs:

  • Original price
  • Discount percentage

Outputs:

  • Discount amount
  • Final price
  • Savings percentage

4. Markup Calculator

Calculate selling price from cost and markup percentage.

Use cases:

  • Product pricing
  • Profit margin calculation
  • Business pricing strategy

Inputs:

  • Cost price
  • Markup percentage

Outputs:

  • Markup amount
  • Selling price
  • Profit margin (as % of selling price)

5. Compound Interest

Detailed breakdown of compound interest calculations.

Use cases:

  • Interest analysis
  • Effective rate comparison
  • Loan interest calculation

Outputs:

  • Final amount
  • Total interest earned
  • Effective annual rate

6. Future Value Table

Generate comparison table across multiple rates and time periods.

Use cases:

  • Investment scenario comparison
  • Rate shopping
  • Long-term planning

Features:

  • Add multiple interest rates
  • Add multiple time periods
  • View all combinations in sortable table
  • See total gain and gain percentage

7. Discount Table

Compare multiple discount percentages for the same price.

Use cases:

  • Bulk pricing strategies
  • Promotional planning
  • Price comparison

Features:

  • Add multiple discount percentages
  • See all discount scenarios
  • Compare final prices and savings

Installation

Requires Python 3.7+ and Flask:

pip install flask

Or with venv:

python3 -m venv venv
source venv/bin/activate
pip install flask

Python API

Import the calculation module:

from calculate import (
    future_value,
    present_value,
    discount_amount,
    markup_price,
    compound_interest,
    generate_fv_table,
    generate_discount_table
)

# Calculate FV
fv = future_value(
    present_value=10000,
    rate=0.05,  # 5% as decimal
    periods=10,
    compound_frequency=12  # Monthly
)

# Generate table
table = generate_fv_table(
    principal=10000,
    rates=[0.03, 0.05, 0.07],  # As decimals
    periods=[1, 5, 10, 20]
)

Formulas

See references/formulas.md for detailed mathematical formulas, examples, and use cases for all calculations.

Tips

Rate Format:

  • CLI: Use decimals (0.05 for 5%)
  • Web UI: Use percentages (5 for 5%)
  • Python API: Use decimals (0.05 for 5%)

Compounding Frequencies:

  • 1 = Annual
  • 4 = Quarterly
  • 12 = Monthly
  • 365 = Daily

Table Generation: Best practices for meaningful comparisons:

  • FV tables: Use 3-5 rates, 4-6 time periods
  • Discount tables: Use 5-10 discount percentages
  • Keep tables focused for easier analysis

Performance:

  • Web UI calculations are instant
  • Tables with >100 combinations may take a few seconds
  • CLI is fastest for single calculations

Common Workflows

Investment Planning

  1. Use FV Calculator to project single investment
  2. Generate FV Table to compare different rates
  3. Check Compound Interest for detailed breakdown

Pricing Strategy

  1. Use Markup Calculator to set selling price
  2. Generate Discount Table to plan promotions
  3. Compare margins and final prices

Loan Analysis

  1. Use PV Calculator to value loan
  2. Check Compound Interest for total interest cost
  3. Generate FV Table to compare loan terms