Backtrader 文档学习- Broker - Slippage

Backtrader 文档学习- Broker - Slippage

1.概述

回测无法保证真实的市场条件。无论市场模拟有多好,在真实市场条件下都可能发生滑点。这意味着:

  • 请求的价格可能无法与真实市场的价格匹配
    集成的回测broker支持滑点。以下参数可以传递给broker ,具体参数见前一章。

2.How it works

滑点是如何工作的

为了决定何时应用滑点,考虑订单执行类型:

  • Close 不适用滑点
    此订单与close价格匹配,此价格是当天的最后一个价格。滑点不可能发生,因为订单只能在会话的最后一个tick发生,是一个唯一的价格,没有容差。
  • Market 应用滑点
    请检查slip_open是否打开,设置为True。因为Market订单将与下一个K线的开盘价格匹配。
  • Limit 应用滑点,遵循以下逻辑:
    • 如果匹配价格将是开盘价格,则根据参数slip_open,应用滑点。如果应用,则价格永远不会比请求的limit价格更低(差)。
    • 如果匹配价格不是limit价格,则应用滑点,并将其限制在high/low上。在这种情况下,slip_mlimit参数决定是否会在超过上限时发生匹配 。
    • 如果匹配价格是limit价格,则不用滑点 。
  • Stop 一旦订单被触发,则适用与Market订单相同的逻辑
  • StopLimit 一旦订单被触发,则适用与Limit订单相同的逻辑

滑点试图在模拟和可用数据的限制内,提供最真实的可能回测交易方法 。

3.Configuring slippage

每次运行时,cerebro引擎都会为每个运行实例化一个broker,并使用默认参数。有两种方法可以更改设置操作:

使用方法配置滑点:

  • 配置百分比的滑点

BackBroker.set_slippage_perc(perc, slip_open=True, slip_limit=True,
slip_match=True, slip_out=False)

  • 配置固定点的滑点

BackBroker.set_slippage_fixed(fixed, slip_open=True, slip_limit=True,
slip_match=True, slip_out=False)

替换经纪人,如下所示:

import backtrader as btcerebro = bt.Cerebro()
#0.5%的百分比滑点设置
cerebro.broker = bt.brokers.BackBroker(slip_perc=0.005)  # 0.5%

4. 示例

包含一个使用订单执行类型市场和使用信号的多头/空头方法的示例。
应该允许理解逻辑, 无滑点运行和供以后参考的初始图:

(1)无滑点
python ./slippage.py
01 2005-03-22 SELL Size: -1 / Price: 3040.55
02 2005-04-11 BUY  Size: +1 / Price: 3088.47
03 2005-04-11 BUY  Size: +1 / Price: 3088.47
04 2005-04-19 SELL Size: -1 / Price: 2948.38
05 2005-04-19 SELL Size: -1 / Price: 2948.38
06 2005-05-19 BUY  Size: +1 / Price: 3034.88
07 2005-05-19 BUY  Size: +1 / Price: 3034.88
08 2005-08-26 SELL Size: -1 / Price: 3258.45
09 2005-08-26 SELL Size: -1 / Price: 3258.45
10 2005-09-13 BUY  Size: +1 / Price: 3353.61
11 2005-09-13 BUY  Size: +1 / Price: 3353.61
12 2005-10-19 SELL Size: -1 / Price: 3330.00
13 2005-10-19 SELL Size: -1 / Price: 3330.00
14 2005-11-14 BUY  Size: +1 / Price: 3405.94
15 2005-11-14 BUY  Size: +1 / Price: 3405.94
16 2006-01-26 SELL Size: -1 / Price: 3578.92
17 2006-01-26 SELL Size: -1 / Price: 3578.92
18 2006-02-03 BUY  Size: +1 / Price: 3677.05
19 2006-02-03 BUY  Size: +1 / Price: 3677.05
20 2006-04-20 SELL Size: -1 / Price: 3820.93
21 2006-04-20 SELL Size: -1 / Price: 3820.93
22 2006-05-02 BUY  Size: +1 / Price: 3839.24
23 2006-05-02 BUY  Size: +1 / Price: 3839.24
24 2006-05-16 SELL Size: -1 / Price: 3711.46
25 2006-05-16 SELL Size: -1 / Price: 3711.46
26 2006-07-04 BUY  Size: +1 / Price: 3664.59
27 2006-07-04 BUY  Size: +1 / Price: 3664.59
28 2006-07-27 SELL Size: -1 / Price: 3649.29
29 2006-07-27 SELL Size: -1 / Price: 3649.29
30 2006-07-28 BUY  Size: +1 / Price: 3671.71
31 2006-07-28 BUY  Size: +1 / Price: 3671.71
32 2006-12-04 SELL Size: -1 / Price: 3935.81
33 2006-12-04 SELL Size: -1 / Price: 3935.81
34 2006-12-19 BUY  Size: +1 / Price: 4121.01
35 2006-12-19 BUY  Size: +1 / Price: 4121.01

