Rss & SiteMap

金字塔客服中心 - 专业程序化交易软件提供商 http://www.weistock.com/bbs/

专业程序化软件提供商
共11 条记录, 每页显示 10 条, 页签: [1] [2]
[浏览完整版]

标题:[原创]闲来无聊,发布一个本人常用的模版: 移动止损模版_leevolvo版

1楼
阿火 发表于:2011/6/20 12:57:42

//该模版用于历史评测,不用于实盘交易。
//该模版的亮点在于模块化和扩展性

//理解模版精华后,各种思路可在模版里随便添加、删除、扩展等
variable:zs=c,hl=c;//声明全局变量zs、hl
ma5:=ma(c,5);
ma20:=ma(c,20);
atr:=ma(h-l,20);//市场平均波动幅度
buycond:=cross(ma5,ma20);//平空开多条件
sellcond:=cross(ma20,ma5);//平多开空条件

if holding>0 then begin
 多止损:zs;
 if l<zs then sell(1,1,limitr,min(o,zs)-mindiff);
 else if sellcond then sell(1,1,limitr,c);
end

if holding<0 then begin
 空止损:zs;
 if h>zs then sellshort(1,1,limitr,max(o,zs)+mindiff);
 else if buycond then sellshort(1,1,limitr,c);
end

if holding=0 and buycond then begin//多头开仓
 buy(1,1,limitr,c);
 zs:=c-2*atr;
 hl:=c;//hl开仓后的最有利价位,刚买入时,最有利价位为开仓价
end

if holding=0 and sellcond then begin//空头开仓
 buyshort(1,1,limitr,c);
 zs:=c+2*atr;
 hl:=c;
end

if holding>0 and enterbars>0 and h>hl then begin//最高价抬升,止损位相应地抬升
 hl:=h;
 zs:=hl-2*atr;
end

if holding<0 and enterbars>0 and l<hl then begin//最低价下降,止损位相应地下移
 hl:=l;
 zs:=l+2*atr;
end

[此贴子已经被作者于2011-6-20 12:58:45编辑过]
2楼
河北张国强 发表于:2011/6/20 14:34:24
谢谢
3楼
xian_0_9 发表于:2011/6/21 11:25:16
图片点击可在新窗口打开查看
4楼
背影很杀 发表于:2011/6/21 18:49:43

请问楼主,把它直接用于实盘行吗?

5楼
背影很杀 发表于:2011/6/21 18:56:01
以下是引用leevolvo在2011-6-20 12:57:42的发言:

 

[此贴子已经被作者于2011-6-20 12:58:45编辑过]

请问版主,如果把它直接用在实盘里可以吗?您说是您经常用的!那适用在多少分钟图里比较准备长久一点呢~?谢谢,请把你的经验和大家分享一下吧!

6楼
阿火 发表于:2011/6/22 21:38:05

这是模板。不是实际可行的交易策略

 

且以上模板 止损是盘中触发即执行,而下单是收盘确认信号才执行,所以,用于实盘还需要做点改动

 

当然,也只要在你确认自己的模型确实可行要实盘交易了再去改动。做历史回撤足够了

7楼
wuyuanfu 发表于:2011/6/23 11:24:13
K线图形中看到了开仓信号,而这个模型不发出委托呢?
8楼
newbasic 发表于:2011/6/24 13:06:27
谢谢分享!
9楼
wzywzy292 发表于:2011/7/6 21:14:46
 谢谢分享!
10楼
lanshan 发表于:2012/2/6 0:36:33

强帖留名,支持楼主!

共11 条记录, 每页显示 10 条, 页签: [1] [2]


Powered By Dvbbs Version 8.3.0
Processed in .04688 s, 2 queries.