当前位置:网站首页>Stock Strategy 02 | Technology Timing + Industry Factors + Market Value Rotation
Stock Strategy 02 | Technology Timing + Industry Factors + Market Value Rotation
2022-08-01 14:31:00 【The squirrel quants】
量化策略开发,高质量社群,交易思路分享等相关内容
『正文』
ˇ
大家好,This period we will do a technical timing of stock trading strategy:
SuperTrend
什么是超级趋势指标SuperTrend Indicator?
超级趋势指标SuperTrend Indicator是一个在外汇交易中常用指标,它的设计者是Jason Robinson.它的主要用途是确定价格趋势,和进行趋势追踪.
超级趋势指标SuperTrend Indicator的计算公式:
在做多时:
超级趋势指标SuperTrend =(最高价+最低价)/2 – N*ATR(M)
在作图中,这个值只上移不下移,就是取近期的最高值.
在做空时:
超级趋势指标= (最高价+最低价)/2 + N*ATR(M)
在作图中,这个值只下移不上移,就是取近期的最低值.
在这个指标当中适用了均值(H+L)/2,和ATR真是波动幅度的概念.在设置它的参数时,要考虑两个值,N,M.一个用来计算ATR的倍数,一个用来计算ATR的周期数.例如,周期数可以是10日,倍数可以是3倍,这是这个指标的基本设置.对于不同的交易市场,和交易对象来说,这两个参数是可以优化的.它的计算方法与肯特纳通道Keltner Channels很相似.
超级趋势指标SuperTrend的主要用途:
1, 可以作为决定趋势的过滤器;在上升趋势时,做多;在下降趋势中,做空.
2, 可以作为趋势追踪止损.在做多有盈利时,当收盘价小于这个指标近期最高值时,卖出,这样可以锁定利润,又不会因为止盈而错过大趋势.当然,它的正确适用和它的参数设置有密切关系.
/ This source code is subject to the terms of the Mozilla Public License 2.0 at https://mozilla.org/MPL/2.0/
// LonesomeTheBlue
//@version=4
study("Pivot Point SuperTrend", overlay = true)
prd = input(defval = 2, title="Pivot Point Period", minval = 1, maxval = 50)
Factor=input(defval = 3, title = "ATR Factor", minval = 1, step = 0.1)
Pd=input(defval = 10, title = "ATR Period", minval=1)
showpivot = input(defval = false, title="Show Pivot Points")
showlabel = input(defval = true, title="Show Buy/Sell Labels")
showcl = input(defval = false, title="Show PP Center Line")
showsr = input(defval = false, title="Show Support/Resistance")
float ph = na
float pl = na
ph := pivothigh(prd, prd)
pl := pivotlow(prd, prd)
plotshape(ph and showpivot, text="H", style=shape.labeldown, color=na, textcolor=color.red, location=location.abovebar, transp=0, offset = -prd)
plotshape(pl and showpivot, text="L", style=shape.labeldown, color=na, textcolor=color.lime, location=location.belowbar, transp=0, offset = -prd)
float center = na
center := center[1]
float lastpp = ph ? ph : pl ? pl : na
if lastpp
if na(center)
center := lastpp
else
center := (center * 2 + lastpp) / 3
Up = center - (Factor * atr(Pd))
Dn = center + (Factor * atr(Pd))
float TUp = na
float TDown = na
Trend = 0
TUp := close[1] > TUp[1] ? max(Up, TUp[1]) : Up
TDown := close[1] < TDown[1] ? min(Dn, TDown[1]) : Dn
Trend := close > TDown[1] ? 1: close < TUp[1]? -1: nz(Trend[1], 1)
Trailingsl = Trend == 1 ? TUp : TDown
linecolor = Trend == 1 and nz(Trend[1]) == 1 ? color.lime : Trend == -1 and nz(Trend[1]) == -1 ? color.red : na
plot(Trailingsl, color = linecolor , linewidth = 2, title = "PP SuperTrend")
plot(showcl ? center : na, color = showcl ? center < hl2 ? color.blue : color.red : na, transp = 0)
bsignal = Trend == 1 and Trend[1] == -1
ssignal = Trend == -1 and Trend[1] == 1
plotshape(bsignal and showlabel ? Trailingsl : na, title="Buy", text="Buy", location = location.absolute, style = shape.labelup, size = size.tiny, color = color.lime, textcolor = color.black, transp = 0)
plotshape(ssignal and showlabel ? Trailingsl : na, title="Sell", text="Sell", location = location.absolute, style = shape.labeldown, size = size.tiny, color = color.red, textcolor = color.white, transp = 0)
float resistance = na
float support = na
support := pl ? pl : support[1]
resistance := ph ? ph : resistance[1]
plot(showsr and support ? support : na, color = showsr and support ? color.lime : na, style = plot.style_circles, offset = -prd)
plot(showsr and resistance ? resistance : na, color = showsr and resistance ? color.red : na, style = plot.style_circles, offset = -prd)
alertcondition(Trend == 1 and Trend[1] == -1, title='Buy Signal', message='Buy Signal')
alertcondition(Trend == -1 and Trend[1] == 1, title='Sell Signal', message='Sell Signal')
alertcondition(change(Trend), title='Trend Changed', message='Trend Changed')
SuperTrend This index is not all strange,Especially the squirrel quants futures based onSFSeries launchedSF14Super trend line trading strategy.We have decided to transfer it to the stock strategy on how to see the effect.
第一步:
现在TBQComplete graphical display algorithm and mark,沪深300指数:
OK,Indicators and correct,我们切换IF期货,Test the performance of the.这里需要注意,We need to adjust the margin percentage to100%,Let the spot with the same.
交易条件:
1.SuperTrend 决定方向(只做多)
2.Narrow gauge channel enters the arena when choosing
3.Tiger balm for
What is a narrow gauge channel?
Is you in the near futureKCalculating certain volatility in line and then combined with close to build small channel,Pay attention to small channel parameters can't thanSuperTrend 的大,Otherwise, it is not small channel,The meaning of lost timing,如下图:
The significance of small channel is,When you missed the best approach at the beginning of the trend,Later also can have the opportunity to get in the car again.
回测(只做多):
Look look good,We put it into the stock market have a look at it.
沪深300股票池:
Screening of market value in the top10Stock trading,SuperTrend>0At the same time narrow channel enters the arena when choosing.
Seems to be not inTBQ里的好,Because I don't have all played,That is not yet check only the forehand and backhand.Add back thereafter is too slow,So this time didn't add,The next stock strategy will improve the module.目前来看使用SuperTrend+Narrow channel after the timing,效果还可以接受,After joining check full stops to reduce the retreat.
Many industry rotation in
首先,Let's take a look at the Denver nuggets default rotation in the performance of model,The public policy is the strategy center.测试时间:2014年1月-2022年7月.
The default industry factor is good,Is a good wheel dynamic model.If we add technology to it when choosing,会不会更好一点.
Many industry rotation in+SuperTrend
绩效对比:
Many industry rotation in
Many industry rotation in+SuperTrend
加入松鼠宽客俱乐部(VIP),For the futures+Equity strategy source.
本策略仅作学习交流使用,实盘交易盈亏投资者个人负责.
边栏推荐
- 重磅!国内首个开放式在线绘图平台Figdraw突破10万用户!发布《奖学金激励计划》:最高5000元!...
- 【论文笔记】MiniSeg: An Extremely Minimum Network for Efficient COVID-19 Segmentation
- 分布式中的CAP原理
- 2022-07-29 网工进阶(二十二)BGP-其他特性(路由过滤、团体属性、认证、AS欺骗、对等体组、子路由器、路由最大接收数量)
- AD单片机九齐单片机NY8B062D SOP16九齐
- The problem that the column becomes indexed after pd groupby and the aggregation column has no column name
- 又拿三个大奖?!多力就是要让你吃的更营养更健康
- docker部署mysql并修改其占用内存大小
- 【每日一题】593. 有效的正方形
- 珠海首个水环境安全监测系统上线
猜你喜欢
安培龙IPO过会:年营收5亿 同创伟业与中移创新是股东
龙口联合化学通过注册:年营收5.5亿 李秀梅控制92.5%股权
Gradle series - Gradle tests, Gradle life cycle, settings.gradle description, Gradle tasks (based on Groovy documentation 4.0.4) day2-3
Wovent Bio IPO: Annual revenue of 480 million pension fund is a shareholder
[LiteratureReview]Optimal and Robust Category-level Perception: Object Pose and Shape Estimation f
荣信文化通过注册:年营收3.8亿 王艺桦夫妇为实控人
207.数组序号转换
易优压双驱挖掘机压路机器类网站源码 v1.5.8
1161. 最大层内元素和
MCU开发是什么?国内MCU产业现状如何
随机推荐
股票策略02 | 技术择时+行业因子+市值轮动
性能优化——资源优化笔记
【每日一题】952. 按公因数计算最大组件大小
2022年5月20日最全摸鱼游戏导航
ABC260 E - At Least One(双指针)
Koreographer Professional Edition丨一款Unity音游插件教程
Typora报错:This beta version of Typora is expired
牛客刷SQL--6
十九届浙大城院程序设计竞赛 F.Sum of Numerators(数学/找规律)
SQL查询数据以及排序
MBI5020 LED驱动
微服务原生案例搭建
【码蹄集新手村600题】判断一个数字是否为完全平方数
win10+Qt5.15.2 realizes low-power bluetooth control
ECCV 2022|R2L: 用数据蒸馏加速NeRF
php gui 框架 demo
牛客刷SQL--7
透过现象看本质,如何针对用户做好需求分析
docker部署mysql并修改其占用内存大小
PAT 1163 Dijkstra Sequence(30)