看第一个成交的原始数据:

2005-03-22,3040.55,3053.18,3021.66,3050.44,0,0

用的是开盘价成交 。

(2)百分比滑点
python ./slippage.py --slip_perc 0.015
01 2005-03-22 SELL Size: -1 / Price: 3040.55
02 2005-04-11 BUY  Size: +1 / Price: 3088.47
03 2005-04-11 BUY  Size: +1 / Price: 3088.47
04 2005-04-19 SELL Size: -1 / Price: 2948.38
05 2005-04-19 SELL Size: -1 / Price: 2948.38
06 2005-05-19 BUY  Size: +1 / Price: 3034.88
07 2005-05-19 BUY  Size: +1 / Price: 3034.88
08 2005-08-26 SELL Size: -1 / Price: 3258.45
09 2005-08-26 SELL Size: -1 / Price: 3258.45
10 2005-09-13 BUY  Size: +1 / Price: 3353.61
11 2005-09-13 BUY  Size: +1 / Price: 3353.61
12 2005-10-19 SELL Size: -1 / Price: 3330.00
13 2005-10-19 SELL Size: -1 / Price: 3330.00
14 2005-11-14 BUY  Size: +1 / Price: 3405.94
15 2005-11-14 BUY  Size: +1 / Price: 3405.94
16 2006-01-26 SELL Size: -1 / Price: 3578.92
17 2006-01-26 SELL Size: -1 / Price: 3578.92
18 2006-02-03 BUY  Size: +1 / Price: 3677.05
19 2006-02-03 BUY  Size: +1 / Price: 3677.05
20 2006-04-20 SELL Size: -1 / Price: 3820.93
21 2006-04-20 SELL Size: -1 / Price: 3820.93
22 2006-05-02 BUY  Size: +1 / Price: 3839.24
23 2006-05-02 BUY  Size: +1 / Price: 3839.24
24 2006-05-16 SELL Size: -1 / Price: 3711.46
25 2006-05-16 SELL Size: -1 / Price: 3711.46
26 2006-07-04 BUY  Size: +1 / Price: 3664.59
27 2006-07-04 BUY  Size: +1 / Price: 3664.59
28 2006-07-27 SELL Size: -1 / Price: 3649.29
29 2006-07-27 SELL Size: -1 / Price: 3649.29
30 2006-07-28 BUY  Size: +1 / Price: 3671.71
31 2006-07-28 BUY  Size: +1 / Price: 3671.71
32 2006-12-04 SELL Size: -1 / Price: 3935.81
33 2006-12-04 SELL Size: -1 / Price: 3935.81
34 2006-12-19 BUY  Size: +1 / Price: 4121.01
35 2006-12-19 BUY  Size: +1 / Price: 4121.01

对比没有变化。符合预期的行为。

  • 执行类型:Market
  • slip_open 未设置为True,Market订单与下一个bar的开盘价格匹配,不允许open价格用滑点移动。
