欢迎使用金字塔普通技术服务论坛,您可以在相关区域发表技术支持贴。
我司技术服务人员将优先处理 VIP客服论坛 服务贴,普通区问题处理速度慢,请耐心等待。谢谢您对我们的支持与理解。


金字塔客服中心 - 专业程序化交易软件提供商金字塔软件交易策略发布专区 → [原创]变种r-b

   

欢迎使用金字塔普通技术服务论坛,您可以在相关区域发表技术支持贴。
我司技术服务人员将优先处理 VIP客服论坛 服务贴,普通区问题处理速度慢,请耐心等待。谢谢您对我们的支持与理解。    


  共有10681人关注过本帖树形打印复制链接

主题:[原创]变种r-b

帅哥哟,离线,有人找我吗?
Q1304230834
  1楼 | QQ | 信息 | 搜索 | 邮箱 | 主页 | UC


加好友 发短信
等级:新手上路 帖子:66 积分:-17 威望:0 精华:0 注册:2012/9/4 15:03:15
[原创]变种r-b  发帖心情 Post By:2012/12/13 11:19:29 [显示全部帖子]

//本例旨在学习
//源码提供
//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

版主评定:好评,获得5个金币奖励好评,获得5个金币奖励
(理由:好文章)
 回到顶部
帅哥哟,离线,有人找我吗?
Q1304230834
  2楼 | QQ | 信息 | 搜索 | 邮箱 | 主页 | UC


加好友 发短信
等级:新手上路 帖子:66 积分:-17 威望:0 精华:0 注册:2012/9/4 15:03:15
  发帖心情 Post By:2012/12/14 11:23:26 [显示全部帖子]

表现好的,都是用到表现不好才发出来给大家研究,没有免费的午餐。
能分发免费的面包就不错了图片点击可在新窗口打开查看

 回到顶部