当前位置:首页>python>期权量化策略(一):用Python玩转金融衍生品

期权量化策略(一):用Python玩转金融衍生品

  • 2026-02-27 20:50:31
期权量化策略(一):用Python玩转金融衍生品

从定价模型到波动率交易,解锁期权策略的无限可能

你有没有想过,为什么特斯拉的股票一夜之间可以暴涨20%,但期权却能带来200%的回报?或者为什么在震荡市中,有人能稳定赚钱,而持股不动的人却毫无收益?这背后的秘密武器就是——期权。今天,我们将一起探索这个金融衍生品世界中最灵活、最强大的工具。

先从一个真实的故事开始。2020年3月,美国疫情爆发初期,市场暴跌。一位投资者没有抛售股票,而是用1%的资产购买了标普500指数的看跌期权。两周后,当市场下跌30%时,他的股票损失了30%,但看跌期权价值上涨了1500%,不仅对冲了损失,还实现了盈利。这个故事揭示了期权的本质:用小资金控制大风险,用有限损失换取无限可能

但期权交易远不止"买涨买跌"这么简单。真正的期权高手,是在交易波动率,是在构建概率优势,是在管理非线性风险。今天,我们要深入探讨的,就是如何用Python系统性地分析期权、构建策略、管理风险。

一、期权基础与数据获取

1. 理解期权的核心要素

在开始之前,让我们快速回顾期权的关键概念:

  • 看涨期权(Call):未来以特定价格买入资产的权利

  • 看跌期权(Put):未来以特定价格卖出资产的权利

  • 行权价(Strike Price):约定的买卖价格

  • 到期日(Expiration Date):期权失效的日期

  • 权利金(Premium):购买期权的价格

期权交易的魅力在于其非线性特征:亏损有限(最多损失权利金),但盈利潜力无限。这种不对称性,是构建各种策略的基础。

2. 获取期权数据

import numpy as npimport pandas as pdimport matplotlib.pyplot as pltimport seaborn as snsfrom scipy import statsfrom scipy.optimize import minimizeimport warningswarnings.filterwarnings('ignore')# 设置中文字体plt.rcParams['font.sans-serif'] = ['SimHei']plt.rcParams['axes.unicode_minus'] = False# 初始化tushare proimport tushare as tsts.set_token('你的token')pro = ts.pro_api()def get_underlying_data(symbol='510050.SH', start_date='20240101', end_date='20240601'):    """    获取标的资产数据(50ETF)    """    df = pro.fund_daily(ts_code=symbol, start_date=start_date, end_date=end_date)    df['trade_date'] = pd.to_datetime(df['trade_date'])    df = df.sort_values('trade_date')    df.set_index('trade_date', inplace=True)    # 计算收益率    df['returns'] = df['close'].pct_change()    df['log_returns'] = np.log(df['close'] / df['close'].shift(1))    return dfdef get_option_data(underlying='510050.SH', trade_date='20240601'):    """    获取特定日期的期权合约数据    注意:期权数据需要专业权限,这里使用模拟数据    """    # 模拟期权数据    np.random.seed(42)    # 模拟标的资产价格    S0 = 2.5  # 50ETF当前价格    # 生成不同行权价和到期日的期权    strike_prices = np.arange(2.32.80.05)  # 行权价从2.3到2.8,步长0.05    expiration_days = [714306090]  # 不同到期日    option_data = []    for strike in strike_prices:        for days in expiration_days:            # 计算理论价格(使用Black-Scholes模型简化版)            # 实际应用中应该从市场获取真实报价            # 假设波动率曲面            moneyness = strike / S0            if moneyness < 0.95:                iv = 0.25  # 实值看跌/虚值看涨,波动率高            elif moneyness > 1.05:                iv = 0.25  # 实值看涨/虚值看跌,波动率高            else:                iv = 0.20  # 平值期权,波动率较低            # 计算理论价格            call_price = calculate_bs_price(S0, strike, days/3650.02, iv, 'call')            put_price = calculate_bs_price(S0, strike, days/3650.02, iv, 'put')            option_data.append({                'trade_date': trade_date,                'underlying': underlying,                'strike': strike,                'expiration_days': days,                'call_price': call_price,                'put_price': put_price,                'implied_vol': iv,                'moneyness': moneyness            })    return pd.DataFrame(option_data)# 获取标的资产数据underlying_data = get_underlying_data('510050.SH''20240101''20240601')print("标的资产数据示例:")print(underlying_data[['open''high''low''close''vol']].head())# 获取期权数据示例option_data = get_option_data('510050.SH''20240601')print(f"\n期权数据示例 (共{len(option_data)}个合约):")print(option_data.head())