(3)百分比滑点,slip_open
python ./slippage.py --slip_perc 0.015 --slip_open
01 2005-03-22 SELL Size: -1 / Price: 3021.66
02 2005-04-11 BUY  Size: +1 / Price: 3088.47
03 2005-04-11 BUY  Size: +1 / Price: 3088.47
04 2005-04-19 SELL Size: -1 / Price: 2948.38
05 2005-04-19 SELL Size: -1 / Price: 2948.38
06 2005-05-19 BUY  Size: +1 / Price: 3055.14
07 2005-05-19 BUY  Size: +1 / Price: 3055.14
08 2005-08-26 SELL Size: -1 / Price: 3224.10
09 2005-08-26 SELL Size: -1 / Price: 3224.10
10 2005-09-13 BUY  Size: +1 / Price: 3358.04
11 2005-09-13 BUY  Size: +1 / Price: 3358.04
12 2005-10-19 SELL Size: -1 / Price: 3280.05
13 2005-10-19 SELL Size: -1 / Price: 3280.05
14 2005-11-14 BUY  Size: +1 / Price: 3426.51
15 2005-11-14 BUY  Size: +1 / Price: 3426.51
16 2006-01-26 SELL Size: -1 / Price: 3577.98
17 2006-01-26 SELL Size: -1 / Price: 3577.98
18 2006-02-03 BUY  Size: +1 / Price: 3696.00
19 2006-02-03 BUY  Size: +1 / Price: 3696.00
20 2006-04-20 SELL Size: -1 / Price: 3820.93
21 2006-04-20 SELL Size: -1 / Price: 3820.93
22 2006-05-02 BUY  Size: +1 / Price: 3864.19
23 2006-05-02 BUY  Size: +1 / Price: 3864.19
24 2006-05-16 SELL Size: -1 / Price: 3692.35
25 2006-05-16 SELL Size: -1 / Price: 3692.35
26 2006-07-04 BUY  Size: +1 / Price: 3670.75
27 2006-07-04 BUY  Size: +1 / Price: 3670.75
28 2006-07-27 SELL Size: -1 / Price: 3649.29
29 2006-07-27 SELL Size: -1 / Price: 3649.29
30 2006-07-28 BUY  Size: +1 / Price: 3711.41
31 2006-07-28 BUY  Size: +1 / Price: 3711.41
32 2006-12-04 SELL Size: -1 / Price: 3927.40
33 2006-12-04 SELL Size: -1 / Price: 3927.40
34 2006-12-19 BUY  Size: +1 / Price: 4121.01
35 2006-12-19 BUY  Size: +1 / Price: 4121.01

滑点设置起作用了,非开盘价成交。

  • SELL滑点成交:
    3040.55 *(1 - 0.0015)= 2994.94 ,成交范围在2994.94之内。看第一个成交的原始数据:

2005-03-22,3040.55,3053.18,3021.66,3050.44,0,0

SELL成交价格使用的Low 最低价3021.66 。

  • BUY滑点成交:
    可以立即看到价格发生了变化。并且像交易35号一样,分配的价格最差或相等。也用的是当天开盘价/最高价成交。

2006-12-19,4121.01,4121.01,4085.18,4100.48,0,0

BUY成交价格使用了当天的开盘价,也是最高价成交。

再看一个BUY 的例子,交易30号,原始数据:

2006-07-28,3671.71,3711.41,3659.67,3710.60,0,0

BUY是当天的最高价成交。

通过示例理解滑点 ?
滑点的意义,就是不可能买在预期的低价,卖单,不可能卖在预期的高点:

  • 买单,可能高于预期价格
  • 买单,可能低于预期价格
(4)百分比滑点,slip_out

当然BT允许在希望的情况下匹配“高”-“低”范围之外的价格,使用“slip_out”。激活它的运行 :

