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


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

   

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


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

主题:老师,帮帮忙

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


加好友 发短信
等级:论坛游民 帖子:270 积分:0 威望:0 精华:0 注册:2015/10/11 9:07:21
老师,帮帮忙  发帖心情 Post By:2015/11/16 9:13:04    Post IP:124.152.32.98[只看该作者]

在开盘价上方设置5条线,每条线间隔5个单位,开盘时,在开盘价and60日均线处买开1手,上去盈利3个点平仓,返回来来时,则在第1次开仓的地方重新买开1手,如果没有被平仓,在这个地方则不在买入,如果上去盈利3个点平仓后继续往上走,则在第2条线上买开1手,平仓后到第2条线中间不在开仓,后面继续重复以上操作

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 then begin 
buy(1,1,market);
end
if c>oo+10 and c>ma60 then begin 
buy(1,1,market);
end

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

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

if c>oo+25 and c>ma60 then begin 
buy(1,1,market);
end


就会这么点,老师,麻烦了,谢谢老师

 回到顶部
帅哥哟,离线,有人找我吗?
jinzhe
  2楼 | 信息 | 搜索 | 邮箱 | 主页 | 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

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


加好友 发短信
等级:论坛游民 帖子:270 积分:0 威望:0 精华:0 注册:2015/10/11 9:07:21
  发帖心情 Post By:2015/11/16 9:52:47    Post IP:124.152.32.98[只看该作者]

如果开空,则就是;
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 
buyshort(1,1,market);
end
if c<oo-10 and c<ma60 and holding=0 then begin 
buyshort(1,1,market);
end

if c<oo-15 and c<ma60 and holding=0 then begin 
buyshort(1,1,market);
end

if c<oo-20 and c<ma60 and holding=0 then begin 
buyshort(1,1,market);
end

if c<oo-25 and c<ma60 and  holding=0 then begin 
buyshort(1,1,market);
end
 
if c<enterprice-3  then sellshort(1,0,market);


 回到顶部
帅哥哟,离线,有人找我吗?
jinzhe
  4楼 | 信息 | 搜索 | 邮箱 | 主页 | 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

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


加好友 发短信
等级:论坛游民 帖子:270 积分:0 威望:0 精华:0 注册:2015/10/11 9:07:21
  发帖心情 Post By:2015/11/16 13:20:00    Post IP:124.152.32.98[只看该作者]

那老师,如果加1个条件每天3点钟之前30秒清仓,怎么写??

 回到顶部
帅哥哟,离线,有人找我吗?
jinzhe
  6楼 | 信息 | 搜索 | 邮箱 | 主页 | 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

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


加好友 发短信
等级:论坛游民 帖子:270 积分:0 威望:0 精华:0 注册:2015/10/11 9:07:21
  发帖心情 Post By:2015/11/16 14:09:42    Post IP:124.152.32.98[只看该作者]

老师,你看一下,我的这个命令怎么在同一价位成交了2次

GLOBALVARIABLE:n1=0,n2=0,n3=0;

GLOBALVARIABLE:tt1=0,tt2=0,tt3=0;

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

ma60:=ma(c,60);

 

if c>oo+1*mindiff and c>ma60 and n1=0 and time<>tt1  then begin

tbuy(1,1,mkt);

n1:=1;

tt1:=time;

end

 

if c>oo+2*mindiff and c>ma60 and n2=0 and time<>tt2 then begin

tbuy(1,2,mkt);

n2:=1;

tt2=TIME;

END

 

if c>oo+3*mindiff and c>ma60 and n3=0 and time<>tt3 then begin

tbuy(1,3,mkt);

n3:=1;

tt3=time;

end

if time=closetime(0) then begin

n1:=0;

n2:=0;

n3:=0;

tt1:=0;

tt2:=0;

tt3:=0;

end

 


 回到顶部
帅哥哟,离线,有人找我吗?
jinzhe
  8楼 | 信息 | 搜索 | 邮箱 | 主页 | 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

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


加好友 发短信
等级:论坛游民 帖子:270 积分:0 威望:0 精华:0 注册:2015/10/11 9:07:21
  发帖心情 Post By:2015/11/16 14:14:58    Post IP:124.152.32.98[只看该作者]

不是,我写的达到条件后一个命名只成交1次,为什么它执行了2次,还有,平仓的时候亏着平仓呢,

GLOBALVARIABLE:num=0;

PD:=(DYNAINFO(7)-TAVGENTERPRICEEX2('','',0))*TBUYHOLDING(1)*DYNAINFO(209)>500;

debugfile('D:\test.txt','当前盈亏为%.2f',TOPENPROFIT);

盈亏:=(DYNAINFO(7)-TAVGENTERPRICEEX2('','',0))*TBUYHOLDING(1)*DYNAINFO(209);

debugfile('D:\test2.txt','当前盈亏为%.2f',盈亏);

if PD  and tbuyholding(1)>0 and num=0 THEN begin

tsell(1,5,mkt);

num:=1;

end

PD2:=(DYNAINFO(7)-TAVGENTERPRICEEX2('','',0))*TBUYHOLDING(1)*DYNAINFO(209)>1000;

if PD2  and tbuyholding(1)>0 and num=1 THEN begin

tsell(1,10,mkt);

num:=2;

end

 

PD3:=(DYNAINFO(7)-TAVGENTERPRICEEX2('','',0))*TBUYHOLDING(1)*DYNAINFO(209)>2000;

if PD3  and tbuyholding(1)>0 THEN begin

tsell(1,TbuyHOLDING(1),mkt);

end

 



 回到顶部
帅哥哟,离线,有人找我吗?
jinzhe
  10楼 | 信息 | 搜索 | 邮箱 | 主页 | 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

 回到顶部
总数 19 1 2 下一页