二、期权定价模型

1. Black-Scholes模型实现

Black-Scholes模型是期权定价的经典模型,尽管有其局限性,但仍然是理解期权定价的基础。

def calculate_bs_price(S, K, T, r, sigma, option_type='call'):    """    计算Black-Scholes期权价格    参数:    S: 标的资产当前价格    K: 行权价    T: 到期时间(年)    r: 无风险利率    sigma: 波动率    option_type: 'call'或'put'    """    from scipy.stats import norm    # 计算d1和d2    d1 = (np.log(S / K) + (r + 0.5 * sigma**2) * T) / (sigma * np.sqrt(T))    d2 = d1 - sigma * np.sqrt(T)    # 计算期权价格    if option_type == 'call':        price = S * norm.cdf(d1) - K * np.exp(-r * T) * norm.cdf(d2)    elif option_type == 'put':        price = K * np.exp(-r * T) * norm.cdf(-d2) - S * norm.cdf(-d1)    else:        raise ValueError("option_type必须是'call'或'put'")    return pricedef calculate_greeks(S, K, T, r, sigma, option_type='call'):    """    计算期权希腊字母    """    from scipy.stats import norm    d1 = (np.log(S / K) + (r + 0.5 * sigma**2) * T) / (sigma * np.sqrt(T))    d2 = d1 - sigma * np.sqrt(T)    # Delta    if option_type == 'call':        delta = norm.cdf(d1)    else:  # put        delta = norm.cdf(d1) - 1    # Gamma(看涨看跌相同)    gamma = norm.pdf(d1) / (S * sigma * np.sqrt(T))    # Theta    if option_type == 'call':        theta = - (S * norm.pdf(d1) * sigma) / (2 * np.sqrt(T)) - r * K * np.exp(-r * T) * norm.cdf(d2)    else:  # put        theta = - (S * norm.pdf(d1) * sigma) / (2 * np.sqrt(T)) + r * K * np.exp(-r * T) * norm.cdf(-d2)    # Vega(看涨看跌相同)    vega = S * norm.pdf(d1) * np.sqrt(T)    # Rho    if option_type == 'call':        rho = K * T * np.exp(-r * T) * norm.cdf(d2)    else:  # put        rho = -K * T * np.exp(-r * T) * norm.cdf(-d2)    return {        'Delta': delta,        'Gamma': gamma,        'Theta': theta,        'Vega': vega,        'Rho': rho    }# 测试BS模型S = 2.5  # 标的资产价格K = 2.5  # 行权价T = 30/365  # 30天到期r = 0.02  # 无风险利率2%sigma = 0.2  # 波动率20%call_price = calculate_bs_price(S, K, T, r, sigma, 'call')put_price = calculate_bs_price(S, K, T, r, sigma, 'put')print(f"\nBlack-Scholes模型测试:")print(f"标的资产价格: {S}")print(f"行权价: {K}")print(f"到期时间: {T:.3f}年 ({int(T*365)}天)")print(f"无风险利率: {r:.1%}")print(f"波动率: {sigma:.1%}")print(f"看涨期权价格: {call_price:.4f}")print(f"看跌期权价格: {put_price:.4f}")# 计算希腊字母call_greeks = calculate_greeks(S, K, T, r, sigma, 'call')put_greeks = calculate_greeks(S, K, T, r, sigma, 'put')print("\n看涨期权希腊字母:")for greek, value in call_greeks.items():    print(f"  {greek}{value:.6f}")print("\n看跌期权希腊字母:")for greek, value in put_greeks.items():    print(f"  {greek}{value:.6f}")# 可视化期权价格与希腊字母def visualize_option_pricing(S, K_range, T, r, sigma):    """    可视化期权价格与希腊字母    """    fig, axes = plt.subplots(23, figsize=(1510))    # 计算不同行权价下的价格和希腊字母    call_prices = []    put_prices = []    deltas_call = []    deltas_put = []    gammas = []    thetas_call = []    thetas_put = []    vegas = []    for K in K_range:        call_prices.append(calculate_bs_price(S, K, T, r, sigma, 'call'))        put_prices.append(calculate_bs_price(S, K, T, r, sigma, 'put'))        greeks_call = calculate_greeks(S, K, T, r, sigma, 'call')        greeks_put = calculate_greeks(S, K, T, r, sigma, 'put')        deltas_call.append(greeks_call['Delta'])        deltas_put.append(greeks_put['Delta'])        gammas.append(greeks_call['Gamma'])  # Gamma相同        thetas_call.append(greeks_call['Theta'])        thetas_put.append(greeks_put['Theta'])        vegas.append(greeks_call['Vega'])  # Vega相同    # 期权价格    axes[00].plot(K_range, call_prices, label='看涨期权', linewidth=2)    axes[00].plot(K_range, put_prices, label='看跌期权', linewidth=2)    axes[00].axvline(x=S, color='red', linestyle='--', alpha=0.5, label='当前价格')    axes[00].set_xlabel('行权价')    axes[00].set_ylabel('期权价格')    axes[00].set_title('期权价格 vs 行权价')    axes[00].legend()    axes[00].grid(True, alpha=0.3)    # Delta    axes[01].plot(K_range, deltas_call, label='看涨Delta', linewidth=2)    axes[01].plot(K_range, deltas_put, label='看跌Delta', linewidth=2)    axes[01].axvline(x=S, color='red', linestyle='--', alpha=0.5)    axes[01].set_xlabel('行权价')    axes[01].set_ylabel('Delta')    axes[01].set_title('Delta vs 行权价')    axes[01].legend()    axes[01].grid(True, alpha=0.3)    # Gamma    axes[02].plot(K_range, gammas, label='Gamma', linewidth=2, color='green')    axes[02].axvline(x=S, color='red', linestyle='--', alpha=0.5)    axes[02].set_xlabel('行权价')    axes[02].set_ylabel('Gamma')    axes[02].set_title('Gamma vs 行权价')    axes[02].legend()    axes[02].grid(True, alpha=0.3)    # Theta    axes[10].plot(K_range, thetas_call, label='看涨Theta', linewidth=2)    axes[10].plot(K_range, thetas_put, label='看跌Theta', linewidth=2)    axes[10].axvline(x=S, color='red', linestyle='--', alpha=0.5)    axes[10].set_xlabel('行权价')    axes[10].set_ylabel('Theta')    axes[10].set_title('Theta vs 行权价')    axes[10].legend()    axes[10].grid(True, alpha=0.3)    # Vega    axes[11].plot(K_range, vegas, label='Vega', linewidth=2, color='purple')    axes[11].axvline(x=S, color='red', linestyle='--', alpha=0.5)    axes[11].set_xlabel('行权价')    axes[11].set_ylabel('Vega')    axes[11].set_title('Vega vs 行权价')    axes[11].legend()    axes[11].grid(True, alpha=0.3)    # 隐含波动率微笑(简化)    axes[12].plot(K_range/S, [sigma]*len(K_range), linewidth=2, color='orange')    axes[12].axvline(x=1, color='red', linestyle='--', alpha=0.5, label='平值')    axes[12].set_xlabel('行权价/标的价格')    axes[12].set_ylabel('隐含波动率')    axes[12].set_title('波动率微笑(简化)')    axes[12].legend()    axes[12].grid(True, alpha=0.3)    plt.tight_layout()    plt.show()# 生成行权价范围K_range = np.linspace(2.03.050)visualize_option_pricing(S, K_range, T, r, sigma)