python  ./slippage.py --slip_perc 0.015 --slip_open --slip_out
01 2005-03-22 SELL Size: -1 / Price: 2994.94
02 2005-04-11 BUY  Size: +1 / Price: 3134.80
03 2005-04-11 BUY  Size: +1 / Price: 3134.80
04 2005-04-19 SELL Size: -1 / Price: 2904.15
05 2005-04-19 SELL Size: -1 / Price: 2904.15
06 2005-05-19 BUY  Size: +1 / Price: 3080.40
07 2005-05-19 BUY  Size: +1 / Price: 3080.40
08 2005-08-26 SELL Size: -1 / Price: 3209.57
09 2005-08-26 SELL Size: -1 / Price: 3209.57
10 2005-09-13 BUY  Size: +1 / Price: 3403.91
11 2005-09-13 BUY  Size: +1 / Price: 3403.91
12 2005-10-19 SELL Size: -1 / Price: 3280.05
13 2005-10-19 SELL Size: -1 / Price: 3280.05
14 2005-11-14 BUY  Size: +1 / Price: 3457.03
15 2005-11-14 BUY  Size: +1 / Price: 3457.03
16 2006-01-26 SELL Size: -1 / Price: 3525.24
17 2006-01-26 SELL Size: -1 / Price: 3525.24
18 2006-02-03 BUY  Size: +1 / Price: 3732.21
19 2006-02-03 BUY  Size: +1 / Price: 3732.21
20 2006-04-20 SELL Size: -1 / Price: 3763.62
21 2006-04-20 SELL Size: -1 / Price: 3763.62
22 2006-05-02 BUY  Size: +1 / Price: 3896.83
23 2006-05-02 BUY  Size: +1 / Price: 3896.83
24 2006-05-16 SELL Size: -1 / Price: 3655.79
25 2006-05-16 SELL Size: -1 / Price: 3655.79
26 2006-07-04 BUY  Size: +1 / Price: 3719.56
27 2006-07-04 BUY  Size: +1 / Price: 3719.56
28 2006-07-27 SELL Size: -1 / Price: 3594.55
29 2006-07-27 SELL Size: -1 / Price: 3594.55
30 2006-07-28 BUY  Size: +1 / Price: 3726.79
31 2006-07-28 BUY  Size: +1 / Price: 3726.79
32 2006-12-04 SELL Size: -1 / Price: 3876.77
33 2006-12-04 SELL Size: -1 / Price: 3876.77
34 2006-12-19 BUY  Size: +1 / Price: 4182.83
35 2006-12-19 BUY  Size: +1 / Price: 4182.83

第一个SELL单:
3040.55 *(1 - 0.0015)= 2994.94
2994.94 没有在当天的价格中出现,以不在最高和最低价格中成交的滑点价格。

2005-03-22,3040.55,3053.18,3021.66,3050.44,0,0

最后一个BUY单:
价格显然超出了范围。只需查看操作35,它已在“4182.83”处匹配。快速检查本文档中的图表,可以看到该资产从未接近过该价格。

2006-12-19,4121.01,4121.01,4085.18,4100.48,0,0

(5)百分比滑点,no-slip_match

“slip_match”默认为“True”,这意味着BT提供了匹配,无论是带有限制的价格还是不带限制的价格 。

python ./slippage.py --slip_perc 0.015 --slip_open --no-slip_match
01 2005-04-15 SELL Size: -1 / Price: 3028.10
02 2005-06-01 BUY  Size: +1 / Price: 3124.03
03 2005-06-01 BUY  Size: +1 / Price: 3124.03
04 2005-10-06 SELL Size: -1 / Price: 3365.57
05 2005-10-06 SELL Size: -1 / Price: 3365.57
06 2005-12-01 BUY  Size: +1 / Price: 3499.95
07 2005-12-01 BUY  Size: +1 / Price: 3499.95
08 2006-02-28 SELL Size: -1 / Price: 3782.71
09 2006-02-28 SELL Size: -1 / Price: 3782.71
10 2006-05-23 BUY  Size: +1 / Price: 3594.68
11 2006-05-23 BUY  Size: +1 / Price: 3594.68
12 2006-11-27 SELL Size: -1 / Price: 3984.37
13 2006-11-27 SELL Size: -1 / Price: 3984.37

2005-04-15,3074.21,3074.21,3013.79,3013.89,0,0

3074.21 * (1 - 0.015 )= 3028.10
这个价格符合在最高价3074.21 和 最低价 3013.79 中间的价格,并且符合滑点。如果是市场上实际交易,这个价格一定是存在的。

结果让人震惊!操作成交的数量从35下降到13。
理由:
禁用“slip_match”会禁止匹配操作,如果滑点将匹配价格推到bar的“高”以上或“低”以下。似乎在请求的滑点“1.5%”左右,有22个操作未能执行。

以上示例应该展示了不同的滑点选项如何一起工作。

5. 代码

