Hello, I’m geo

Designs, talks, and writes about web, ethics, privacy, and dev. I share dev tutorials, free resources and inspiration. Loves music & riding his bicycle.

Latest Posts

金融工程学 quantlib 债券

QuantLib 中债券的核心是 现金流 (CashFlow),债券是现金流的集合。 固定利率债券每期支付固定利息,到期支付本金。 示例代码: import QuantLib as ql # 1. 设置评估日 today = ql.Date(3, 12, 2025) ql.Settings.instance().evaluationDate = today...

金融工程学 quantlib 节假日和工作日计算

QuantLib 提供各种日历类,可以处理节假日和工作日计算 # 创建 TARGET 日历(欧洲银行日历) calendar = ql.TARGET() # 调整日期到工作日 next_business_day = calendar.adjust(d + 1, ql.Following) # Following: 调整到后面的工作日 print("Next...

金融工程学 日期与日期调整

import QuantLib as ql # 设置评估日 today = ql.Date().todaysDate() ql.Settings.instance().evaluationDate = today print("Today:", today) # 输出格式:Date(3, 12, 2025) # 创建指定日期 d = ql.Date(25,...

金融工程学 quantlib 基础教学

pip install QuantLib-Python import QuantLib as ql print(ql.__version__) 模块 功能 ql.Date 日期处理,支持日历、节假日、日期计算 ql.Cal...

金融工程学 binomial tree model

import numpy as np def binomial_tree_stock_price(so,K,T,r,volatility,n): dT = T/n u = np.exp(volatility*np.sqrt(dT)) d = 1/u p = (np.exp(r*dT) - d) / (u -d) sT...

金融工程学 black scholes model

import numpy as np from scipy.stats import norm def black_sholces_d1_d2(s,K,r,rf,volatility,T): d1 = (np.log(s/K)+(r-rf+0.5*volatility**2)*T)/(volatility*np.sqrt(T)) d2 = d1...

python flask render部署

render 是一个 免费、简单、自动部署、自动 HTTPS 的云平台,非常适合 Flask、Django、Node、Go 等后端框架。 my_flask_app/ │── app.py │── requirements.txt │── Procfile └── templates/ └── index.html 撰写 Flask 程...