【MultiCharts(MC)程序化(量化)网上培训学习系列】第310节:自动支撑线和阻力线交易系统(Automated Support And Resistance trading system)原理设计、策略程式码、展示效果及初步回测
  
- UID
- 2
- 积分
- 2914403
- 威望
- 1407234 布
- 龙e币
- 1507169 刀
- 在线时间
- 13521 小时
- 注册时间
- 2009-12-3
- 最后登录
- 2025-3-3

|
【MultiCharts(MC)程序化(量化)网上培训学习系列】第310节:自动支撑线和阻力线交易系统(Automated Support And Resistance trading system)原理设计、策略程式码、展示效果及初步回测
论坛官方微信、群(期货热点、量化探讨、开户与绑定实盘)
|
|
|
|
|
|
  
- UID
- 2
- 积分
- 2914403
- 威望
- 1407234 布
- 龙e币
- 1507169 刀
- 在线时间
- 13521 小时
- 注册时间
- 2009-12-3
- 最后登录
- 2025-3-3

|
程式码部分:
一共有三个部分,两个公式,一个策略信号。
本帖隐藏的内容需要回复才可以浏览
因为这个策略有两个进场信号,即只做多,但是没有出场信号,所以这里附了一个ATR出场策略,可以加上。当然也可以尝试使用其它的出场方法找一个更合适的出场模块。- 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;
复制代码 策略原理与解析部分参考:本帖隐藏的内容需要回复才可以浏览 |
|
|
|
|
|
|
  
- UID
- 2
- 积分
- 2914403
- 威望
- 1407234 布
- 龙e币
- 1507169 刀
- 在线时间
- 13521 小时
- 注册时间
- 2009-12-3
- 最后登录
- 2025-3-3

|
运行效果:
 |
|
|
|
|
|
|
  
- UID
- 2
- 积分
- 2914403
- 威望
- 1407234 布
- 龙e币
- 1507169 刀
- 在线时间
- 13521 小时
- 注册时间
- 2009-12-3
- 最后登录
- 2025-3-3

|
绩效回测螺纹日线:

 |
|
|
|
|
|
|
  
- UID
- 2
- 积分
- 2914403
- 威望
- 1407234 布
- 龙e币
- 1507169 刀
- 在线时间
- 13521 小时
- 注册时间
- 2009-12-3
- 最后登录
- 2025-3-3

|
白糖5分钟线:

 |
|
|
|
|
|
|
  
- UID
- 2
- 积分
- 2914403
- 威望
- 1407234 布
- 龙e币
- 1507169 刀
- 在线时间
- 13521 小时
- 注册时间
- 2009-12-3
- 最后登录
- 2025-3-3

|
简评:
1、此策略仅做为参考还是有价值的,原始版并没有多少的实盘价格。视频中已经看到我用国内趋势最好的螺纹都不能取的好的绩效曲线。
2、最近白糖价格一路走高,出了一段趋势,所以我用这个策略回测一下,就会显示好一些,毕竟这个策略是仅做多的,在上涨行情中效果还是很好的。
3、判断市场形势在这个策略中作用还是满大的。 |
|
|
|
|
|
|

- UID
- 22867
- 积分
- 120
- 威望
- 60 布
- 龙e币
- 60 刀
- 在线时间
- 4 小时
- 注册时间
- 2023-3-17
- 最后登录
- 2023-5-7
|
|
|
|
|
|
|

- UID
- 22869
- 积分
- 1372
- 威望
- 686 布
- 龙e币
- 686 刀
- 在线时间
- 5 小时
- 注册时间
- 2023-3-18
- 最后登录
- 2023-5-28
|
|
|
|
|
|
|

- UID
- 21650
- 积分
- 790
- 威望
- 395 布
- 龙e币
- 395 刀
- 在线时间
- 19 小时
- 注册时间
- 2021-3-4
- 最后登录
- 2024-10-7
|
|
|
|
|
|
|

- UID
- 23211
- 积分
- 572
- 威望
- 286 布
- 龙e币
- 286 刀
- 在线时间
- 42 小时
- 注册时间
- 2024-2-25
- 最后登录
- 2024-7-25
|
|
|
|
|
|
|