#!/usr/bin/env python
# -*- coding: utf-8; py-indent-offset:4 -*-
###############################################################################
#
# Copyright (C) 2015-2023 Daniel Rodriguez
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program.  If not, see <http://www.gnu.org/licenses/>.
#
###############################################################################
from __future__ import (absolute_import, division, print_function,unicode_literals)import argparse
import collections
import datetime
import itertoolsimport backtrader as btclass SMACrossOver(bt.Indicator):lines = ('signal',)params = (('p1', 10), ('p2', 30),)def __init__(self):sma1 = bt.indicators.SMA(period=self.p.p1)sma2 = bt.indicators.SMA(period=self.p.p2)self.lines.signal = bt.indicators.CrossOver(sma1, sma2)class SlipSt(bt.SignalStrategy):opcounter = itertools.count(1)def notify_order(self, order):if order.status == bt.Order.Completed:t = ''t += '{:02d}'.format(next(self.opcounter))t += ' {}'.format(order.data.datetime.date())t += ' BUY ' * order.isbuy() or ' SELL't += ' Size: {:+d} / Price: {:.2f}'print(t.format(order.executed.size, order.executed.price))def runstrat(args=None):args = parse_args(args)cerebro = bt.Cerebro()cerebro.broker.set_cash(args.cash)dkwargs = dict()if args.fromdate is not None:fromdate = datetime.datetime.strptime(args.fromdate, '%Y-%m-%d')dkwargs['fromdate'] = fromdateif args.todate is not None:todate = datetime.datetime.strptime(args.todate, '%Y-%m-%d')dkwargs['todate'] = todate# if dataset is None, args.data has been givendata = bt.feeds.BacktraderCSVData(dataname=args.data, **dkwargs)cerebro.adddata(data)cerebro.signal_strategy(SlipSt)if not args.longonly:stype = bt.signal.SIGNAL_LONGSHORTelse:stype = bt.signal.SIGNAL_LONGcerebro.add_signal(stype, SMACrossOver, p1=args.period1, p2=args.period2)if args.slip_perc is not None:cerebro.broker.set_slippage_perc(args.slip_perc,slip_open=args.slip_open,slip_match=not args.no_slip_match,slip_out=args.slip_out)elif args.slip_fixed is not None:cerebro.broker.set_slippage_fixed(args.slip_fixed,slip_open=args.slip_open,slip_match=not args.no_slip_match,slip_out=args.slip_out)cerebro.run()if args.plot:pkwargs = dict(style='bar')if args.plot is not True:  # evals to True but is not Truenpkwargs = eval('dict(' + args.plot + ')')  # args were passedpkwargs.update(npkwargs)cerebro.plot(**pkwargs)def parse_args(pargs=None):parser = argparse.ArgumentParser(formatter_class=argparse.ArgumentDefaultsHelpFormatter,description='Sample for Slippage')parser.add_argument('--data', required=False,default='./datas/2005-2006-day-001.txt',help='Specific data to be read in')parser.add_argument('--fromdate', required=False, default=None,help='Starting date in YYYY-MM-DD format')parser.add_argument('--todate', required=False, default=None,help='Ending date in YYYY-MM-DD format')parser.add_argument('--cash', required=False, action='store',type=float, default=50000,help=('Cash to start with'))parser.add_argument('--period1', required=False, action='store',type=int, default=10,help=('Fast moving average period'))parser.add_argument('--period2', required=False, action='store',type=int, default=30,help=('Slow moving average period'))parser.add_argument('--longonly', required=False, action='store_true',help=('Long only strategy'))pgroup = parser.add_mutually_exclusive_group(required=False)pgroup.add_argument('--slip_perc', required=False, default=None,type=float,help='Set the value for commission percentage')pgroup.add_argument('--slip_fixed', required=False, default=None,type=float,help='Set the value for commission percentage')parser.add_argument('--no-slip_match', required=False, action='store_true',help=('Match by capping slippage at bar ends'))parser.add_argument('--slip_out', required=False, action='store_true',help=('Disable capping and return non-real prices'))parser.add_argument('--slip_open', required=False, action='store_true',help=('Slip even if match price is next open'))# Plot optionsparser.add_argument('--plot', '-p', nargs='?', required=False,metavar='kwargs', const=True,help=('Plot the read data applying any kwargs passed\n''\n''For example:\n''\n''  --plot style="candle" (to plot candles)\n'))if pargs is not None:return parser.parse_args(pargs)return parser.parse_args()if __name__ == '__main__':runstrat()

