Skip to main content

💰 Finance API Reference

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

💰 Finance API Reference

Import: import office

t0

office.finance.t0(
buy_price,
sale_price,
shares,
w_rate=2.5/10000,
min_rate=5,
stamp_tax=1/1000
)

Parameters

ParameterTypeDefaultDescription
buy_pricefloat-Buy price
sale_pricefloat-Sell price
sharesint-Number of shares
w_ratefloat2.5/10000Commission rate (0.025%)
min_rateint5Minimum commission
stamp_taxfloat1/1000Stamp tax rate (0.1%)

Examples

import office

profit = office.finance.t0(buy_price=11.99, sale_price=12.26, shares=700)
print(f"T-Trade profit: ¥{profit:.2f}")
AI 办公效率课
35 讲 AI 自动化办公实战课用 Python + AI 处理 Excel、Word、PDF、邮件等办公场景。
去学习