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


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

   

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


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

主题:老师, 帮忙编个程序

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


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

每天就一笔交易

 

只多空加起来一笔还是多空各一笔



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

客户服务部

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

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

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


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

看一分钟K线.下午14:00后,如果突破了当天的最高点 就做多,(有夜盘的 从晚上开盘到第二天上午都算当天) 一直留到收盘最后一分钟前(14:59)平仓.止损点数为开仓价格的0.5%.比如4000开仓做多,止损就是3980. 每天就一笔交易,做空相反.

 

variable:n=0;

if time>=180000 and time<185900 and h>ref(hhv(h,todaybar),1) and  holding=0 and n=0 then begin

    buy(holding=0,1,marketr);

    n:=1;

end

 

if time>=180000 and time<185900 and l<ref(llv(l,todaybar),1) and  holding=0 and n=0 then begin

    buyshort(holding=0,1,marketr);

    n:=1;

end

 

if time>=180000 and time<185900 and holding>0 and c<=enterprice*(1-0.05) then sell(1,0,marketr);

if time>=180000 and time<185900 and holding<0 and c>=enterprice*(1+0.05) then sellshort(1,0,marketr);

 

if time=190000 then begin

    sell(1,0,marketr);

    sellshort(1,0,marketr);

    n:=0;

end



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

客户服务部

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

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

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


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

测试的是什么品种?

当前的最后一根k线时间是15:00还是19:00?

[此贴子已经被作者于2016/1/27 15:26:41编辑过]


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

客户服务部

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

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

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


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

前面用户讲有夜盘,我就按照夜盘写了,希望用户测试时不要用股指去测试,这样会没有效果


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

客户服务部

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

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

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


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

variable:n=0;

if time>=140000 and time<145900 and h>ref(hhv(h,todaybar),1) and  holding=0 and n=0 then begin

    buy(holding=0,1,marketr);

    n:=1;

end

 

if time>=140000 and time<145900 and l<ref(llv(l,todaybar),1) and  holding=0 and n=0 then begin

    buyshort(holding=0,1,marketr);

    n:=1;

end

 

if time>=140000 and time<145900 and holding>0 and c<=enterprice*(1-0.05) then sell(1,0,marketr);

if time>=140000 and time<145900 and holding<0 and c>=enterprice*(1+0.05) then sellshort(1,0,marketr);

 

if time=150000 then begin

    sell(1,0,marketr);

    sellshort(1,0,marketr);

    n:=0;

end



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

客户服务部

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

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

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


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

variable:n=0;

if time>=140000 and time<145900 and h>ref(hhv(h,todaybar),1) and  holding=0 and n=0 then begin

    buy(holding=0,1,marketr);

    n:=1;

end

 

if time>=140000 and time<145900 and l<ref(llv(l,todaybar),1) and  holding=0 and n=0 then begin

    buyshort(holding=0,1,marketr);

    n:=1;

end

 

if time>=140000 and time<145900 and holding>0 and ((l<=enterprice*(1-0.05) and h>=enterprice*(1-0.05)) or (h<=enterprice*(1-0.05))) then sell(1,0,limitr,enterprice*(1-0.05)),IGNORECHECKPRICE;

if time>=140000 and time<145900 and holding<0 and ((h>=enterprice*(1+0.05) and l<=enterprice*(1+0.05)) or (l>=enterprice*(1+0.05)))then sellshort(1,0,limitr,enterprice*(1+0.05)),IGNORECHECKPRICE;

 

if time=150000 then begin

    sell(1,0,marketr);

    sellshort(1,0,marketr);

    n:=0;

end




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

客户服务部

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

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

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


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

发下单日志


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

客户服务部

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

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

 回到顶部