最新文章

随机文章

基本 文件 流程 错误 SQL 调试
  1. 请求信息 : 2026-02-28 12:44:11 HTTP/2.0 GET : https://f.mffb.com.cn/a/476421.html
  2. 运行时间 : 0.180292s [ 吞吐率:5.55req/s ] 内存消耗:4,522.73kb 文件加载:140
  3. 缓存信息 : 0 reads,0 writes
  4. 会话信息 : SESSION_ID=a2193582d9072f377122c5a70b1447c2
  1. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/public/index.php ( 0.79 KB )
  2. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/autoload.php ( 0.17 KB )
  3. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/composer/autoload_real.php ( 2.49 KB )
  4. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/composer/platform_check.php ( 0.90 KB )
  5. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/composer/ClassLoader.php ( 14.03 KB )
  6. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/composer/autoload_static.php ( 4.90 KB )
  7. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-helper/src/helper.php ( 8.34 KB )
  8. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-validate/src/helper.php ( 2.19 KB )
  9. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-orm/src/helper.php ( 1.47 KB )
  10. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-orm/stubs/load_stubs.php ( 0.16 KB )
  11. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/Exception.php ( 1.69 KB )
  12. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-container/src/Facade.php ( 2.71 KB )
  13. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/symfony/deprecation-contracts/function.php ( 0.99 KB )
  14. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/symfony/polyfill-mbstring/bootstrap.php ( 8.26 KB )
  15. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/symfony/polyfill-mbstring/bootstrap80.php ( 9.78 KB )
  16. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/symfony/var-dumper/Resources/functions/dump.php ( 1.49 KB )
  17. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-dumper/src/helper.php ( 0.18 KB )
  18. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/symfony/var-dumper/VarDumper.php ( 4.30 KB )
  19. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/App.php ( 15.30 KB )
  20. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-container/src/Container.php ( 15.76 KB )
  21. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/psr/container/src/ContainerInterface.php ( 1.02 KB )
  22. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/app/provider.php ( 0.19 KB )
  23. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/Http.php ( 6.04 KB )
  24. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-helper/src/helper/Str.php ( 7.29 KB )
  25. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/Env.php ( 4.68 KB )
  26. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/app/common.php ( 0.03 KB )
  27. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/helper.php ( 18.78 KB )
  28. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/Config.php ( 5.54 KB )
  29. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/config/app.php ( 0.95 KB )
  30. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/config/cache.php ( 0.78 KB )
  31. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/config/console.php ( 0.23 KB )
  32. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/config/cookie.php ( 0.56 KB )
  33. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/config/database.php ( 2.48 KB )
  34. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/facade/Env.php ( 1.67 KB )
  35. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/config/filesystem.php ( 0.61 KB )
  36. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/config/lang.php ( 0.91 KB )
  37. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/config/log.php ( 1.35 KB )
  38. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/config/middleware.php ( 0.19 KB )
  39. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/config/route.php ( 1.89 KB )
  40. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/config/session.php ( 0.57 KB )
  41. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/config/trace.php ( 0.34 KB )
  42. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/config/view.php ( 0.82 KB )
  43. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/app/event.php ( 0.25 KB )
  44. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/Event.php ( 7.67 KB )
  45. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/app/service.php ( 0.13 KB )
  46. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/app/AppService.php ( 0.26 KB )
  47. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/Service.php ( 1.64 KB )
  48. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/Lang.php ( 7.35 KB )
  49. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/lang/zh-cn.php ( 13.70 KB )
  50. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/initializer/Error.php ( 3.31 KB )
  51. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/initializer/RegisterService.php ( 1.33 KB )
  52. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/services.php ( 0.14 KB )
  53. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/service/PaginatorService.php ( 1.52 KB )
  54. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/service/ValidateService.php ( 0.99 KB )
  55. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/service/ModelService.php ( 2.04 KB )
  56. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-trace/src/Service.php ( 0.77 KB )
  57. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/Middleware.php ( 6.72 KB )
  58. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/initializer/BootService.php ( 0.77 KB )
  59. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-orm/src/Paginator.php ( 11.86 KB )
  60. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-validate/src/Validate.php ( 63.20 KB )
  61. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-orm/src/Model.php ( 23.55 KB )
  62. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-orm/src/model/concern/Attribute.php ( 21.05 KB )
  63. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-orm/src/model/concern/AutoWriteData.php ( 4.21 KB )
  64. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-orm/src/model/concern/Conversion.php ( 6.44 KB )
  65. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-orm/src/model/concern/DbConnect.php ( 5.16 KB )
  66. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-orm/src/model/concern/ModelEvent.php ( 2.33 KB )
  67. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-orm/src/model/concern/RelationShip.php ( 28.29 KB )
  68. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-helper/src/contract/Arrayable.php ( 0.09 KB )
  69. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-helper/src/contract/Jsonable.php ( 0.13 KB )
  70. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-orm/src/model/contract/Modelable.php ( 0.09 KB )
  71. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/Db.php ( 2.88 KB )
  72. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-orm/src/DbManager.php ( 8.52 KB )
  73. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/Log.php ( 6.28 KB )
  74. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/Manager.php ( 3.92 KB )
  75. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/psr/log/src/LoggerTrait.php ( 2.69 KB )
  76. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/psr/log/src/LoggerInterface.php ( 2.71 KB )
  77. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/Cache.php ( 4.92 KB )
  78. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/psr/simple-cache/src/CacheInterface.php ( 4.71 KB )
  79. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-helper/src/helper/Arr.php ( 16.63 KB )
  80. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/cache/driver/File.php ( 7.84 KB )
  81. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/cache/Driver.php ( 9.03 KB )
  82. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/contract/CacheHandlerInterface.php ( 1.99 KB )
  83. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/app/Request.php ( 0.09 KB )
  84. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/Request.php ( 55.78 KB )
  85. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/app/middleware.php ( 0.25 KB )
  86. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/Pipeline.php ( 2.61 KB )
  87. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-trace/src/TraceDebug.php ( 3.40 KB )
  88. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/middleware/SessionInit.php ( 1.94 KB )
  89. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/Session.php ( 1.80 KB )
  90. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/session/driver/File.php ( 6.27 KB )
  91. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/contract/SessionHandlerInterface.php ( 0.87 KB )
  92. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/session/Store.php ( 7.12 KB )
  93. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/Route.php ( 23.73 KB )
  94. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/route/RuleName.php ( 5.75 KB )
  95. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/route/Domain.php ( 2.53 KB )
  96. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/route/RuleGroup.php ( 22.43 KB )
  97. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/route/Rule.php ( 26.95 KB )
  98. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/route/RuleItem.php ( 9.78 KB )
  99. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/route/app.php ( 1.72 KB )
  100. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/facade/Route.php ( 4.70 KB )
  101. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/route/dispatch/Controller.php ( 4.74 KB )
  102. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/route/Dispatch.php ( 10.44 KB )
  103. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/app/controller/Index.php ( 4.81 KB )
  104. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/app/BaseController.php ( 2.05 KB )
  105. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-orm/src/facade/Db.php ( 0.93 KB )
  106. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-orm/src/db/connector/Mysql.php ( 5.44 KB )
  107. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-orm/src/db/PDOConnection.php ( 52.47 KB )
  108. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-orm/src/db/Connection.php ( 8.39 KB )
  109. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-orm/src/db/ConnectionInterface.php ( 4.57 KB )
  110. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-orm/src/db/builder/Mysql.php ( 16.58 KB )
  111. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-orm/src/db/Builder.php ( 24.06 KB )
  112. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-orm/src/db/BaseBuilder.php ( 27.50 KB )
  113. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-orm/src/db/Query.php ( 15.71 KB )
  114. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-orm/src/db/BaseQuery.php ( 45.13 KB )
  115. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-orm/src/db/concern/TimeFieldQuery.php ( 7.43 KB )
  116. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-orm/src/db/concern/AggregateQuery.php ( 3.26 KB )
  117. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-orm/src/db/concern/ModelRelationQuery.php ( 20.07 KB )
  118. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-orm/src/db/concern/ParamsBind.php ( 3.66 KB )
  119. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-orm/src/db/concern/ResultOperation.php ( 7.01 KB )
  120. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-orm/src/db/concern/WhereQuery.php ( 19.37 KB )
  121. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-orm/src/db/concern/JoinAndViewQuery.php ( 7.11 KB )
  122. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-orm/src/db/concern/TableFieldInfo.php ( 2.63 KB )
  123. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-orm/src/db/concern/Transaction.php ( 2.77 KB )
  124. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/log/driver/File.php ( 5.96 KB )
  125. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/contract/LogHandlerInterface.php ( 0.86 KB )
  126. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/log/Channel.php ( 3.89 KB )
  127. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/event/LogRecord.php ( 1.02 KB )
  128. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-helper/src/Collection.php ( 16.47 KB )
  129. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/facade/View.php ( 1.70 KB )
  130. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/View.php ( 4.39 KB )
  131. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/Response.php ( 8.81 KB )
  132. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/response/View.php ( 3.29 KB )
  133. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/Cookie.php ( 6.06 KB )
  134. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-view/src/Think.php ( 8.38 KB )
  135. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/contract/TemplateHandlerInterface.php ( 1.60 KB )
  136. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-template/src/Template.php ( 46.61 KB )
  137. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-template/src/template/driver/File.php ( 2.41 KB )
  138. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-template/src/template/contract/DriverInterface.php ( 0.86 KB )
  139. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/runtime/temp/067d451b9a0c665040f3f1bdd3293d68.php ( 11.98 KB )
  140. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-trace/src/Html.php ( 4.42 KB )
  1. CONNECT:[ UseTime:0.000411s ] mysql:host=127.0.0.1;port=3306;dbname=f_mffb;charset=utf8mb4
  2. SHOW FULL COLUMNS FROM `fenlei` [ RunTime:0.000625s ]
  3. SELECT * FROM `fenlei` WHERE `fid` = 0 [ RunTime:0.014261s ]
  4. SELECT * FROM `fenlei` WHERE `fid` = 63 [ RunTime:0.008133s ]
  5. SHOW FULL COLUMNS FROM `set` [ RunTime:0.000716s ]
  6. SELECT * FROM `set` [ RunTime:0.000232s ]
  7. SHOW FULL COLUMNS FROM `article` [ RunTime:0.000808s ]
  8. SELECT * FROM `article` WHERE `id` = 476421 LIMIT 1 [ RunTime:0.007982s ]
  9. UPDATE `article` SET `lasttime` = 1772253852 WHERE `id` = 476421 [ RunTime:0.019288s ]
  10. SELECT * FROM `fenlei` WHERE `id` = 66 LIMIT 1 [ RunTime:0.000341s ]
  11. SELECT * FROM `article` WHERE `id` < 476421 ORDER BY `id` DESC LIMIT 1 [ RunTime:0.006999s ]
  12. SELECT * FROM `article` WHERE `id` > 476421 ORDER BY `id` ASC LIMIT 1 [ RunTime:0.009003s ]
  13. SELECT * FROM `article` WHERE `id` < 476421 ORDER BY `id` DESC LIMIT 10 [ RunTime:0.020574s ]
  14. SELECT * FROM `article` WHERE `id` < 476421 ORDER BY `id` DESC LIMIT 10,10 [ RunTime:0.009971s ]
  15. SELECT * FROM `article` WHERE `id` < 476421 ORDER BY `id` DESC LIMIT 20,10 [ RunTime:0.003133s ]
0.183021s