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


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

   

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


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

主题:帮忙编写个程序:

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


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

两笔交易是指开仓2次,还是开仓1次平仓一次


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

客户服务部

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

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

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


加好友 发短信
等级:罗宾汉 帖子:46311 积分:50819 威望:0 精华:2 注册:2011/3/23 8:50:25
  发帖心情 Post By:2016/2/22 11:22:17    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:2016/2/22 13:19:22    Post IP:58.246.57.26[显示全部帖子]


variable:n=0,m=0;
hh:valuewhen(time=133000,hhv(h,30));
ll:valuewhen(time=133000,llv(l,30));
tt:=time0<timetot0(closetime(0))-60;

if time>133000 and tt and h>hh and n=0 and holding<=0 then begin
 sellshort(1,0,marketr);
 buy(holding=0,1,marketr);
 n:=1;
end

if time>133000 and tt and l<ll and m=0 and holding>=0 then begin
 sell(1,0,marketr);
 buyshort(holding=0,1,marketr);
 m:=1;
end

if time0>=timetot0(closetime(0))-60 then begin
 sell(1,0,marketr);
 sellshort(1,0,marketr);
 n:=0;
 m:=0;
end

 



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

客户服务部

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

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

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


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

variable:n=0,m=0;
hh:valuewhen(time=140500,hhv(h,5));
ll:valuewhen(time=140500,llv(l,5));
tt:=time0<timetot0(closetime(0))-60;

if time>140500 and tt and h>hh and n=0 and holding<=0 then begin
 sellshort(1,0,marketr);
 buy(holding=0,1,marketr);
 n:=1;
end

if time>140500 and tt and l<ll and m=0 and holding>=0 then begin
 sell(1,0,marketr);
 buyshort(holding=0,1,marketr);
 m:=1;
end

if time0>=timetot0(closetime(0))-60 then begin
 sell(1,0,marketr);
 sellshort(1,0,marketr);
 n:=0;
 m:=0;
end



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

客户服务部

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

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

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


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

这种思路一样就改个时间参数的用户自行修改一下上面的代码


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

客户服务部

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

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

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


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

variable:n=0;

 

oo:=valuewhen(todaybar=1,o);

cc:=ref(close,todaybar);

 

hh:=max(oo,cc);

ll:=min(oo,cc);

 

if todaybar>5 and time0<timetot0(closetime(0))-60 and n=0 and h>hh and holding=0 then begin

    buy(holding=0,1,marketr);

    n:=1;

end

 

if todaybar>5 and time0<timetot0(closetime(0))-60 and n=0 and l<ll and holding=0 then begin

    buyshort(holding=0,1,marketr);

    n:=1;

end

 

if holding>0 and c<=enterprice*0.99 then sell(1,0,marketr);

if holding<0 and c>=enterprice*1.01 then sellshort(1,0,marketr);

 

if time0>=timetot0(closetime(0))-60 then begin

    sellshort(1,0,marketr);

    sell(1,0,marketr);

    n:=0;

end



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

客户服务部

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

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

 回到顶部