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


金字塔客服中心 - 专业程序化交易软件提供商金字塔软件策略编写求助区 → 我是菜鸟,能不能帮忙写个策略指标

   

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


  共有6476人关注过本帖平板打印复制链接

主题:我是菜鸟,能不能帮忙写个策略指标

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


加好友 发短信
等级:罗宾汉 帖子:46311 积分:50819 威望:0 精华:2 注册:2011/3/23 8:50:25
  发帖心情 Post By:2013/9/6 15:46:50 [只看该作者]

最后一个条件没写出,回落不给个固定值写不出

 

zs:=callstock(stklabel,vtclose,6,-1);//昨收
jk:=valuewhen(todaybar=1,open);//今开
variable:n=0,m=0;
variable:x=0,y=0;
variable:cishu1=0,cishu2=0;
variable:biaoji=0;
if jk>zs+10*mindiff then buyshort(holding=0,1,market);

if close<zs-10*mindiff then sellshort(holding<0,1,market);

if jk<zs-10*mindiff then buy(holding=0,1,market);

if close>zs+10*mindiff then sell(holding>0,1,market);

if close>zs+10*mindiff then buyshort(holding=0,1,market);

if close<zs-10*mindiff then sellshort(holding<0,0,market);

if close<zs-10*mindiff then buy(holding=0,1,market);

if close>zs+10*mindiff then sell(holding>0,0,market);


if h>ref(hhv(h,todaybar),1) then n:=n+1;
nn1:=ref(barslast(h>ref(hhv(h,todaybar),1))+1,1);
if h>ref(hhv(h,todaybar),1) and llv(l,nn1)>zs then x:=1;
if n=3 and h>ref(hhv(h,todaybar),1) and x=1  and biaoji=0 then begin
   buyshort(holding=0,1,market);
   biaoji:=1;
   n:=0;
   x:=0;
end
if biaoji=1 and enterprice-c>15*mindiff then begin
 sellshort(holding<0,0,market);
 biaoji:=0;
end


if l<ref(llv(l,todaybar),1) then m:=m+1;
nn2:=ref(barslast(l>ref(llv(l,todaybar),1))+1,1);
if  l<ref(llv(l,todaybar),1) and hhv(h,nn2)<zs then y:=1;
if m=3 and l<ref(llv(l,todaybar),1) and y=1  and biaoji=0 then begin
   buy(holding=0,1,market);
   biaoji:=1;
   m:=0;
   y:=0;
end
if biaoji:=1 and c-enterprice>15*mindiff then begin 
 sell(1,0,market);
 biaoji:=0;
end

{7.单边上涨,连续4次创今日新高后并且创新高之间没有跌破昨日收盘价  开多。盈利20个点后,平多
8.反之单边下跌,连续4次创今日新低后并且创新低之间没有涨破昨日收盘价  开空。盈利20个点后,平空
单边上涨->一直未突破昨日的收盘价。 一直在昨日的收盘价之上。 
如果创新高再回落(未突破昨日收盘价),连续4次这样的话,就开多。反之开空。}

dbsz:=llv(l,todaybar)>zs;
dbxd:=hhv(h,todaybar)<zs;
if dbsz and n=4 and x=0 then buy(holding=0,1,market);

if c-enterprice>20*mindiff then sell(holding>0,0,market);

if dbxd and m=4 and y=0 then buyshort(holding=0,1,market);

if enterprice-c>20*mindiff then sellshort(holding<0,0,market);

 


if c-enterprice>10*mindiff then sellshort(1,0,market);
if enterprice-c>10*mindiff then sell(1,0,market);



金字塔—专业程序化交易量化投资平台

客户服务部

----------------------------------------------------------- 欢迎您参加我公司的技术培训,具体培训需求请发邮件到service@weistock.com

您的宝贵建议或者投诉,请发往邮箱:weiwei@weistock.com

 回到顶部
总数 12 1 2 下一页