量化策略跑赢大盘926%!
45s超高的超额收益对比(201% vs 926%)极具冲击力,能迅速抓住观众注意力。
▶ Play Clip"The title promises a strategy that beats the market, and the video delivers with concrete backtest results, though it could be more concise."
This video presents the RSRS (Resistance-Support Relative Strength) indicator, a quantitative trading strategy that uses the slope of a linear regression between daily high and low prices to gauge the relative strength of support and resistance levels. The presenter, a quantitative strategy researcher, explains the concept, the calculation method, and demonstrates its effectiveness through backtests on three major indices: the S&P 500, the Hang Seng Index, and the CSI 300.
The CSI 300 index rose 201.95% over the past 20 years, while the RSRS-optimized strategy achieved a cumulative return of 926.77%, significantly outperforming the index.
Support is a price level where buying increases and selling decreases, causing the price to stop falling or rebound. Resistance is a price level where selling increases and buying decreases, causing the price to stop rising or pull back.
Daily high and low prices serve as effective proxy variables for resistance and support, as they reflect the collective trading behavior of all market participants on a given day.
The relative strength of support and resistance is measured by the slope of the line connecting high and low prices, calculated using linear regression over the latest N data points to filter out noise.
The RSRS indicator is calculated by: 1) taking the previous day's high and low price series, 2) performing OLS linear regression, and 3) using the beta coefficient as the indicator value.
The strategy sets two thresholds (SE and SR) based on the mean plus/minus one standard deviation of the RSRS values. Buy when RSRS exceeds SE, sell when it falls below SR.
The strategy is tested on the S&P 500, Hang Seng Index, and CSI 300 using historical K-line data fetched via the iShare API, a free financial data interface.
With N=15 (optimal parameter), the RSRS strategy on the CSI 300 achieved 926.77% cumulative return over 20 years, versus 201.95% for the index itself.
The Hang Seng Index fell 22% over 10 years, but the RSRS strategy gained 23%. The S&P 500 rose 279.7%, while the RSRS strategy gained 359.56%.
The RSRS strategy can help control drawdowns and generate excess returns when investing in index ETFs. For individual stocks, it can be used for position management, provided the portfolio has high correlation with the benchmark index.
The RSRS indicator, based on the slope of high-low price regression, effectively captures the relative strength of support and resistance, delivering significant excess returns across major indices. It is a practical tool for both index ETF investors and individual stock traders to manage risk and enhance returns.
RSRS Strategy Outperforms CSI 300
Demonstrates the strategy's potential with a 926.77% return versus 201.95% for the index.
Slope as Relative Strength Measure
Introduces a novel way to quantify support/resistance strength using regression slope.
02:12RSRS Calculation Method
Provides a clear, step-by-step formula for implementing the indicator.
03:17Consistent Excess Returns Across Indices
Shows the strategy's robustness across different markets (US, HK, China).
06:34Practical Use for Risk Management
Highlights real-world applications for ETF investors and stock traders.
06:46[00:00] 沪深300指数在最近20年的时间 累计上涨了201.95% 而通过2S2S这次指标优化之后的策略 累计收益率达到了926.77%
[00:13] 显著好营到沪深300指数 哈喽大家好 我是量化策略研究员安丁 欢迎来到这个频道 我们经常会听到市场上的一些专家预测点位 说大盘的主力位在哪
[00:26] 说某只股票的支撑位在哪 各有各的理由 众说纷纭 其实在技术分析中 主力位与支撑位经常被分析者提及 并给出自己认为的主力支撑点位
[00:38] 主力位与支撑位的概念很容易理解 顾名思义 支撑位是指股票价格下跌到一定水平后 往往会出现买盘增加 卖盘减少的情况 导致股价停止下跌或反弹的现象
[00:51] 支撑位可以被视为市场中的一个价格底部 投资者通常认为 在这个价格水平上买入股票 是一个相对安全的操作 主力位则是指股票价格上涨到一定水平后
[01:04] 往往会出现卖盘增加 买盘减少的情况 导致股价停止上涨或回落的现象 主力位可以被视为市场中的一个价格顶部 投资者通常认为
[01:16] 在这个价格水平上 卖出股票是一个相对较好的时机 在技术分析学派中 已经有了许多对于支撑位与主力位的定义 然而 我们希望能找到一个
[01:28] 能较好体现出其变量性的代理变量 根据我们的观察 每日最高价与最低价 能很好地满足这个需求 从最高价与最低价的行程及时出发
[01:40] 每日的最高价与最低价 就是一种主力位与支撑位 它是当日全体市场参与者的交易行为 所认可的主力与支撑 由于我们并非用支撑位与主力位做突破或反转交易的预值而是更关注市场参与者们对于阻力位与支撑位的定位一致性
[02:00] 当日最高价与最低价 能迅速反映近期市场 对于阻力位与支撑位态度的性质 是我们使用最高价与最低价的最重要原因 我们用相对位置变化程度
[02:12] 即类似叫的嗨出一叫的啰的值 来描述支撑位与阻力位的相对强度 即最低价每变动一个价位 最高价变动的幅度 实际上
[02:24] 钓的害处以钓斗肉质 连接高低价格平面上的两点的斜率 由于市场量价本身噪音的存在 通过两点得到的斜率 也包含了太大的噪音 我们考虑通过最新N个的数据点
[02:38] 来得到信号比较高的最高最低价相对变化程度 这样而言的想法即是使用线性回归 如果我们建立如下般 最高价与最低价之间的线性模型 还等于over加beta成node加x
[02:51] 那么beta值就是我们所需要的弦率 其中间的曲值不能太小 不然不能过滤掉足够多的噪音 但也不能太大 因为我们希望得到的 是体现目前市场的支撑阻力相对强度
[03:04] 若曲值太大 则滞后性太高 当弦域值较大时 支撑强度强于阻力强度 当弦域值很小时 阻力强度强于支撑强度 在确定阻力与支撑的代理变量
[03:17] 以及相对强度的定义之后 我们一直建立RS-2IS指标 我们直接利用协力的本身作为指标值 当日协力指标的计算方式 1.取前一日的最高下序列与最低下序列
[03:31] 2.将两列数据按照线性模型进行OLIS线性回归 3.将你恒沪的β值作为当日RS-2IS协力指标值 在初步定义RS-2IS指标后
[03:43] 我们更关注其在市场则之上的应用效果那我们现在构建如下的量化策略来进行测试首先设置两个预值SE和SR当二S2S指标值超过预值SE时买入
[03:56] 当二S2S指标值小于另一个预值S20卖出 从统计数据出发 预值的选择采用均值加减一个标准差 即SE等于二S2S的均值加上一个标准差
[04:09] S2等于二S2S的均值减去一个标准差 根据上述策略,我们想知道这个指标在不同市场的表现 因此,我们分别对标普500指数、香港恒生指数、沪森300指数进行测试
[04:23] 好,我们先来看一下代码 首先,我们通过RCE获取指数的历史K线数据 只要简单的五行代码,我们就可以获取到三个指数的历史数据 我们把其中一个数据标普500,打印出来
[04:38] 可以看到数据包含交易日期 开高收低以及成交量 成交额 在这里介绍一下 iShare是一个免费的 PyDong财经数据接口 包含美股
[04:50] 港股 A股的各种数据 具体的官网地址以及文档 在本视频的说明栏有详细说明 视频说明栏还有许多 关于量化投资的财经接口
[05:02] 行情软件等讯息 大家可以进行查看 也欢迎在评论区 打出你平时常用的行情软件 以及财经数据接口 接下来 我们根据刚才制定好的策略进行编程
[05:15] 我们先计算出每个交易日的涨跌幅 再根据按日的最高价和最低价序列 做回归求出闲率 这里是初始化策略的交易标记和持仓 然后再根据闲率和预值的大小关系
[05:29] 构建交易信号 最后这部分就是统计收益率和净值 并且画图显示 好 我们运行一下代码 可以看到最终的结果 沪生300指数在最近20年的时间累计上涨了201.95%而通过2S2S就是指标优化之后的策略累计作业率达到了926.77%
[05:52] 显著考赢到沪深300指数 这里的N取值为15 是根据策略确定的最优参数 同时对于不同的指数 N的取值也不同 白家系与S2是根据协力的平均值和标准差计算得到的
[06:06] 下面我们再来看看香港恒生指数和标普500指数的策略表现 恒生指数最近10年虽然下跌了22% 但通过2S2S格子指标优化之后的策略 累计收益率达到了23%
[06:21] 最后是标普500指数 最近10年累计上涨279.7% 通过2S2S格子指标优化之后的策略 累计收益率达到了359.56% 对于以上三个指数的历史回测
[06:34] 我们可以看到 RSRS指标折射策略 均取得了不同程度的超额收益 如果你投资的是指数ETF 那利用这个RSRS折射策略
[06:46] 能够帮你很好的控制回撤 也能获得显著的超额收益 如果是投资个股 那也可以利用RSRS指标来进行仓位管理 控制市场风险 但有一个前提就是
[06:59] 投资组合跟基准指数的相关性比较高 意思就是说 当大盘上涨的时候 你的股票大概率也跟着涨 当大盘下跌的时候 你的股票也跟着跌
[07:11] 这种情况下 利用2S2S指标进行仓位管理 也会取得不错的效果 好 今天的内容就分享到这 如果有任何疑问 或想深入了解 更多关于量化投资的内容
[07:23] 欢迎在评论区留言 我将结成为大家解答 谢谢大家的支持和关注 偶略的江口
⚡ Saved you 0h 07m reading this? Transcribe any YouTube video for free — no signup needed.