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


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

   

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


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

主题:老师,帮帮忙

帅哥哟,离线,有人找我吗?
么么
  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


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

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


 回到顶部
帅哥哟,离线,有人找我吗?
么么
  3楼 | 信息 | 搜索 | 邮箱 | 主页 | 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秒清仓,怎么写??

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

 


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

 



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


加好友 发短信
等级:论坛游民 帖子:270 积分:0 威望:0 精华:0 注册:2015/10/11 9:07:21
  发帖心情 Post By:2015/11/16 14:23:29    Post IP:124.152.32.98[显示全部帖子]

老师,你先看一下我这个平仓的写这对呢没有

GLOBALVARIABLE:num=0;

PK:=(TAVGENTERPRICEEX2('','',1)-DYNAINFO(7))*TSELLHOLDING(1)*DYNAINFO(209)>500;

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

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

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

if PK  and TSELLHOLDING(1)>0 and num=0 THEN begin

tsellshort(1,5,mkt);

num:=1;

end

 

PK2:=(TAVGENTERPRICEEX2('','',1)-DYNAINFO(7))*TSELLHOLDING(1)*DYNAINFO(209)>1000;

if PK2  and TSELLHOLDING(1)>0 and num=1 THEN begin

tsellshort(1,10,mkt);

num:=2;

end

 

PK3:=(TAVGENTERPRICEEX2('','',1)-DYNAINFO(7))*TSELLHOLDING(1)*DYNAINFO(209)>2000;

if PK3  and TSELLHOLDING(1)>0 THEN begin

tsellshort(1,TSELLHOLDING(1),mkt);

end


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


加好友 发短信
等级:论坛游民 帖子:270 积分:0 威望:0 精华:0 注册:2015/10/11 9:07:21
  发帖心情 Post By:2015/11/16 14:38:31    Post IP:124.152.32.98[显示全部帖子]

老师,出现这种情况怎么办呢??

variable:n1=0,n2=0,n3=0,n4=0,n5=0,n6=0,n7=0,n8=0;


variable:tt1=0,tt2=0,tt3=0,tt4=0,tt5=0,tt6=0,tt7=0,tt8=0;
oo:=VALUEWHEN(todaybar=1,o);
ma60:=ma(c,60);
 
if c<oo-2*DYNAINFO(208) and c<ma60 and n1=0 and time<>tt1 then begin
BUYSHORT(1,1,market);
n1:=1;
tt1:=time;
END
 

if c<oo-4*DYNAINFO(208) and c<ma60 and n2=0 and time<>tt2 then begin
BUYSHORT(1,2,market);
n2:=1;
tt1:=time;;
END
 
if c<oo-8*DYNAINFO(208) and c>ma60 and n3=0 and time<>tt3 then begin 
BUYSHORT(1,3,market);
n3:=1;
tt1:=time;
end

if c<oo-10*DYNAINFO(208) and c>ma60 and n4=0 and time<>tt4 then begin 
BUYSHORT(1,4,market);
n3:=1;
tt1:=time;
end

if c<oo-12*DYNAINFO(208) and c>ma60 and n5=0 and time<>tt5 then begin 
BUYSHORT(1,5,market);
n3:=1;
tt1:=time;
end

if c<oo-14*DYNAINFO(208) and c>ma60 and n6=0 and time<>tt6 then begin 
BUYSHORT(1,6,market);
n3:=1;
tt1:=time;
end
if c<oo-16*DYNAINFO(208) and c>ma60 and n7=0 and time<>tt7 then begin 
BUYSHORT(1,7,market);
n3:=1;
tt1:=time;
end

if c<oo-6*DYNAINFO(208) and c>ma60 and n8=0 and time<>tt8 then begin 
BUYSHORT(1,8,market);
n3:=1;
tt1:=time;
end

if time=closetime(0) then begin
n1:=0;
n2:=0;
n3:=0;
n4:=0;
n5:=0;
n6:=0;
n7:=0;
n8:=0;

tt1:=0;
tt2:=0;
tt3:=0;
tt4:=0;
tt5:=0;
tt6:=0;
tt7:=0;

tt8:=0;

