乐于分享
好东西不私藏

构建交易安全防线:自动止损策略(附源码)

构建交易安全防线:自动止损策略(附源码)

策略概述

本策略实现持仓股票的自动止损功能,根据不同持仓类型(ETF/主板/科创板/创业板)设置差异化的止损率,支持固定止损与移动止损两种方式。

持仓类型识别

类型
代码特征
判定规则
ETF(含LOF)
51/15/16 开头
6 位数字,以 51、15 或 16 开头
科创板
688 开头
以 688 开头
创业板
30 开头
以 30 开头
主板
其他
除上述外的其他 A 股

止损方式说明

方式值
名称
说明
0
关闭
不启用止损
1
固定止损
基于成本价计算止损价,当最新价跌破止损价时触发
2
移动止损
基于持仓以来历史最高价计算止损价,当最新价跌破止损价时触发
3
联合止损
固定止损或移动止损任一条件触发即执行卖出

止损价计算

  • 固定止损
    止损价 = 成本价 × (1 - 止损比例)
  • 移动止损
    止损价 = 最高价 × (1 - 移动止损比例)

默认参数配置

止损方式

g.stop_loss_method_etf = 1      # ETF: 固定止损
g.stop_loss_method_main = 3     # 主板: 联合止损
g.stop_loss_method_star = 3     # 科创板: 联合止损
g.stop_loss_method_chinext = 3  # 创业板: 联合止损

固定止损比例(成本价基准)

g.fixed_stop_loss_etf = 0.05      # ETF: 5%
g.fixed_stop_loss_main = 0.05    # 主板: 5%
g.fixed_stop_loss_star = 0.07    # 科创板: 7%
g.fixed_stop_loss_chinext = 0.07   # 创业板: 7%

移动止损比例(历史最高价基准)

g.trailing_stop_loss_etf = 0.07      # ETF: 7%
g.trailing_stop_loss_main = 0.08    # 主板: 8%
g.trailing_stop_loss_star = 0.10    # 科创板: 10%
g.trailing_stop_loss_chinext = 0.10  # 创业板: 10%

运行机制

执行时间

时间点
函数
功能
09:10
check_positions
开盘后检查持仓,补录最高价
09:25
check_before_trade
盘前初始化,清空当日卖出记录
交易时段每分钟
handle_data
执行分钟级止损检查

交易时段

止损检查仅在以下时间段执行:

  • 上午:09:30 - 11:30
  • 下午:13:00 - 14:57

参数调整指南

如何修改止损方式

在 initialize 函数中找到对应类型的变量并修改:

# 关闭某类止损
g.stop_loss_method_etf = 0

# 仅使用固定止损
g.stop_loss_method_main = 1

# 仅使用移动止损
g.stop_loss_method_star = 2

# 联合止损
g.stop_loss_method_chinext = 3

如何调整止损比例

# 降低止损幅度(更保守)
g.fixed_stop_loss_etf = 0.03   # 3%
g.trailing_stop_loss_etf = 0.05  # 5%

# 提高止损幅度(更激进)
g.fixed_stop_loss_main = 0.08  # 8%
g.trailing_stop_loss_main = 0.10  # 10%

风险提示

  1. 科创板/创业板
    :涨跌幅为 20%,止损比例应适当放大
  2. 主板
    :涨跌幅为 10%,默认 5% 止损相对合理
  3. ETF
    :波动较小,可设置较低止损比例
  4. T+1 限制
    :当日买入无法当日卖出,策略无法对当日新买入股票执行止损
  5. 流动性风险
    :止损卖出可能因涨跌停或流动性不足而失败

常见问题

Q: 止损触发后是否一定会卖出?

A: 不一定。如果股票涨跌停或停牌,卖出订单可能失败。策略会记录失败并在下一次检查时重试。

Q: 移动止损的「最高价」如何计算?

A: 策略会持续追踪持仓期间的最高价,每次更新都会比较并记录新的最高点。

Q: 联合止损和单独使用哪种方式更好?

A: 联合止损(方式 3)更为激进,任一条件触发即卖出;单独使用固定或移动止损相对保守。建议根据风险承受能力选择。

源代码