本文来自互联网用户投稿,该文观点仅代表作者本人,不代表本站立场。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如若转载,请注明出处:http://www.mzph.cn/news/657970.shtml

如若内容造成侵权/违法违规/事实不符,请联系多彩编程网进行投诉反馈email:809451989@qq.com,一经查实,立即删除!

相关文章

Android 在WebView中加载H5传递图片

最近h5开发一个编译器&#xff0c;要在手机上显示&#xff0c;需要获取手机上的图片&#xff0c;使用webview不能直接到文件管理拿取&#xff0c;还需要对webview做处理&#xff0c;做个记录&#xff0c;方便以后使用&#xff1b; public ValueCallback<Uri[]> mUploadMe…

【安装记录】在pve中创建debian12虚拟机

1、官网下载debian12:https://www.debian.org/ 2、安装虚拟机 &#xff08;1&#xff09;上传 iso 文件到pve服务器&#xff1a; 等待上传中。。。 上传完毕结果如下&#xff1a; &#xff08;2&#xff09;创建虚拟机 类别我也不清楚有什么区别&#xff1f;我看推荐使用host…

[数据结构与算法]哈希算法

目录 哈希算法 常见哈希函数&#xff1a; MD5 (Message Digest Algorithm 5): SHA-1 (Secure Hash Algorithm 1): SHA-256 (Secure Hash Algorithm 256-bit): 代码演示: 哈希算法 哈希算法是一种将任意长度的输入数据映射为固定长度的输出数据的算法。哈希函数的主要目标是…

golang实现pdf中自动换行的表格

需要用到的库&#xff1a;jung-kurt/gofpdf 由于CellFormat方法不支持\n换行&#xff0c;会被变成乱码&#xff0c;MultiCell方法会自动将坐标定位到下一行。所以需要自己实现坐标的计算变换。通过Rect方法画出单元格&#xff0c;MultiCell方法在格内自动换行写字&#xff0c;在…

瑞_数据结构与算法_红黑树

文章目录 1 什么是红黑树1.1 红黑树的背景1.2 红黑树的特性 ★★★ 2 红黑树的Java实现2.1 红黑树颜色枚举类Color2.2 红黑树节点类Node2.2.1 实现判断是否是左孩子方法isLeftChild()2.2.2 实现查找叔叔节点方法uncle()2.2.3 实现查找兄弟节点方法sibling() 2.3 红黑树类RedBla…

GoLang中应该避免的10个错误

Go是一种静态类型的、并发的、垃圾收集的编程语言&#xff0c;由谷歌开发。近年来&#xff0c;由于它的简单性、性能和对并发的强大支持&#xff0c;它已经获得了普及。尽管它很简单&#xff0c;但开发人员在编写Go代码时仍有一些常见的错误。下面是Go语言中需要避免的十大坏错…

Python如何递归删除空文件夹

嗨喽&#xff0c;大家好呀~这里是爱看美女的茜茜呐 1.Python如何递归删除空文件夹&#xff0c;这个问题很常见。 但大多数人的解决办法都是自己实现递归函数解决这个问题&#xff0c;其实根本不用那么麻烦。 Python中的os.walk提供了一种从内到外的遍历目录树的方法&#xff…

fullcalendar案例

fullcalendar案例 <script srchttps://cdn.jsdelivr.net/npm/fullcalendar6.1.10/index.global.min.js></script><script srchttps://code.jquery.com/jquery-3.6.0.min.js></script> <!-- 引入 jQuery CDN --><script>document.addEventL…

第5章 python深度学习——波斯美女

第5章 深度学习用于计算机视觉 本章包括以下内容&#xff1a; 理解卷积神经网络&#xff08;convnet&#xff09; 使用数据增强来降低过拟合 使用预训练的卷积神经网络进行特征提取 微调预训练的卷积神经网络 将卷积神经网络学到的内容及其如何做出分类决策可视化 本章将…

【前端-VUE】Vue3组件组成部分及组件通信(详解)

