龙听期货论坛's Archiver

C
+
+


 微信: QQ:

龙听 发表于 2023-4-9 07:20

【MultiCharts(MC)程序化(量化)网上培训学习系列】第310节:自动支撑线和阻力线交易系统(Automated Support And Resistance trading system)原理设计、策略程式码、展示效果及初步回测

【MultiCharts(MC)程序化(量化)网上培训学习系列】第310节:自动支撑线和阻力线交易系统(Automated Support And Resistance trading system)原理设计、策略程式码、展示效果及初步回测

[mp4]http://mp4.qhlt.club/Rec%200310.mp4[/mp4]

[size=14.4px]1、注册论坛会员即可免费获得公开课视频[/size][size=14.4px]源码[/size][size=14.4px]及文档;升级至付费会员免回复查看[/size][size=14.4px]策略源码[/size][size=14.4px]、文档;升级至prime会员无阻碍畅游全站[/size][size=14.4px]期货[/size][size=14.4px]策略、源码、回测、优化、视频、教程、图书、文档,具体参考:[/size][url=http://www.qhlt.cn/thread-37840-1-1.html]http://www.qhlt.cn/thread-37840-1-1.html[/url][size=14.4px];[/size]

[size=14.4px]2、通过期货论坛推荐新开立期货账号,可免费获得付费会员或prime会员资格并享受账户特惠政策,参考:[/size][url=http://www.qhlt.cn/thread-25049-1-1.html]http://www.qhlt.cn/thread-25049-1-1.html[/url][size=14.4px];[/size]

[size=14.4px]3、通过期货论坛开立期货账号并绑定MC享受专属优惠政策:[/size][url=http://www.qhlt.cn/thread-80442-1-1.html]http://www.qhlt.cn/thread-80442-1-1.html[/url][size=14.4px];[/size]

[size=14.4px]4、PC购买/服务器托管如何选择及量化软件相关设置指导:[/size][url=http://www.qhlt.cn/thread-105169-1-1.html]http://www.qhlt.cn/thread-105169-1-1.html[/url][size=14.4px];[/size]

[size=14.4px]5、全网最大策略源码区:[/size][url=http://www.qhlt.cn/forum-109-1.html]http://www.qhlt.cn/forum-109-1.html[/url][size=14.4px] ;策略精选推荐优化区:[/size][url=http://www.qhlt.cn/forum-874-1.html]http://www.qhlt.cn/forum-874-1.html[/url][size=14.4px];回测排名:[url=http://www.qhlt.cn/forum-877-1.html]http://www.qhlt.cn/forum-877-1.html[/url];[/size]

[size=14.4px]6、对视频中策略有困惑、想法、建议、优化?欢迎关注管理员微信进行切磋与交流。动动手,扫二维码加入微信群跟一众量化爱好者切磋吧:[/size]
[size=14.4px]管理员微信:[/size][img=120,120]http://www.qhlt.cn/link/wx.png[/img][size=14.4px] 论坛官方微信群:[/size][img=120,121]http://www.qhlt.cn/link/wg.png[/img]

龙听 发表于 2023-4-9 07:23

程式码部分:

一共有三个部分,两个公式,一个策略信号。
**** Hidden Message *****

因为这个策略有两个进场信号,即只做多,但是没有出场信号,所以这里附了一个ATR出场策略,可以加上。当然也可以尝试使用其它的出场方法找一个更合适的出场模块。[code]Input:atrlen(30),trailatrmult(3);
var:lexit(0),sexit(0),atr1(0),top(0),bot(0);

atr1 = atr(atrlen);

if barssinceentry = 0 then begin //inital high and low
top = high;
bot = Low;
end;

if high > top then top = high; //find the highest point since entry
if Low < bot then bot = low;  // find then lowest point sine entry

if marketposition = 1 then begin // manage long position
lexit = top - trailatrmult*atr1;
if barssinceentry=0 and Close < lexit then sell("Atr-nextdayout") all shares next bar at Open;
if barssinceentry>0 then begin
sell("atr-tail-stop") all shares next bar at lexit stop;
value1 = tl_new(date[1],time,lexit[1],date,time,lexit);
end;
end;

if marketposition = -1 then begin //manage short position
sexit = bot + trailatrmult*atr1;
if barssinceentry=0 and Close > sexit then sell("atr-nextdayout") all shares next bar at Open;
if barssinceentry>0 then begin
buytocover("atr-trail-stop") all shares next bar at sexit stop;
value1 = tl_new(date[1],time,sexit[1],date,time,sexit);
end;
end;
[/code]策略原理与解析部分参考:**** Hidden Message *****

龙听 发表于 2023-4-9 07:54

运行效果:
[img]http://p.algo2.net/2023/0409/4620c12d0c247.png[/img]

龙听 发表于 2023-4-9 07:55

绩效回测螺纹日线:
[img]http://p.algo2.net/2023/0409/4620c12d0c247.png[/img]
[img]http://p.algo2.net/2023/0409/947def010f16b.png[/img]

龙听 发表于 2023-4-9 07:55

白糖5分钟线:
[img]http://p.algo2.net/2023/0409/ebf2f96686ca2.png[/img]
[img]http://p.algo2.net/2023/0409/39a3414b2e7cb.png[/img]

龙听 发表于 2023-4-9 08:00

简评:

1、此策略仅做为参考还是有价值的,原始版并没有多少的实盘价格。视频中已经看到我用国内趋势最好的螺纹都不能取的好的绩效曲线。

2、最近白糖价格一路走高,出了一段趋势,所以我用这个策略回测一下,就会显示好一些,毕竟这个策略是仅做多的,在上涨行情中效果还是很好的。

3、判断市场形势在这个策略中作用还是满大的。

弗雷德 发表于 2023-5-7 23:25

学习一下

琦琦 发表于 2023-5-28 16:20

謝謝

下次了 发表于 2023-7-2 21:30

学习学习

小龍 发表于 2024-2-26 20:27

學習

页: [1]
渠道·推广(20年运营值得信赖!)▼:温馨提示:期货论坛稳定、流畅的访问体验有赖于赞助商的广告支持,赞助商业务内容非本站官方业务,期货、证券及外汇投资均有亏损的风险,访问赞助商广告即代表您已了解其中的风险。欢迎意向赞助商联系客服或管理员咨询相关事宜。
                     
❤️2025年通过期货论坛开户享受如下优惠政策:政策一:手续费最低交易所+1分起,政策二:日内炒单及大资金享更高比率返还,政策三:保证金可申请交易所标准+0,政策四:开户即享有论坛Prime会员资格(价值199元/年),开户咨询管理员或右侧客服! 😋欧美期货杂志购买、下载与中文翻译:/thread-10603-1-1.html |TB/MC开户优惠政策:/thread-5986-1-1.html2025年最新交易所手续费表:/thread-7537-1-1.htmlSC2.png2025年最新中文翻译:/thread-160355-1-1.html;
欧美期货程序化期刊中文翻译目录: 【1982/83.01-12期】 【1984.01-12期】 【1985.01-12期】 【1986.01-12期】 【1987.01-12期】 【1988.01-12期】 【1989.01-12期】 【1990.01-12期】 【1991.01-12期】 【1992.01-12期】 【1993.01-12期】 【1994.01-12期】 【1995.01-12期】 【1996.01-12期】 【1997.01-12期】 【1998.01-12期】 【1999.01-12期】 【2000.01-12期】 【2001.01-12期】 【2002.01-12期】 【2003.01-12期】 【2004.01-12期】 【2005.01-12期】 【2006.01-12期】 【2007.01-12期】 【2008.01-12期】 【2009.01-12期】 【2010.01-12期】 【2011.01-12期】 【2012.01-12期】 【2013.01-12期】 【2014.01-12期】正在更新中...... 【2015.01-12期】待补 【2016.01-12期】待补 【2017.01-12期】正在更新中...... 【2018.01-12期】 【2019.01-12期】 【2020.01-12期】 【2021.01-12期】 【2022.01-12期】 【2023.01-12期】 【2024.01-12期】 【2025.01-12期】正在更新中......