【MultiCharts(MC)程序化(量化)网上培训学习系列】第330节:经典策略范例"统计学方法随机量化策略"程式码、进行展示效果及对螺纹期货进行初步回测
  
- UID
- 2
- 积分
- 2914403
- 威望
- 1407234 布
- 龙e币
- 1507169 刀
- 在线时间
- 13521 小时
- 注册时间
- 2009-12-3
- 最后登录
- 2025-3-3

|
【MultiCharts(MC)程序化(量化)网上培训学习系列】第330节:经典策略范例"统计学方法随机量化策略"程式码、进行展示效果及对螺纹期货进行初步回测
论坛官方微信、群(期货热点、量化探讨、开户与绑定实盘)
|
|
|
|
|
|
  
- 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

|
multicharts平台整理后策略码(优化小周期信号不显示问题)
本帖隐藏的内容需要回复才可以浏览
优化二:增加atr止盈出场功能,同时取消规定bar数后出场功能
本帖隐藏的内容需要回复才可以浏览
附atr-exit 模块:- 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

|
简评:
1、策略本身简洁,思路清晰;
2、效果上面表现比较一般,无论是大周期还是小周期上面。 |
|
|
|
|
|
|

- UID
- 22595
- 积分
- 340
- 威望
- 170 布
- 龙e币
- 170 刀
- 在线时间
- 187 小时
- 注册时间
- 2022-8-11
- 最后登录
- 2025-2-21
|
|
化石
|
|
|
|
|
  
- UID
- 22603
- 积分
- 210
- 威望
- 105 布
- 龙e币
- 105 刀
- 在线时间
- 13 小时
- 注册时间
- 2022-8-18
- 最后登录
- 2024-5-29
|
多谢龙版 |
|
|
|
|
|
|