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


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

   

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


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

主题:收盘时开仓

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


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

代码1贴完整代码


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

客户服务部

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

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

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


加好友 发短信
等级:论坛游民 帖子:225 积分:0 威望:0 精华:0 注册:2016/8/9 10:55:14
  发帖心情 Post By:2016/9/26 14:31:58    Post IP:218.106.146.122[只看该作者]

c1:=isup and ref(isup,1);
c2:=isdown and ref(isdown,1);
c3:=all(vol>=a,2);
c4:=time>091500 and time<162500;
if c1 and c3 and c4 and (( timetot0(dynainfo(207))>=time0-2) or not(islastbar)) then buy(holding=0,1,thisclose);
if holding>0 and enterprice-l>=b then sell(1,0,thisclose);
if holding>0 and h-enterprice>=d then sell(1,0,thisclose);
if c2 and c3 and c4 and (( timetot0(dynainfo(207))>=time0-2) or not(islastbar)) then buyshort(holding=0,1,thisclose);
if holding<0 and h-enterprice>=b then sellshort(1,0,thisclose);
if holding<0 and enterprice-l>=d then sellshort(1,0,thisclose);
end

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


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

这不是完整代码,编译会报错


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

客户服务部

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

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

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


加好友 发短信
等级:论坛游民 帖子:225 积分:0 威望:0 精华:0 注册:2016/8/9 10:55:14
  发帖心情 Post By:2016/9/26 14:50:58    Post IP:218.106.146.122[只看该作者]

c1:=isup and ref(isup,1);
c2:=isdown and ref(isdown,1);
c3:=all(vol>=a,2);
c4:=time>091500 and time<162500;
if c1 and c3 and c4 and (( timetot0(dynainfo(207))>=time0-2) or not(islastbar)) then buy(holding=0,1,thisclose);
if holding>0 and enterprice-l>=b then sell(1,0,thisclose);
if holding>0 and h-enterprice>=d then sell(1,0,thisclose);
if c2 and c3 and c4 and (( timetot0(dynainfo(207))>=time0-2) or not(islastbar)) then buyshort(holding=0,1,thisclose);
if holding<0 and h-enterprice>=b then sellshort(1,0,thisclose);
if holding<0 and enterprice-l>=d then sellshort(1,0,thisclose);
a缺省300,b缺省30,c缺省45,就是这样。 

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


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

variable:bj=0;

c1:=isup and ref(isup,1);
c2:=isdown and ref(isdown,1);
c3:=all(vol>=a,2);
c4:=time>091500 and time<162500;
if c1 and c3 and c4 and (( timetot0(dynainfo(207))>=time0-2) or not(islastbar)) and bj=0  and holding=0 then begin
 bj:=1;
 buy(holding=0,1,thisclose);
end

if c1 and c3 and c4 and (( timetot0(dynainfo(207))>=time0-2) or not(islastbar)) and bj=1 and exitbars>3  and holding=0 then begin
 bj:=1;
 buy(holding=0,1,thisclose);
end

if holding>0 and enterprice-l>=b then sell(1,0,thisclose);
if holding>0 and h-enterprice>=d then sell(1,0,thisclose);
if c2 and c3 and c4 and (( timetot0(dynainfo(207))>=time0-2) or not(islastbar)) and bj=0 and holding=0 then begin
 bj:=1;
 buyshort(holding=0,1,thisclose);
end
if c2 and c3 and c4 and (( timetot0(dynainfo(207))>=time0-2) or not(islastbar)) and bj=1 and exitbars>3 and holding=0 then begin
 bj:=1;
 buyshort(holding=0,1,thisclose);
end
if holding<0 and h-enterprice>=b then sellshort(1,0,thisclose);
if holding<0 and enterprice-l>=d then sellshort(1,0,thisclose);



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

客户服务部

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

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

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


加好友 发短信
等级:论坛游民 帖子:225 积分:0 威望:0 精华:0 注册:2016/8/9 10:55:14
  发帖心情 Post By:2016/9/27 9:53:03    Post IP:218.106.146.122[只看该作者]

if c1 and c3 and c4 and (( timetot0(dynainfo(207))>=time0-2) or not(islastbar)) and bj=0  and holding=0 then begin
 bj:=1;
 buy(holding=0,1,thisclose); 老师这句代码中bj:=1;是什么意思。

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


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

把变量置为1,BJ=1时就表示过有开仓了,那么就可以使用exitbars来进行判断了


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

客户服务部

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

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

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


加好友 发短信
等级:论坛游民 帖子:225 积分:0 威望:0 精华:0 注册:2016/8/9 10:55:14
  发帖心情 Post By:2016/9/27 10:09:05    Post IP:218.106.146.122[只看该作者]

那为什么每个开仓语句都要有bj:=1,不管是记录第一次开仓还是第二次开仓。老师有没有关于函数variable的使用方法说明。

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


加好友 发短信
等级:论坛游民 帖子:225 积分:0 威望:0 精华:0 注册:2016/8/9 10:55:14
  发帖心情 Post By:2016/9/27 10:12:28    Post IP:218.106.146.122[只看该作者]

为什么都要 then begin
 bj:=1;
 buy(holding=0,1,thisclose);

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


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

就如上所讲的,bj=1表示前面有过开仓,所以在每个开仓时都置为1



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

客户服务部

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

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

 回到顶部
总数 110 1.. 上一页 2 3 4 5 6 7 8 9 10 11 下一页