以文本方式查看主题

-  金字塔客服中心 - 专业程序化交易软件提供商  (http://222.73.7.161/bbs/index.asp)
--  交易策略发布专区  (http://222.73.7.161/bbs/list.asp?boardid=10)
----  [原创]变种r-b  (http://222.73.7.161/bbs/dispbbs.asp?boardid=10&id=31466)

--  作者:Q1304230834
--  发布时间:2012/12/13 11:19:29
--  [原创]变种r-b
//本例旨在学习
//源码提供
//BY Ne
//2012-12-13
//股指5分钟

input:upperN(100,50,150,10),upN(50,30,100,10),downN(50,30,100,10),downerN(100,50,150,10);
KLineNum:=BARSLAST(day<>ref(day,1));
OpenPrice:ref(o,KLineNum);
t1:=time>=092000 and time<=144000;
//上轨:开盘价+1%
upper:OpenPrice*(1+0.01*0.01*upperN);
//中上轨:开盘价+0.5%
up:OpenPrice*(1+0.01*0.01*upN);
//中下轨:开盘价-0.5%
down:OpenPrice*(1-0.01*0.01*downN);
//下轨:开盘价-1%
downer:OpenPrice*(1-0.01*0.01*downerN);

//开多:突破上轨 or (最低价不破下轨 and 上穿中下轨;
long:=c>upper or (llv(l,KLineNum)>downer and l<down and c>down);
//平多:反向走0.5%出局
longend:=holding>0 and (enterprice-c)/enterprice>=0.5*0.01;
//开空:突破下轨 or  (最高价不丰上轨 and 下穿中上轨)
short:=c<downer or (hhv(h,KLineNum)<upper and h>up and c<up);
//平空:反向走0.5%出局
shortend:=holding<0 and (c-enterprice)/enterprice>=0.5*0.01;


if holding>0 and longend then sell(1,1,thisclose);
if holding<0 and shortend then sellshort(1,1,thisclose);

if holding=0 and t1 and long then buy(1,1,thisclose);
if holding=0 and t1 and short then buyshort(1,1,thisclose);

if time>150900 then BEGIn
sell(holding>0,holding,thisclose);
sellshort(holding<0,abs(holding),thisclose);
end

--  作者:zsjwhy
--  发布时间:2012/12/13 22:02:17
--  
2012年表现不好
--  作者:Q1304230834
--  发布时间:2012/12/14 11:23:26
--  
表现好的,都是用到表现不好才发出来给大家研究,没有免费的午餐。
能分发免费的面包就不错了图片点击可在新窗口打开查看

--  作者:clivelong
--  发布时间:2012/12/14 14:00:01
--  
 不错,不错
--  作者:阿迪瑞斯
--  发布时间:2012/12/19 10:30:30
--  
3楼说的很中肯
--  作者:翻手为云
--  发布时间:2013/1/9 22:49:58
--  了解了,,会仔细研究的
呵呵,拜读了很多了最近在,呵呵,今天都在这里一一谢过那些大神!