end
GLOBALVARIABLE:num=0;
PK:=(TAVGENTERPRICEEX2('','',1)-DYNAINFO(7))*TSELLHOLDING(1)*DYNAINFO(209)>500;
debugfile('D:\test.txt','当前盈亏为%.2f',TOPENPROFIT);
盈亏:=(DYNAINFO(7)-TAVGENTERPRICEEX2('','',0))*TBUYHOLDING(1)*DYNAINFO(209);
debugfile('D:\test2.txt','当前盈亏为%.2f',盈亏);
if PK  and TSELLHOLDING(1)>0 and num=0 THEN begin
sellshort(1,5,market);
num:=1;
end

PK2:=(TAVGENTERPRICEEX2('','',1)-DYNAINFO(7))*TSELLHOLDING(1)*DYNAINFO(209)>1000;
if PK2  and TSELLHOLDING(1)>0 and num=1 THEN begin
sellshort(1,10,market);
num:=2;
end

PK3:=(TAVGENTERPRICEEX2('','',1)-DYNAINFO(7))*TSELLHOLDING(1)*DYNAINFO(209)>2000;
if PK3  and TSELLHOLDING(1)>0 THEN begin
sellshort(1,TSELLHOLDING(1),market);
end

图片点击可在新窗口打开查看此主题相关图片如下:捕获.png
图片点击可在新窗口打开查看


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


加好友 发短信
等级:论坛游民 帖子:270 积分:0 威望:0 精华:0 注册:2015/10/11 9:07:21
  发帖心情 Post By:2015/11/16 14:39:54    Post IP:124.152.32.98[显示全部帖子]

只限制1个点上只成交1次,开仓像阶梯性的那样,不是这个样子的????

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


加好友 发短信
等级:论坛游民 帖子:270 积分:0 威望:0 精华:0 注册:2015/10/11 9:07:21
  发帖心情 Post By:2015/11/16 15:07:00    Post IP:124.152.32.98[显示全部帖子]

我只是暂时调试一下,我知道的老师,老师,你帮忙限制一下,只成交1次的问题啊,谢谢老师,,,

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


加好友 发短信
等级:论坛游民 帖子:270 积分:0 威望:0 精华:0 注册:2015/10/11 9:07:21
  发帖心情 Post By:2015/11/16 15:09:35    Post IP:124.152.32.98[显示全部帖子]

variable:n1=0,n2=0,n3=0,n4=0,n5=0,n6=0,n7=0,n8=0;
variable:tt1=0,tt2=0,tt3=0,tt4=0,tt5=0,tt6=0,tt7=0,tt8=0;
oo:=VALUEWHEN(todaybar=1,o);
ma60:=ma(c,60);
 
if c<oo-2*DYNAINFO(208) and c<ma60 and n1=0 and time<>tt1 then begin
BUYSHORT(1,1,market);
n1:=1;
tt1:=time;
END
 

if c<oo-4*DYNAINFO(208) and c<ma60 and n2=0 and time<>tt2 then begin
BUYSHORT(1,2,market);
n2:=1;
tt1:=time;;
END
 
if c<oo-8*DYNAINFO(208) and c>ma60 and n3=0 and time<>tt3 then begin 
BUYSHORT(1,3,market);
n3:=1;
tt1:=time;
end

if c<oo-10*DYNAINFO(208) and c>ma60 and n4=0 and time<>tt4 then begin 
BUYSHORT(1,4,market);
n3:=1;
tt1:=time;
end

if c<oo-12*DYNAINFO(208) and c>ma60 and n5=0 and time<>tt5 then begin 
BUYSHORT(1,5,market);
n3:=1;
tt1:=time;
end

if c<oo-14*DYNAINFO(208) and c>ma60 and n6=0 and time<>tt6 then begin 
BUYSHORT(1,6,market);
n3:=1;
tt1:=time;
end
if c<oo-16*DYNAINFO(208) and c>ma60 and n7=0 and time<>tt7 then begin 
BUYSHORT(1,7,market);
n3:=1;
tt1:=time;
end

if c<oo-6*DYNAINFO(208) and c>ma60 and n8=0 and time<>tt8 then begin 
BUYSHORT(1,8,market);
n3:=1;
tt1:=time;
end

if time=closetime(0) then begin
n1:=0;
n2:=0;
n3:=0;
n4:=0;
n5:=0;
n6:=0;
n7:=0;
n8:=0;

tt1:=0;
tt2:=0;
tt3:=0;
tt4:=0;
tt5:=0;
tt6:=0;
tt7:=0;

tt8:=0;

end

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