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


金字塔客服中心 - 专业程序化交易软件提供商金字塔软件公式模型编写问题提交 → 自动交易

   

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


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

主题:自动交易

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


加好友 发短信
等级:罗宾汉 帖子:46311 积分:50819 威望:0 精华:2 注册:2011/3/23 8:50:25
  发帖心情 Post By:2016/12/1 14:16:57    Post IP:180.173.193.42[显示全部帖子]

以下是引用曹晓东在2016-12-1 14:14:29的发言:

variable:bj=0;
ss:=stkindi('','时间.tt',0,5);
a1:=ref(HIGH,22); 
a2:=ref(HIGH,10); 
a6:=ref(l,22);
a7:=ref(l,10);




a3:=c>a1 and c>a2;
a8:=c<a6 and c<a7;

mm:=ref(h,1)=hhv(h,3) or ref(h,2)=hhv(h,3) or ref(h,3)=hhv(h,3);
nn:=ref(l,1)=llv(l,3) or ref(l,2)=hhv(l,3) or ref(l,3)=hhv(l,3);
if mm then bj:=1;
if nn then bj:=-1;
nn1:=barslast(mm);
nn2:=barslast(nn);
if c<ref(l,nn1+1) and bj=1 then i:=1;
if c>ref(h,nn2+1) and bj=-1 then i:=-1;

uu3:=cross(i=1,0.5);
uu4:=cross(i=-1,0.5);
tt:=(time>=090512 and time<=112400) or (time>=133500 and time<=145400) or (time>=210500 and time<=225500);

aa1:=ma(c,10);
aa3:=PARTLINE(a1>ref(a1,1),a1,colorred,1);
aa6:=PARTLINE(a1<ref(a1,1),a1,colorgreen,1);
aa2:=ma(c,22);
aa4:=PARTLINE(a2>ref(a2,1),a2,colorred,2);
aa5:=PARTLINE(a2<ref(a2,1),a2,colorgreen,2);
aa7:=aa3 and aa4;
aa8:=aa6 and aa5;








 
 n1:=hhvbars(vol,10);
 h10:=ref(h,n1);
 if holding<0 and c>h10 then sellshort(1,0,thisclose);
 
 l10:=ref(l,n1); 
 if holding>0 and c<l10 then sell(1,0,thisclose);
 
 

if (time>=112500 and time<=113000) or (time>=145500 and time<=150000) or (time>=225500 and time<=230000) then begin
   sell(1,0,thisclose);
  sellshort(1,0,thisclose);
end 
 

在这里面帮忙加一个当uu3出现,等待aa8,当aa8出现,然后开空。 uu4出现,等待aa7,aa7出现,开多。

上面的标记是要加在开仓语句里面的,你这里的开仓语句没了



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

客户服务部

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

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

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


加好友 发短信
等级:罗宾汉 帖子:46311 积分:50819 威望:0 精华:2 注册:2011/3/23 8:50:25
  发帖心情 Post By:2016/12/1 14:33:19    Post IP:180.169.30.6[显示全部帖子]

variable:dt=0,kt=0;
ss:=stkindi('','时间.tt',0,5);
a1:=ref(HIGH,22);
a2:=ref(HIGH,10);
a6:=ref(l,22);
a7:=ref(l,10);

 

 

 


a3:=c>a1 and c>a2;
a8:=c<a6 and c<a7;


mm:=ref(h,1)=hhv(h,3) or ref(h,2)=hhv(h,3) or ref(h,3)=hhv(h,3);
nn:=ref(l,1)=llv(l,3) or ref(l,2)=hhv(l,3) or ref(l,3)=hhv(l,3);
if mm then bj:=1;
if nn then bj:=-1;
nn1:=barslast(mm);
nn2:=barslast(nn);
if c<ref(l,nn1+1) and bj=1 then i:=1;
if c>ref(h,nn2+1) and bj=-1 then i:=-1;


uu3:=cross(i=1,0.5);
uu4:=cross(i=-1,0.5);

if uu3 then kt:=1;
if uu4 then dt:=1;
aa1:=ma(c,10);
aa3:=PARTLINE(a1>ref(a1,1),a1,colorred,1);
aa6:=PARTLINE(a1<ref(a1,1),a1,colorgreen,1);
aa2:=ma(c,22);
aa4:=PARTLINE(a2>ref(a2,1),a2,colorred,2);
aa5:=PARTLINE(a2<ref(a2,1),a2,colorgreen,2);
aa7:=aa3 and aa4;
aa8:=aa6 and aa5;

 


tt:=(time>=090512 and time<=112400) or (time>=133500 and time<=145400) or (time>=210500 and time<=225500);
if kt=1 and  a8 and holding=0  and tt then begin 
 buyshort(holding=0,1,market);
 end
if dt=1 and  uu4 and holding=0 and tt then begin
 buy(holding=0,1,market);
 end
 
 b1:=c<ref(l,barslast(c>o));
 if a8 and b1 and holding=0 and tt  then begin
  buyshort(holding=0,1,market);
 end
 
b2:=c>ref(h,barslast(c<o));
 if a3 and b2 and  holding=0 and tt then begin
  buy(holding=0,1,market);
 end
 
 n1:=hhvbars(vol,10);
 h10:=ref(h,n1);
 if holding<0 and c>h10 then begin
   dt:=0;
   kt:=0;
   sellshort(1,0,thisclose);
 end
 l10:=ref(l,n1);
 if holding>0 and c<l10 then begin
  dt:=0;
  kt:=0;
  sell(1,0,thisclose);
 end
 
 //if holding<0 and c>a2 then sellshort(1,0,thisclose);
 //if holding<0 and uu4 then sellshort(1,0,thisclose);
 //if holding<0 and c>ref(h,22) then  sellshort(1,0,thisclose);
 //if holding>0 and c<ref(l,22) then  sell(1,0,thisclose);
//if holding>0 and c<a7 then sell(1,0,thisclose);
// if holding>0 and uu3 then sell(1,0,thisclose);


if (time>=112500 and time<=113000) or (time>=145500 and time<=150000) or (time>=225500 and time<=230000) then begin
   sell(1,0,thisclose);
  sellshort(1,0,thisclose);
  kt:=0;
  dt:=0;
end

 



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

客户服务部

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

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

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


加好友 发短信
等级:罗宾汉 帖子:46311 积分:50819 威望:0 精华:2 注册:2011/3/23 8:50:25
  发帖心情 Post By:2016/12/8 10:41:12    Post IP:180.169.30.6[显示全部帖子]

不要重复发帖


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

客户服务部

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

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

 回到顶部
总数 24 上一页 1 2 3