# 说明:策略代码使用ptrade系统api实现# 版本:自动止损策略# 功能:按持仓类型(ETF/主板/科创板)设置差异化止损率,支持固定止损与移动止损import numpy as npimport mathfrom datetime import datetime, date, timedeltaimport pandas as pd# ==========================# 持仓类型识别# ==========================def get_security_type(code):    """    识别持仓类型    返回: 'ETF', 'STAR'(科创板), 'CHINEXT'(创业板), 'MAIN'(主板)    """    if not isinstance(code, str):        return 'MAIN'    code_clean = code.split('.')[0]    # [Bug1修复] 加括号明确 and/or 优先级,两个条件均需校验长度==6    if (code_clean.startswith('51'and len(code_clean) == 6or \       (code_clean.startswith('15'and len(code_clean) == 6or \       (code_clean.startswith('16'and len(code_clean) == 6):        return 'ETF'    if code_clean.startswith('688'):        return 'STAR'    if code_clean.startswith('30'):        return 'CHINEXT'    return 'MAIN'# ==================== 初始化模块 ====================def initialize(context):    log.info("========== 策略初始化开始 ==========")    # ---------- 止损方式 ----------    # 0: 关闭, 1: 固定比例止损, 2: 移动止损, 3: 联合止损(固定+移动任一触发)    g.stop_loss_method_etf = 1    g.stop_loss_method_main = 3    g.stop_loss_method_star = 3    g.stop_loss_method_chinext = 3    # ---------- 固定止损比例(成本价基准)----------    g.fixed_stop_loss_etf = 0.05       # ETF: 5% 止损    g.fixed_stop_loss_main = 0.05     # 主板: 5% 止损    g.fixed_stop_loss_star = 0.7     # 科创板: 7% 止损    g.fixed_stop_loss_chinext = 0.7  # 创业板: 7% 止损    # ---------- 移动止损比例(历史最高价基准)----------    g.trailing_stop_loss_etf = 0.07       # ETF: 7% 移动止损    g.trailing_stop_loss_main = 0.8      # 主板: 8% 移动止损    g.trailing_stop_loss_star = 0.10     # 科创板: 10% 移动止损    g.trailing_stop_loss_chinext = 0.10   # 创业板: 10% 移动止损    # ---------- 运行时变量 ----------    g.sold_today = set()                  # 今日卖出的标的    g.position_high_price = {}            # 各持仓的最高价(移动止损用)    # ---------- 交易调度 ----------    run_daily(context, check_positions, time='09:10')    run_daily(context, check_before_trade, time='09:25')    # ---------- 设置持仓最高价 ----------    for security, position in context.portfolio.positions.items():        if position.amount <= 0:            continue        high_price = max(position.cost_basis, position.last_sale_price) if hasattr(position, 'last_sale_price'and position.last_sale_price > 0 else position.cost_basis        g.position_high_price[security] = high_price    if g.position_high_price:        log.info(f"📊 持仓最高价已设置: { {k: f'{v:.3f}'for k, v in g.position_high_price.items()} }")    else:        log.info("📊 无历史持仓,运行时实时更新最高价")    log.info("========== 策略初始化完成 ==========")def update_all_high_prices(context):    """每分钟批量更新所有持仓的最高价"""    securities = list(context.portfolio.positions.keys())    minute_data =  get_history(            count=1, frequency='1m',            field=['open''high''low''close'],            security_list=securities, fq='pre', include=True, fill='pre', is_dict=True        )    all_data = minute_data    log.info(f"📊 最新分钟数据: {all_data}")    for security in securities:        position = context.portfolio.positions[security]        if position.amount <= 0:            continue        stock_info = all_data[security][0]        if stock_info is None:            continue        current_price = stock_info['high']        if current_price <= 0:            continue        update_position_high_price(context, security, current_price)def handle_data(context, data):    update_all_high_prices(context)    minute_stop_loss(context)def check_before_trade(context):    """    每日 09:25 开盘前初始化    """    g.sold_today = set()    log.info("📊 今日止损标的列表已清空")    check_positions(context)def check_positions(context):    """    每日 09:10 开盘后检查    """    for security, position in context.portfolio.positions.items():        if security not in g.position_high_price:            if position.enable_amount > 0:                high_price = max(position.cost_basis, position.last_sale_price) if hasattr(position, 'last_sale_price'and position.last_sale_price > 0 else position.cost_basis                g.position_high_price[security] = high_price                log.info(f"📊 盘前 补录持仓最高价: {security} = {high_price:.3f}")# ==================== 止损参数获取 ====================def get_stop_loss_params(security):    """    根据持仓类型获取止损参数    返回: (method, threshold_fixed, threshold_trailing)        method: 0=关闭, 1=固定止损, 2=移动止损, 3=联合止损(任一触发)        threshold_fixed: 固定止损比例        threshold_trailing: 移动止损比例    """    sec_type = get_security_type(security)    if sec_type == 'ETF':        return g.stop_loss_method_etf, g.fixed_stop_loss_etf, g.trailing_stop_loss_etf    elif sec_type == 'STAR':        return g.stop_loss_method_star, g.fixed_stop_loss_star, g.trailing_stop_loss_star    elif sec_type == 'CHINEXT':        return g.stop_loss_method_chinext, g.fixed_stop_loss_chinext, g.trailing_stop_loss_chinext    else:        return g.stop_loss_method_main, g.fixed_stop_loss_main, g.trailing_stop_loss_main# ==================== 更新持仓最高价 ====================def update_position_high_price(context, security, current_price):    """    更新持仓历史最高价    移动止损基于持仓以来的最高点回撤    """    if security not in g.position_high_price:        g.position_high_price[security] = current_price    else:        if current_price > g.position_high_price[security]:            g.position_high_price[security] = current_price# ==================== 获取持仓最高价 ====================def get_position_high_price(context, security):    """    获取持仓以来的最高价    由 handle_data 每分钟统一更新,此处仅读取    """    return g.position_high_price.get(security)# ==================== 分钟级止损主函数 ====================def minute_stop_loss(context):    """    分钟级止损检查    - 支持固定比例止损(基于成本价)    - 支持移动止损(基于持仓以来最高价)    - 仅在交易时间段执行    - 触发后全仓卖出并记录sold_today    """    current_time = context.blotter.current_dt.strftime('%H:%M')    if not (('09:30' <= current_time <= '11:30'or ('13:00' <= current_time <= '14:57')):        return    for security in list(context.portfolio.positions.keys()):        position = context.portfolio.positions[security]        if position.enable_amount <= 0:            continue        current_price = get_current_data([security])[security].last_price        if current_price <= 0 or math.isnan(current_price) or math.isinf(current_price):            continue        cost_basis = position.cost_basis        if cost_basis <= 0:            continue        sec_type = get_security_type(security)        method, threshold_fixed, threshold_trailing = get_stop_loss_params(security)        if method == 0:            continue        stop_triggered = False        stop_type = ""        if method == 1:            stop_price = cost_basis * (1 - threshold_fixed)            if current_price <= stop_price:                stop_triggered = True                stop_type = "固定止损"        elif method == 2:            high_price = get_position_high_price(context, security)            if high_price is not None and high_price > 0:                trailing_stop_price = high_price * (1 - threshold_trailing)                if current_price <= trailing_stop_price:                    stop_triggered = True                    stop_type = "移动止损"        elif method == 3:            fixed_triggered = current_price <= cost_basis * (1 - threshold_fixed)            high_price = get_position_high_price(context, security)            trailing_triggered = False            if high_price is not None and high_price > 0:                trailing_stop_price = high_price * (1 - threshold_trailing)                if current_price <= trailing_stop_price:                    trailing_triggered = True            if fixed_triggered or trailing_triggered:                stop_triggered = True                stop_type = "联合止损"        if stop_triggered:            security_name = get_name(security)            loss_pct = (current_price / cost_basis - 1) * 100            log.info(f"🚨 【{stop_type}{security}{security_name} 类型:{sec_type} "                     f"当前价:{current_price:.3f} 成本:{cost_basis:.3f} 亏损:{loss_pct:.2f}%")            if order(security, -position.enable_amount): #smart_order_target_value(security, 0, context):                log.info(f"   ✅ 止损卖出成功")                g.sold_today.add(security)                if security in g.position_high_price:                    del g.position_high_price[security]            else:                log.warning(f"   ❌ 止损卖出失败")def get_name(security):    """获取证券名称,带异常处理"""    try:        result = get_stock_name(security)        if isinstance(result, dict):            return result.get(security, security)        return result    except Exception:        return securitydef get_current_data(stock=None):    """    PTrade 兼容聚宽 API:get_current_data()    实盘使用 get_snapshot,回测使用 get_history    返回值:一个dict, 其中 key 是股票代码, value 是拥有如下属性的对象        last_price : 最新价,09:30之前获取返回昨日收盘价        high_limit: 涨停价        low_limit: 跌停价        paused: 是否停牌, 当停牌、未上市或者退市后返回 True        is_st: 是否是 ST(包括ST, *ST),是则返回 True,否则返回 False        day_open: 当天开盘价        name: 股票现在的名称    if stock is None and current_data is None:        security_list = g.etf_pool + [g.defensive_etf]        if is_trade():            current_data = _get_current_data_realtime(security_list)        else:            current_data = _get_current_data_backtest(security_list)    """    if isinstance(stock, str):        security_list = [stock]    else:        security_list = list(stock)    if is_trade():        return _get_current_data_realtime(security_list)    else:        return _get_current_data_backtest(security_list)def _get_current_data_realtime(security_list):    """    实盘:通过 get_snapshot 获取实时行情    """    current_data = {}    try:        snapshot = get_snapshot(security_list)    except Exception as e:        log.warning("get_snapshot 获取失败: %s" % str(e))        return _get_current_data_backtest(security_list)    for code in security_list:        info = snapshot.get(code, {})        stock_info = {            'last_price'float(info.get('last_px'0or 0),            'high_limit'float(info.get('up_px'0or 0),            'low_limit'float(info.get('down_px'0or 0),            'day_open'float(info.get('open_px'0or 0),            'paused': info.get('trade_status''TRADE'in ('HALT''SUSP''STOPT''SUSPENDED'),            'is_st'False,            'name': info.get('name'''),        }        if stock_info['high_limit'] == 0 and stock_info['last_price'] > 0:            stock_info['high_limit'] = stock_info['last_price'] * 1.1        if stock_info['low_limit'] == 0 and stock_info['last_price'] > 0:            stock_info['low_limit'] = stock_info['last_price'] * 0.9        if 'ST' in stock_info['name'or '*ST' in stock_info['name'or '退' in stock_info['name']:            stock_info['is_st'] = True        stock_obj = type('StockInfo', (), stock_info)()        current_data[code] = stock_obj    return current_datadef _get_current_data_backtest(security_list):    """    回测:通过 get_history 获取日线和分钟数据    """    current_data = {}    for code in security_list:        stock_info = {}        day_df = get_history(            count=1,            frequency='1d',            field=['close''open''high''low''high_limit''low_limit''is_open''preclose'],            security_list=code,            fq='pre',            include=True        )        minute_df = get_history(            count=1,            frequency='1m',            field=['price''close'],            security_list=code,            fq='pre',            include=False,            fill='pre'        )        if day_df is not None and not day_df.empty:            row = day_df.iloc[-1]            stock_info['high_limit'] = float(row.get('high_limit'0))            stock_info['low_limit'] = float(row.get('low_limit'0))            stock_info['day_open'] = float(row.get('open'0))            stock_info['paused'] = (int(row.get('is_open'1)) == 0)            if minute_df is not None and not minute_df.empty:                if 'price' in minute_df.columns:                    stock_info['last_price'] = float(minute_df['price'].iloc[-1])                elif 'close' in minute_df.columns:                    stock_info['last_price'] = float(minute_df['close'].iloc[-1])                else:                    stock_info['last_price'] = float(row.get('close'0))            else:                stock_info['last_price'] = float(row.get('close'0))        else:            stock_info['high_limit'] = 0            stock_info['low_limit'] = 0            stock_info['day_open'] = 0            stock_info['last_price'] = 0            stock_info['paused'] = True        if stock_info['high_limit'] == 0 and stock_info['last_price'] > 0:            stock_info['high_limit'] = stock_info['last_price'] * 1.1        if stock_info['low_limit'] == 0 and stock_info['last_price'] > 0:            stock_info['low_limit'] = stock_info['last_price'] * 0.9        stock_info['is_st'] = False        try:            info = get_stock_info(code)            stock_info['name'] = info.get('stock_name'''if isinstance(info, dictelse ''        except Exception:            stock_info['name'] = ''        if 'ST' in stock_info['name'or '*ST' in stock_info['name'or '退' in stock_info['name']:            stock_info['is_st'] = True        stock_obj = type('StockInfo', (), stock_info)()        current_data[code] = stock_obj    return current_data

