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


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

   

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


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

主题:老师,帮帮忙

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


加好友 发短信
等级:罗宾汉 帖子:46311 积分:50819 威望:0 精华:2 注册:2011/3/23 8:50:25
  发帖心情 Post By:2015/11/16 9:33:42    Post IP:58.246.57.26[显示全部帖子]

variable:n=0,m1=0,m2=0,m3=0;
oo:=VALUEWHEN(todaybar=1,o);
ma60:=ma(c,60);
if c>oo+5 and c>ma60 and holding=0 then begin 
buy(1,1,market);
end
if c>oo+10 and c>ma60 and holding=0 then begin 
buy(1,1,market);
end

if c>oo+15 and c>ma60 and holding=0 then begin 
buy(1,1,market);
end

if c>oo+20 and c>ma60 and holding=0 then begin 
buy(1,1,market);
end

if c>oo+25 and c>ma60 and hodling=0 then begin 
buy(1,1,market);
end
 
if c>enterprice+3 then then sell(1,0,market);


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

客户服务部

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

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

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


加好友 发短信
等级:罗宾汉 帖子:46311 积分:50819 威望:0 精华:2 注册:2011/3/23 8:50:25
  发帖心情 Post By:2015/11/16 9:59:04    Post IP:58.246.57.26[显示全部帖子]

对,

可以省略全局变量的定义



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

客户服务部

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

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

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


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

if ((timetot0(dynainfo(207))>=time0-30) or not(islastbar)) and time=closetime(0) then begin

    sell(1,0,market);

    sellshort(1,0,market);

end

[此贴子已经被作者于2015/11/16 13:30:39编辑过]


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

客户服务部

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

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

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


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

什么叫“成交了2次”?一个单子分两次成交的?
[此贴子已经被作者于2015/11/16 14:12:16编辑过]


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

客户服务部

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

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

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


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

1为什么下单了两次:看下单日志里面的记录情况

2为什么不满足条件但是平仓了:贴调试记录,看看调试的情况是什么样的



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

客户服务部

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

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

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


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

写得没错,实际应用上有没有问题要看调试才能看出来,不是看代码看出来的


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

客户服务部

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

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

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


加好友 发短信
等级:罗宾汉 帖子:46311 积分:50819 威望:0 精华:2 注册:2011/3/23 8:50:25
  发帖心情 Post By:2015/11/16 15:05:46    Post IP:58.246.57.26[显示全部帖子]

图表和后台不能混用,图表上不要使用后台函数和动态行情函数,你先都改成图表的
[此贴子已经被作者于2015/11/16 15:06:52编辑过]


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

客户服务部

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

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

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


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

variable:n1=0,n2=0,n3=0,n4=0,n5=0,n6=0,n7=0,n8=0;
variable:tt1=0,tt2=0,tt3=0,tt4=0,tt5=0,tt6=0,tt7=0,tt8=0;
oo:=VALUEWHEN(todaybar=1,o);
ma60:=ma(c,60);
 
if c<oo-2*mindiff and c<ma60 and n1=0 and time<>tt1 then begin
BUYSHORT(1,1,market);
n1:=1;
tt1:=time;
END
 


if c<oo-4*mindiff and c<ma60 and n2=0 and time<>tt2 and enterbars>0 then begin
BUYSHORT(1,2,market);
n2:=1;
tt1:=time;;
END
 
if c<oo-8*mindiff and c>ma60 and n3=0 and time<>tt3 and enterbars>0 then begin
BUYSHORT(1,3,market);
n3:=1;
tt1:=time;
end


if c<oo-10*mindiff and c>ma60 and n4=0 and time<>tt4 and enterbars>0 then begin
BUYSHORT(1,4,market);
n4:=1;
tt1:=time;
end


if c<oo-12*mindiff and c>ma60 and n5=0 and time<>tt5 and enterbars>0 then begin
BUYSHORT(1,5,market);
n5:=1;
tt1:=time;
end


if c<oo-14*mindiff and c>ma60 and n6=0 and time<>tt6 and enterbars>0 then begin
BUYSHORT(1,6,market);
n6:=1;
tt1:=time;
end
if c<oo-16*mindiff and c>ma60 and n7=0 and time<>tt7 and enterbars>0 then begin
BUYSHORT(1,7,market);
n7:=1;
tt1:=time;
end


if c<oo-6*mindiff and c>ma60 and n8=0 and time<>tt8 and enterbars>0 then begin
BUYSHORT(1,8,market);
n8:=1;
tt1:=time;
end


if time=closetime(0) and enterbars>0 then begin
n1:=0;
n2:=0;
n3:=0;
n4:=0;
n5:=0;
n6:=0;
n7:=0;
n8:=0;


tt1:=0;
tt2:=0;
tt3:=0;
tt4:=0;
tt5:=0;
tt6:=0;
tt7:=0;


tt8:=0;


end



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

客户服务部

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

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

 回到顶部