Skip to main content

💰 Finance Module Guide

This page is currently only available in Chinese. Please switch to 简体中文 for the full content.

💰 Finance Module Guide

The Finance module currently provides Stock T+0 profit calculation.

Core Scenarios

Calculate T-Trade Profit

import office
profit = office.finance.t0(
buy_price=11.99,
sale_price=12.26,
shares=700
)
print(f"T-Trade profit: ¥{profit:.2f}")

Custom Fee Rates

profit = office.finance.t0(
buy_price=10.00,
sale_price=10.50,
shares=1000,
w_rate=3.0/10000,
min_rate=5,
stamp_tax=1.5/1000
)

Formula

Profit = Sale Amount - Buy Amount - Buy Commission - Sale Commission - Stamp Tax

Full API see Finance API Reference

AI 办公效率课
35 讲 AI 自动化办公实战课用 Python + AI 处理 Excel、Word、PDF、邮件等办公场景。
去学习