免责声明:

  1. 本公众号所有策略(含源代码)仅供学习研究参考,不构成任何投资建议
  2. 量化策略过往业绩不代表未来表现,实盘交易结果可能与回测存在显著差异
  3. 股票投资存在风险,入市需谨慎,投资者需自行承担投资后果
  4. 策略使用者应根据自身风险承受能力适当调整参数,并在实盘前进行充分模拟测试
  5. 本策略开发者和提供方不对策略的准确性、完整性、有效性做任何明示或暗示的保证
基本 文件 流程 错误 SQL 调试
  1. 请求信息 : 2026-06-04 09:58:26 HTTP/1.1 GET : https://www.yeyulingfeng.com/a/708154.html
  2. 运行时间 : 0.176728s [ 吞吐率:5.66req/s ] 内存消耗:4,806.24kb 文件加载:145
  3. 缓存信息 : 0 reads,0 writes
  4. 会话信息 : SESSION_ID=641cfd7dfa92e2b9d2ab3984f498a96e
  1. /yingpanguazai/ssd/ssd1/www/wwww.yeyulingfeng.com/public/index.php ( 0.79 KB )
  2. /yingpanguazai/ssd/ssd1/www/wwww.yeyulingfeng.com/vendor/autoload.php ( 0.17 KB )
  3. /yingpanguazai/ssd/ssd1/www/wwww.yeyulingfeng.com/vendor/composer/autoload_real.php ( 2.49 KB )
  4. /yingpanguazai/ssd/ssd1/www/wwww.yeyulingfeng.com/vendor/composer/platform_check.php ( 0.90 KB )
  5. /yingpanguazai/ssd/ssd1/www/wwww.yeyulingfeng.com/vendor/composer/ClassLoader.php ( 14.03 KB )
  6. /yingpanguazai/ssd/ssd1/www/wwww.yeyulingfeng.com/vendor/composer/autoload_static.php ( 6.05 KB )
  7. /yingpanguazai/ssd/ssd1/www/wwww.yeyulingfeng.com/vendor/topthink/think-helper/src/helper.php ( 8.34 KB )
  8. /yingpanguazai/ssd/ssd1/www/wwww.yeyulingfeng.com/vendor/topthink/think-validate/src/helper.php ( 2.19 KB )
  9. /yingpanguazai/ssd/ssd1/www/wwww.yeyulingfeng.com/vendor/ralouphie/getallheaders/src/getallheaders.php ( 1.60 KB )
  10. /yingpanguazai/ssd/ssd1/www/wwww.yeyulingfeng.com/vendor/topthink/think-orm/src/helper.php ( 1.47 KB )
  11. /yingpanguazai/ssd/ssd1/www/wwww.yeyulingfeng.com/vendor/topthink/think-orm/stubs/load_stubs.php ( 0.16 KB )
  12. /yingpanguazai/ssd/ssd1/www/wwww.yeyulingfeng.com/vendor/topthink/framework/src/think/Exception.php ( 1.69 KB )
  13. /yingpanguazai/ssd/ssd1/www/wwww.yeyulingfeng.com/vendor/topthink/think-container/src/Facade.php ( 2.71 KB )
  14. /yingpanguazai/ssd/ssd1/www/wwww.yeyulingfeng.com/vendor/symfony/deprecation-contracts/function.php ( 0.99 KB )
  15. /yingpanguazai/ssd/ssd1/www/wwww.yeyulingfeng.com/vendor/symfony/polyfill-mbstring/bootstrap.php ( 8.26 KB )
  16. /yingpanguazai/ssd/ssd1/www/wwww.yeyulingfeng.com/vendor/symfony/polyfill-mbstring/bootstrap80.php ( 9.78 KB )
  17. /yingpanguazai/ssd/ssd1/www/wwww.yeyulingfeng.com/vendor/symfony/var-dumper/Resources/functions/dump.php ( 1.49 KB )
  18. /yingpanguazai/ssd/ssd1/www/wwww.yeyulingfeng.com/vendor/topthink/think-dumper/src/helper.php ( 0.18 KB )
  19. /yingpanguazai/ssd/ssd1/www/wwww.yeyulingfeng.com/vendor/symfony/var-dumper/VarDumper.php ( 4.30 KB )
  20. /yingpanguazai/ssd/ssd1/www/wwww.yeyulingfeng.com/vendor/guzzlehttp/guzzle/src/functions_include.php ( 0.16 KB )
  21. /yingpanguazai/ssd/ssd1/www/wwww.yeyulingfeng.com/vendor/guzzlehttp/guzzle/src/functions.php ( 5.54 KB )
  22. /yingpanguazai/ssd/ssd1/www/wwww.yeyulingfeng.com/vendor/topthink/framework/src/think/App.php ( 15.30 KB )
  23. /yingpanguazai/ssd/ssd1/www/wwww.yeyulingfeng.com/vendor/topthink/think-container/src/Container.php ( 15.76 KB )
  24. /yingpanguazai/ssd/ssd1/www/wwww.yeyulingfeng.com/vendor/psr/container/src/ContainerInterface.php ( 1.02 KB )
  25. /yingpanguazai/ssd/ssd1/www/wwww.yeyulingfeng.com/app/provider.php ( 0.19 KB )
  26. /yingpanguazai/ssd/ssd1/www/wwww.yeyulingfeng.com/vendor/topthink/framework/src/think/Http.php ( 6.04 KB )
  27. /yingpanguazai/ssd/ssd1/www/wwww.yeyulingfeng.com/vendor/topthink/think-helper/src/helper/Str.php ( 7.29 KB )
  28. /yingpanguazai/ssd/ssd1/www/wwww.yeyulingfeng.com/vendor/topthink/framework/src/think/Env.php ( 4.68 KB )
  29. /yingpanguazai/ssd/ssd1/www/wwww.yeyulingfeng.com/app/common.php ( 0.03 KB )
  30. /yingpanguazai/ssd/ssd1/www/wwww.yeyulingfeng.com/vendor/topthink/framework/src/helper.php ( 18.78 KB )
  31. /yingpanguazai/ssd/ssd1/www/wwww.yeyulingfeng.com/vendor/topthink/framework/src/think/Config.php ( 5.54 KB )
  32. /yingpanguazai/ssd/ssd1/www/wwww.yeyulingfeng.com/config/alipay.php ( 3.59 KB )
  33. /yingpanguazai/ssd/ssd1/www/wwww.yeyulingfeng.com/vendor/topthink/framework/src/think/facade/Env.php ( 1.67 KB )
  34. /yingpanguazai/ssd/ssd1/www/wwww.yeyulingfeng.com/config/app.php ( 0.95 KB )
  35. /yingpanguazai/ssd/ssd1/www/wwww.yeyulingfeng.com/config/cache.php ( 0.78 KB )
  36. /yingpanguazai/ssd/ssd1/www/wwww.yeyulingfeng.com/config/console.php ( 0.23 KB )
  37. /yingpanguazai/ssd/ssd1/www/wwww.yeyulingfeng.com/config/cookie.php ( 0.56 KB )
  38. /yingpanguazai/ssd/ssd1/www/wwww.yeyulingfeng.com/config/database.php ( 2.48 KB )
  39. /yingpanguazai/ssd/ssd1/www/wwww.yeyulingfeng.com/config/filesystem.php ( 0.61 KB )
  40. /yingpanguazai/ssd/ssd1/www/wwww.yeyulingfeng.com/config/lang.php ( 0.91 KB )
  41. /yingpanguazai/ssd/ssd1/www/wwww.yeyulingfeng.com/config/log.php ( 1.35 KB )
  42. /yingpanguazai/ssd/ssd1/www/wwww.yeyulingfeng.com/config/middleware.php ( 0.19 KB )
  43. /yingpanguazai/ssd/ssd1/www/wwww.yeyulingfeng.com/config/route.php ( 1.89 KB )
  44. /yingpanguazai/ssd/ssd1/www/wwww.yeyulingfeng.com/config/session.php ( 0.57 KB )
  45. /yingpanguazai/ssd/ssd1/www/wwww.yeyulingfeng.com/config/trace.php ( 0.34 KB )
  46. /yingpanguazai/ssd/ssd1/www/wwww.yeyulingfeng.com/config/view.php ( 0.82 KB )
  47. /yingpanguazai/ssd/ssd1/www/wwww.yeyulingfeng.com/app/event.php ( 0.25 KB )
  48. /yingpanguazai/ssd/ssd1/www/wwww.yeyulingfeng.com/vendor/topthink/framework/src/think/Event.php ( 7.67 KB )
  49. /yingpanguazai/ssd/ssd1/www/wwww.yeyulingfeng.com/app/service.php ( 0.13 KB )
  50. /yingpanguazai/ssd/ssd1/www/wwww.yeyulingfeng.com/app/AppService.php ( 0.26 KB )
  51. /yingpanguazai/ssd/ssd1/www/wwww.yeyulingfeng.com/vendor/topthink/framework/src/think/Service.php ( 1.64 KB )
  52. /yingpanguazai/ssd/ssd1/www/wwww.yeyulingfeng.com/vendor/topthink/framework/src/think/Lang.php ( 7.35 KB )
  53. /yingpanguazai/ssd/ssd1/www/wwww.yeyulingfeng.com/vendor/topthink/framework/src/lang/zh-cn.php ( 13.70 KB )
  54. /yingpanguazai/ssd/ssd1/www/wwww.yeyulingfeng.com/vendor/topthink/framework/src/think/initializer/Error.php ( 3.31 KB )
  55. /yingpanguazai/ssd/ssd1/www/wwww.yeyulingfeng.com/vendor/topthink/framework/src/think/initializer/RegisterService.php ( 1.33 KB )
  56. /yingpanguazai/ssd/ssd1/www/wwww.yeyulingfeng.com/vendor/services.php ( 0.14 KB )
  57. /yingpanguazai/ssd/ssd1/www/wwww.yeyulingfeng.com/vendor/topthink/framework/src/think/service/PaginatorService.php ( 1.52 KB )
  58. /yingpanguazai/ssd/ssd1/www/wwww.yeyulingfeng.com/vendor/topthink/framework/src/think/service/ValidateService.php ( 0.99 KB )
  59. /yingpanguazai/ssd/ssd1/www/wwww.yeyulingfeng.com/vendor/topthink/framework/src/think/service/ModelService.php ( 2.04 KB )
  60. /yingpanguazai/ssd/ssd1/www/wwww.yeyulingfeng.com/vendor/topthink/think-trace/src/Service.php ( 0.77 KB )
  61. /yingpanguazai/ssd/ssd1/www/wwww.yeyulingfeng.com/vendor/topthink/framework/src/think/Middleware.php ( 6.72 KB )
  62. /yingpanguazai/ssd/ssd1/www/wwww.yeyulingfeng.com/vendor/topthink/framework/src/think/initializer/BootService.php ( 0.77 KB )
  63. /yingpanguazai/ssd/ssd1/www/wwww.yeyulingfeng.com/vendor/topthink/think-orm/src/Paginator.php ( 11.86 KB )
  64. /yingpanguazai/ssd/ssd1/www/wwww.yeyulingfeng.com/vendor/topthink/think-validate/src/Validate.php ( 63.20 KB )
  65. /yingpanguazai/ssd/ssd1/www/wwww.yeyulingfeng.com/vendor/topthink/think-orm/src/Model.php ( 23.55 KB )
  66. /yingpanguazai/ssd/ssd1/www/wwww.yeyulingfeng.com/vendor/topthink/think-orm/src/model/concern/Attribute.php ( 21.05 KB )
  67. /yingpanguazai/ssd/ssd1/www/wwww.yeyulingfeng.com/vendor/topthink/think-orm/src/model/concern/AutoWriteData.php ( 4.21 KB )
  68. /yingpanguazai/ssd/ssd1/www/wwww.yeyulingfeng.com/vendor/topthink/think-orm/src/model/concern/Conversion.php ( 6.44 KB )
  69. /yingpanguazai/ssd/ssd1/www/wwww.yeyulingfeng.com/vendor/topthink/think-orm/src/model/concern/DbConnect.php ( 5.16 KB )
  70. /yingpanguazai/ssd/ssd1/www/wwww.yeyulingfeng.com/vendor/topthink/think-orm/src/model/concern/ModelEvent.php ( 2.33 KB )
  71. /yingpanguazai/ssd/ssd1/www/wwww.yeyulingfeng.com/vendor/topthink/think-orm/src/model/concern/RelationShip.php ( 28.29 KB )
  72. /yingpanguazai/ssd/ssd1/www/wwww.yeyulingfeng.com/vendor/topthink/think-helper/src/contract/Arrayable.php ( 0.09 KB )
  73. /yingpanguazai/ssd/ssd1/www/wwww.yeyulingfeng.com/vendor/topthink/think-helper/src/contract/Jsonable.php ( 0.13 KB )
  74. /yingpanguazai/ssd/ssd1/www/wwww.yeyulingfeng.com/vendor/topthink/think-orm/src/model/contract/Modelable.php ( 0.09 KB )
  75. /yingpanguazai/ssd/ssd1/www/wwww.yeyulingfeng.com/vendor/topthink/framework/src/think/Db.php ( 2.88 KB )
  76. /yingpanguazai/ssd/ssd1/www/wwww.yeyulingfeng.com/vendor/topthink/think-orm/src/DbManager.php ( 8.52 KB )
  77. /yingpanguazai/ssd/ssd1/www/wwww.yeyulingfeng.com/vendor/topthink/framework/src/think/Log.php ( 6.28 KB )
  78. /yingpanguazai/ssd/ssd1/www/wwww.yeyulingfeng.com/vendor/topthink/framework/src/think/Manager.php ( 3.92 KB )
  79. /yingpanguazai/ssd/ssd1/www/wwww.yeyulingfeng.com/vendor/psr/log/src/LoggerTrait.php ( 2.69 KB )
  80. /yingpanguazai/ssd/ssd1/www/wwww.yeyulingfeng.com/vendor/psr/log/src/LoggerInterface.php ( 2.71 KB )
  81. /yingpanguazai/ssd/ssd1/www/wwww.yeyulingfeng.com/vendor/topthink/framework/src/think/Cache.php ( 4.92 KB )
  82. /yingpanguazai/ssd/ssd1/www/wwww.yeyulingfeng.com/vendor/psr/simple-cache/src/CacheInterface.php ( 4.71 KB )
  83. /yingpanguazai/ssd/ssd1/www/wwww.yeyulingfeng.com/vendor/topthink/think-helper/src/helper/Arr.php ( 16.63 KB )
  84. /yingpanguazai/ssd/ssd1/www/wwww.yeyulingfeng.com/vendor/topthink/framework/src/think/cache/driver/File.php ( 7.84 KB )
  85. /yingpanguazai/ssd/ssd1/www/wwww.yeyulingfeng.com/vendor/topthink/framework/src/think/cache/Driver.php ( 9.03 KB )
  86. /yingpanguazai/ssd/ssd1/www/wwww.yeyulingfeng.com/vendor/topthink/framework/src/think/contract/CacheHandlerInterface.php ( 1.99 KB )
  87. /yingpanguazai/ssd/ssd1/www/wwww.yeyulingfeng.com/app/Request.php ( 0.09 KB )
  88. /yingpanguazai/ssd/ssd1/www/wwww.yeyulingfeng.com/vendor/topthink/framework/src/think/Request.php ( 55.78 KB )
  89. /yingpanguazai/ssd/ssd1/www/wwww.yeyulingfeng.com/app/middleware.php ( 0.25 KB )
  90. /yingpanguazai/ssd/ssd1/www/wwww.yeyulingfeng.com/vendor/topthink/framework/src/think/Pipeline.php ( 2.61 KB )
  91. /yingpanguazai/ssd/ssd1/www/wwww.yeyulingfeng.com/vendor/topthink/think-trace/src/TraceDebug.php ( 3.40 KB )
  92. /yingpanguazai/ssd/ssd1/www/wwww.yeyulingfeng.com/vendor/topthink/framework/src/think/middleware/SessionInit.php ( 1.94 KB )
  93. /yingpanguazai/ssd/ssd1/www/wwww.yeyulingfeng.com/vendor/topthink/framework/src/think/Session.php ( 1.80 KB )
  94. /yingpanguazai/ssd/ssd1/www/wwww.yeyulingfeng.com/vendor/topthink/framework/src/think/session/driver/File.php ( 6.27 KB )
  95. /yingpanguazai/ssd/ssd1/www/wwww.yeyulingfeng.com/vendor/topthink/framework/src/think/contract/SessionHandlerInterface.php ( 0.87 KB )
  96. /yingpanguazai/ssd/ssd1/www/wwww.yeyulingfeng.com/vendor/topthink/framework/src/think/session/Store.php ( 7.12 KB )
  97. /yingpanguazai/ssd/ssd1/www/wwww.yeyulingfeng.com/vendor/topthink/framework/src/think/Route.php ( 23.73 KB )
  98. /yingpanguazai/ssd/ssd1/www/wwww.yeyulingfeng.com/vendor/topthink/framework/src/think/route/RuleName.php ( 5.75 KB )
  99. /yingpanguazai/ssd/ssd1/www/wwww.yeyulingfeng.com/vendor/topthink/framework/src/think/route/Domain.php ( 2.53 KB )
  100. /yingpanguazai/ssd/ssd1/www/wwww.yeyulingfeng.com/vendor/topthink/framework/src/think/route/RuleGroup.php ( 22.43 KB )
  101. /yingpanguazai/ssd/ssd1/www/wwww.yeyulingfeng.com/vendor/topthink/framework/src/think/route/Rule.php ( 26.95 KB )
  102. /yingpanguazai/ssd/ssd1/www/wwww.yeyulingfeng.com/vendor/topthink/framework/src/think/route/RuleItem.php ( 9.78 KB )
  103. /yingpanguazai/ssd/ssd1/www/wwww.yeyulingfeng.com/route/app.php ( 3.94 KB )
  104. /yingpanguazai/ssd/ssd1/www/wwww.yeyulingfeng.com/vendor/topthink/framework/src/think/facade/Route.php ( 4.70 KB )
  105. /yingpanguazai/ssd/ssd1/www/wwww.yeyulingfeng.com/vendor/topthink/framework/src/think/route/dispatch/Controller.php ( 4.74 KB )
  106. /yingpanguazai/ssd/ssd1/www/wwww.yeyulingfeng.com/vendor/topthink/framework/src/think/route/Dispatch.php ( 10.44 KB )
  107. /yingpanguazai/ssd/ssd1/www/wwww.yeyulingfeng.com/app/controller/Index.php ( 9.87 KB )
  108. /yingpanguazai/ssd/ssd1/www/wwww.yeyulingfeng.com/app/BaseController.php ( 2.05 KB )
  109. /yingpanguazai/ssd/ssd1/www/wwww.yeyulingfeng.com/vendor/topthink/think-orm/src/facade/Db.php ( 0.93 KB )
  110. /yingpanguazai/ssd/ssd1/www/wwww.yeyulingfeng.com/vendor/topthink/think-orm/src/db/connector/Mysql.php ( 5.44 KB )
  111. /yingpanguazai/ssd/ssd1/www/wwww.yeyulingfeng.com/vendor/topthink/think-orm/src/db/PDOConnection.php ( 52.47 KB )
  112. /yingpanguazai/ssd/ssd1/www/wwww.yeyulingfeng.com/vendor/topthink/think-orm/src/db/Connection.php ( 8.39 KB )
  113. /yingpanguazai/ssd/ssd1/www/wwww.yeyulingfeng.com/vendor/topthink/think-orm/src/db/ConnectionInterface.php ( 4.57 KB )
  114. /yingpanguazai/ssd/ssd1/www/wwww.yeyulingfeng.com/vendor/topthink/think-orm/src/db/builder/Mysql.php ( 16.58 KB )
  115. /yingpanguazai/ssd/ssd1/www/wwww.yeyulingfeng.com/vendor/topthink/think-orm/src/db/Builder.php ( 24.06 KB )
  116. /yingpanguazai/ssd/ssd1/www/wwww.yeyulingfeng.com/vendor/topthink/think-orm/src/db/BaseBuilder.php ( 27.50 KB )
  117. /yingpanguazai/ssd/ssd1/www/wwww.yeyulingfeng.com/vendor/topthink/think-orm/src/db/Query.php ( 15.71 KB )
  118. /yingpanguazai/ssd/ssd1/www/wwww.yeyulingfeng.com/vendor/topthink/think-orm/src/db/BaseQuery.php ( 45.13 KB )
  119. /yingpanguazai/ssd/ssd1/www/wwww.yeyulingfeng.com/vendor/topthink/think-orm/src/db/concern/TimeFieldQuery.php ( 7.43 KB )
  120. /yingpanguazai/ssd/ssd1/www/wwww.yeyulingfeng.com/vendor/topthink/think-orm/src/db/concern/AggregateQuery.php ( 3.26 KB )
  121. /yingpanguazai/ssd/ssd1/www/wwww.yeyulingfeng.com/vendor/topthink/think-orm/src/db/concern/ModelRelationQuery.php ( 20.07 KB )
  122. /yingpanguazai/ssd/ssd1/www/wwww.yeyulingfeng.com/vendor/topthink/think-orm/src/db/concern/ParamsBind.php ( 3.66 KB )
  123. /yingpanguazai/ssd/ssd1/www/wwww.yeyulingfeng.com/vendor/topthink/think-orm/src/db/concern/ResultOperation.php ( 7.01 KB )
  124. /yingpanguazai/ssd/ssd1/www/wwww.yeyulingfeng.com/vendor/topthink/think-orm/src/db/concern/WhereQuery.php ( 19.37 KB )
  125. /yingpanguazai/ssd/ssd1/www/wwww.yeyulingfeng.com/vendor/topthink/think-orm/src/db/concern/JoinAndViewQuery.php ( 7.11 KB )
  126. /yingpanguazai/ssd/ssd1/www/wwww.yeyulingfeng.com/vendor/topthink/think-orm/src/db/concern/TableFieldInfo.php ( 2.63 KB )
  127. /yingpanguazai/ssd/ssd1/www/wwww.yeyulingfeng.com/vendor/topthink/think-orm/src/db/concern/Transaction.php ( 2.77 KB )
  128. /yingpanguazai/ssd/ssd1/www/wwww.yeyulingfeng.com/vendor/topthink/framework/src/think/log/driver/File.php ( 5.96 KB )
  129. /yingpanguazai/ssd/ssd1/www/wwww.yeyulingfeng.com/vendor/topthink/framework/src/think/contract/LogHandlerInterface.php ( 0.86 KB )
  130. /yingpanguazai/ssd/ssd1/www/wwww.yeyulingfeng.com/vendor/topthink/framework/src/think/log/Channel.php ( 3.89 KB )
  131. /yingpanguazai/ssd/ssd1/www/wwww.yeyulingfeng.com/vendor/topthink/framework/src/think/event/LogRecord.php ( 1.02 KB )
  132. /yingpanguazai/ssd/ssd1/www/wwww.yeyulingfeng.com/vendor/topthink/think-helper/src/Collection.php ( 16.47 KB )
  133. /yingpanguazai/ssd/ssd1/www/wwww.yeyulingfeng.com/vendor/topthink/framework/src/think/facade/View.php ( 1.70 KB )
  134. /yingpanguazai/ssd/ssd1/www/wwww.yeyulingfeng.com/vendor/topthink/framework/src/think/View.php ( 4.39 KB )
  135. /yingpanguazai/ssd/ssd1/www/wwww.yeyulingfeng.com/app/controller/Es.php ( 3.30 KB )
  136. /yingpanguazai/ssd/ssd1/www/wwww.yeyulingfeng.com/vendor/topthink/framework/src/think/Response.php ( 8.81 KB )
  137. /yingpanguazai/ssd/ssd1/www/wwww.yeyulingfeng.com/vendor/topthink/framework/src/think/response/View.php ( 3.29 KB )
  138. /yingpanguazai/ssd/ssd1/www/wwww.yeyulingfeng.com/vendor/topthink/framework/src/think/Cookie.php ( 6.06 KB )
  139. /yingpanguazai/ssd/ssd1/www/wwww.yeyulingfeng.com/vendor/topthink/think-view/src/Think.php ( 8.38 KB )
  140. /yingpanguazai/ssd/ssd1/www/wwww.yeyulingfeng.com/vendor/topthink/framework/src/think/contract/TemplateHandlerInterface.php ( 1.60 KB )
  141. /yingpanguazai/ssd/ssd1/www/wwww.yeyulingfeng.com/vendor/topthink/think-template/src/Template.php ( 46.61 KB )
  142. /yingpanguazai/ssd/ssd1/www/wwww.yeyulingfeng.com/vendor/topthink/think-template/src/template/driver/File.php ( 2.41 KB )
  143. /yingpanguazai/ssd/ssd1/www/wwww.yeyulingfeng.com/vendor/topthink/think-template/src/template/contract/DriverInterface.php ( 0.86 KB )
  144. /yingpanguazai/ssd/ssd1/www/wwww.yeyulingfeng.com/runtime/temp/c935550e3e8a3a4c27dd94e439343fdf.php ( 31.50 KB )
  145. /yingpanguazai/ssd/ssd1/www/wwww.yeyulingfeng.com/vendor/topthink/think-trace/src/Html.php ( 4.42 KB )
  1. CONNECT:[ UseTime:0.000580s ] mysql:host=127.0.0.1;port=3306;dbname=wenku;charset=utf8mb4
  2. SHOW FULL COLUMNS FROM `fenlei` [ RunTime:0.000831s ]
  3. SELECT * FROM `fenlei` WHERE `fid` = 0 [ RunTime:0.000332s ]
  4. SELECT * FROM `fenlei` WHERE `fid` = 63 [ RunTime:0.000290s ]
  5. SHOW FULL COLUMNS FROM `set` [ RunTime:0.000465s ]
  6. SELECT * FROM `set` [ RunTime:0.000207s ]
  7. SHOW FULL COLUMNS FROM `article` [ RunTime:0.000618s ]
  8. SELECT * FROM `article` WHERE `id` = 708154 LIMIT 1 [ RunTime:0.000517s ]
  9. UPDATE `article` SET `lasttime` = 1780538306 WHERE `id` = 708154 [ RunTime:0.007403s ]
  10. SELECT * FROM `fenlei` WHERE `id` = 64 LIMIT 1 [ RunTime:0.000270s ]
  11. SELECT * FROM `article` WHERE `id` < 708154 ORDER BY `id` DESC LIMIT 1 [ RunTime:0.000436s ]
  12. SELECT * FROM `article` WHERE `id` > 708154 ORDER BY `id` ASC LIMIT 1 [ RunTime:0.000502s ]
  13. SELECT * FROM `article` WHERE `id` < 708154 ORDER BY `id` DESC LIMIT 10 [ RunTime:0.000764s ]
  14. SELECT * FROM `article` WHERE `id` < 708154 ORDER BY `id` DESC LIMIT 10,10 [ RunTime:0.000915s ]
  15. SELECT * FROM `article` WHERE `id` < 708154 ORDER BY `id` DESC LIMIT 20,10 [ RunTime:0.004229s ]
0.179385s