一、父子间通信 1.父传子&#xff1a; 2.子传父&#xff1a; 3.什么是prop Prop定义&#xff1a;组件上注册的一些自定义属性 Prop作用&#xff1a;向子组件传递数据 特点&#xff1a; 可以传递任意数量的prop可以传递任意类型的prop 3.1 props校验 思考&#xff1a;组件的prop…

母排设计时没有柜体3D数据?来试试SuperPanel的钣金功能!

CAD版SuperPanel软件能够助力用户快速、准确地设计和修改母排&#xff0c;同时快速输出加工图纸和数控加工代码。在壳体外购&#xff0c;没有柜体3D数据的情况下&#xff0c;如何轻松进行母排设计&#xff1f;一起来学习利驰数字母排的钣金功能吧&#xff01; SuperPanel的钣金…

【新课】安装部署系列Ⅲ—Oracle 19c Data Guard部署之两节点RAC部署实战

本课程由云贝教育-刘峰老师出品&#xff0c;感谢关注 课程介绍 Oracle Real Application Clusters (RAC) 是一种跨多个节点分布数据库的企业级解决方案。它使组织能够通过实现容错和负载平衡来提高可用性和可扩展性&#xff0c;同时提高性能。本课程基于当前主流版本Oracle 1…

python 写入csv文件 内容乱码

问题 python 写入csv文件 内容乱码 详细问题 笔者核心代码 import csv # 将数据写入 CSV 文件 csv_file_path "soil_data.csv" header ["经度", "纬度", "土壤类型", "pH值"]with open(csv_file_path, mode"w&q…

【PyTorch实战演练】Fast R-CNN中的RoI(Region of Interest)池化详解

文章目录 0. 前言1. ROI池化的提出背景2. RoI池化的结构与工作原理3. RoI池化的作用及意义4. RoI使用示例 0. 前言 按照国际惯例&#xff0c;首先声明&#xff1a;本文只是我自己学习的理解&#xff0c;虽然参考了他人的宝贵见解及成果&#xff0c;但是内容可能存在不准确的地方…

优化器刺客之limit 1--Order by col limit n 代价预估优化探索

一、现象 order by 排序加了limit后更慢了&#xff1f; test# explain analyze select userid from dba_users where username like %aaaaaaaaaaaaaaaaaa% order by userid ;QUERY PLAN --------------…

ElementUI Form:Radio 单选框

ElementUI安装与使用指南 Radio 单选框 点击下载learnelementuispringboot项目源码 效果图 el-radio.vue 页面效果图 项目里el-radio.vue代码 <script> export default {name: el_radio,data() {return {radio: 1,radio2: 2,radio3: 3,radio4: 上海,radio5: 上海,ra…

12个适合后端程序员的前端框架

前言 今天我们分享12个适合后端程序员的前端框架&#xff0c;本文中的所有前端框架都已经收录到适合后端程序员的前端框架GitHub Issues知识库中&#xff0c;假如大家有更好前端框架推荐欢迎到以下GitHub项目地址留言或者在文末留言&#xff08;注意&#xff1a;排名不分先后&a…

c#鼠标绘制

有用的没用的&#xff0c;用的上的用不上的&#xff0c;能写的不能写的&#xff0c;反正想起来就写了&#xff0c;比如这篇&#xff0c;好像一般也没什么用&#xff0c;emmm&#xff0c;或许&#xff0c;做录制软件的时候可以用一下。 顾名思义&#xff0c;本篇主要就是来实现将…

dvwa,xss反射型lowmedium

xss&#xff0c;反射型&#xff0c;low&&medium low发现xss本地搭建实操 medium作为初学者的我第一次接触比较浅的绕过思路high low 发现xss 本关无过滤 <script>alert(/xss/)</script> //或 <script>confirm(/xss/)</script> //或 <scr…

幻兽帕鲁服务器游戏怎么升级版本?

幻兽帕鲁服务器游戏怎么升级版本&#xff1f;自建幻兽帕鲁服务器进入Palworld游戏提示“您正尝试加入的比赛正在运行不兼容的游戏版本&#xff0c;请尝试升级游戏版本”什么原因&#xff1f;这是由于你的客户端和幻兽帕鲁服务器版本不匹配&#xff0c;如何解决&#xff1f;更新…