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


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

   

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


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

主题:老师帮忙模型的编写

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


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

VARIABLE:n=0,a=0;
VARIABLE:m=0,b=0;
l2:=valuewhen(c>o and ref(c>o,1),llv(l,2));
h2:=valuewhen(c<o and ref(c<o,1),hhv(h,2));
buycond:= time <101500 and n=0  and cross(c,ma(c,20));
sellcond:=time <101500 and m=0  and cross(ma(c,20),c);
if buycond then BEGIN
 buy(holding=0,1,market);
 n:=1;
 a:=h;
end

if ref(buycond,1) and holding>0 and c-enterprice<0 then sell(holding>0,0,market);

if enterbars>1 and enterprice-c>5*mindiff then sell(holding>0,0,market);

if h>a then a:=h;

if a-c>7*mindiff then sell(holding>0,0,limitr,l2);


if  sellcond then BEGIN
 buyshort(holding=0,1,market);
 m:=1;
 b:=l;
end

if ref(sellcond,1) and holding<0 and enterprice-c<0 then sellshort(holding<0,0,market);

if enterbars>1 and c-enterprice>5*mindiff then sellshort(holding<0,0,market);

if l<b then b:=l;

if close-b>7*mindiff then sellshort(holding>0,0,limitr,h2);

 

 

 

先写了前面的10点15的条件,14点45的条件和上面的类似,都是全局变量记录次数和记录最高最低价,楼主试着自己写一下



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

客户服务部

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

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

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


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

是的,加了条件就是不在当根k线执行


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

客户服务部

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

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

 回到顶部