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


金字塔客服中心 - 专业程序化交易软件提供商金字塔软件公式模型编写问题提交 → 请问如何表达

   

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


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

主题:请问如何表达

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


加好友 发短信
等级:论坛游民 帖子:226 积分:0 威望:0 精华:0 注册:2014/8/4 16:49:30
  发帖心情 Post By:2014/8/6 9:49:38    Post IP:219.135.195.171[只看该作者]

谢谢!
但还是测试无效,还是同一K线开平,请帮忙再看一下
是条件逻辑有问题吗?

 回到顶部
美女呀,离线,留言给我吧!
pyd
  32楼 | 信息 | 搜索 | 邮箱 | 主页 | UC


加好友 发短信
等级:超级版主 帖子:8439 积分:0 威望:0 精华:0 注册:2014/7/14 13:43:36
  发帖心情 Post By:2014/8/6 10:11:33    Post IP:58.246.57.26[只看该作者]

代码是按照您描述的写的

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


加好友 发短信
等级:论坛游民 帖子:226 积分:0 威望:0 精华:0 注册:2014/8/4 16:49:30
  发帖心情 Post By:2014/8/6 10:23:00    Post IP:219.135.195.171[只看该作者]

那是条件逻辑有问题吗?
但好像看不出什么问题

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


加好友 发短信
等级:论坛游民 帖子:226 积分:0 威望:0 精华:0 注册:2014/8/4 16:49:30
  发帖心情 Post By:2014/8/6 10:34:09    Post IP:219.135.195.171[只看该作者]

能看看当中有什么问题吗?谢谢

 回到顶部
美女呀,离线,留言给我吧!
pyd
  35楼 | 信息 | 搜索 | 邮箱 | 主页 | UC


加好友 发短信
等级:超级版主 帖子:8439 积分:0 威望:0 精华:0 注册:2014/7/14 13:43:36
  发帖心情 Post By:2014/8/6 11:01:11    Post IP:58.246.57.26[只看该作者]

实现不了

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


加好友 发短信
等级:论坛游民 帖子:226 积分:0 威望:0 精华:0 注册:2014/8/4 16:49:30
  发帖心情 Post By:2014/8/6 11:09:29    Post IP:219.135.195.171[只看该作者]

那一部分有问题?


 回到顶部
美女呀,离线,留言给我吧!
pyd
  37楼 | 信息 | 搜索 | 邮箱 | 主页 | UC


加好友 发短信
等级:超级版主 帖子:8439 积分:0 威望:0 精华:0 注册:2014/7/14 13:43:36
  发帖心情 Post By:2014/8/6 12:03:53    Post IP:58.246.57.26[只看该作者]

你的平仓条件当根就满足了,所以会出现当根开平仓。

不要当根开平?加上enterbars>1 和exitbars>1的限制

VARIABLE:n:=0,m:=0;
h1:=hhv(h,TODAYBAR);
if h1-l>=12 and n=0 THEN
BEGIN
buyshort(holding=0,1,market);
n:=1;
end
ll1:=llv(l,todaybar);
if h-ll1>=12 and m=0 then
begin
buy(holding=0,1,market);
m:=1;
end

l1:=llv(l,enterbars+1);
if h-l1>=6 or h-ENTERPRICE>=4 and ENTERBARS>1 THEN sellshort(holding<0,1,market);

if h-l1>=12 and exitbars>1 THEN buy(holding=0,1,market);
h2:=hhv(h,exitbars+1);
if h2-l>=12 and exitbars>1 then buyshort(holding=0,1,market);

l2:=llv(l,exitbars+1);
if l2<l1 and h2-l2<=12 and h-l2>=12 and exitbars>1 then buy(holding=0,1,market);

 

hh1:=hhv(h,enterbars+1);
if hh1-l>=6 or enterprice-l>=4 and enterbars>1 then sell(holding>0,1,market);
if hh1-l>=12 and exitbars>1 then buyshort(holding=0,1,market);
ll2:=llv(l,exitbars+1);
if h-ll2>=12 and exitbars>1 then buy(holding=0,1,market);
hh2:=hhv(h,exitbars+1);
if hh2>hh1 and hh2<=ll2+12 and l<=hh2-12 and exitbars>1 then buyshort(holding=0,1,market);

if time=closetime(0) then begin
n:=0;
m:=0;
end

 


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


加好友 发短信
等级:论坛游民 帖子:226 积分:0 威望:0 精华:0 注册:2014/8/4 16:49:30
  发帖心情 Post By:2014/8/6 14:51:47    Post IP:219.135.195.171[只看该作者]

  还是单K开平?

VARIABLE:n:=0,m:=0;
TT:=time<=145500;

H1:=hhv(h, todaybar);

if h1-L>=12 and n=0 THEN
begin
buyshort(holding=0,1,market);
n:=1;
end

L1:=llv(L,todaybar);
if h-L1>=12 and m=0 then // L1升12点
begin
buy(holding=0,1,market);
m:=1;
end


 

L2:=LLv(L,enterbars+1);
if H-L2>=6 or H-enterprice >=4 and enterbars >1 then sellshort(holding<0,1,market);

H2:=hhv(h,exitbars);
if H2-L>=12 and TT and exitbars>1 then buyshort(holding=0,1,market);

if H-L2>=12 and TT and exitbars>1 then buy(holding=0,1,market);

L3:=LLv(L,exitbars+1);
if L3<=L2 and H2-L3<12 and H-L3>=12 and TT and exitbars>1 then buy(holding=0,1,market);


 

HH2:=hhv(h,enterbars+1);
if HH2-L>=6 or enterprice-L>=4 and enterbars >1 then sell(holding>0,1,market);

LL2:=llv(L,exitbars+1);
if h-LL2>=12 and TT and exitbars>1 then buy(holding=0,1,market);

if HH2-L>=12 and TT and exitbars>1 then buyshort(holding=0,1,market);

HH3:=hhv(h,exitbars+1);
if HH3>=HH2 and HH3<LL2+12 and L<=HH3-12 and TT and exitbars>1 then buyshort(holding=0,1,market);

if time=closetime(0) then begin/
n:=0;
m:=0;
end


 

sell(time>150000 and holding>0, 0, market);

sellshort(time>150000 and holding<0, 0, market);


 回到顶部
美女呀,离线,留言给我吧!
pyd
  39楼 | 信息 | 搜索 | 邮箱 | 主页 | UC


加好友 发短信
等级:超级版主 帖子:8439 积分:0 威望:0 精华:0 注册:2014/7/14 13:43:36
  发帖心情 Post By:2014/8/6 15:04:08    Post IP:58.246.57.26[只看该作者]

可以了,刚才少了括号

VARIABLE:n:=0,m:=0;
TT:=time<=145500;

H1:=hhv(h, todaybar);

if h1-L>=12 and n=0 THEN
begin
buyshort(holding=0,1,market);
n:=1;
end

L1:=llv(L,todaybar);
if h-L1>=12 and m=0 then // L1升12点
begin
buy(holding=0,1,market);
m:=1;
end


 

L2:=LLv(L,enterbars+1);
if (H-L2>=6 or H-enterprice >=4) and enterbars >1 then sellshort(holding<0,1,market);

H2:=hhv(h,exitbars);
if H2-L>=12 and TT and exitbars>1 then buyshort(holding=0,1,market);

if H-L2>=12 and TT and exitbars>1 then buy(holding=0,1,market);

L3:=LLv(L,exitbars+1);
if L3<=L2 and H2-L3<12 and H-L3>=12 and TT and exitbars>1 then buy(holding=0,1,market);


 

HH2:=hhv(h,enterbars+1);
if (HH2-L>=6 or enterprice-L>=4) and enterbars >1 then sell(holding>0,1,market);

LL2:=llv(L,exitbars+1);
if h-LL2>=12 and TT and exitbars>1 then buy(holding=0,1,market);

if HH2-L>=12 and TT and exitbars>1 then buyshort(holding=0,1,market);

HH3:=hhv(h,exitbars+1);
if HH3>=HH2 and HH3<LL2+12 and L<=HH3-12 and TT and exitbars>1 then buyshort(holding=0,1,market);

if time=closetime(0) then begin
n:=0;
m:=0;
end


 

sell(time>150000 and holding>0, 0, market);

sellshort(time>150000 and holding<0, 0, market);


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


加好友 发短信
等级:论坛游民 帖子:226 积分:0 威望:0 精华:0 注册:2014/8/4 16:49:30
  发帖心情 Post By:2014/8/6 15:20:10    Post IP:219.135.195.171[只看该作者]

非常感谢,没有单K开平了

但测试结果与开平条件不符合


 回到顶部
总数 95 上一页 1 2 3 4 5 6 7 8 9 10 下一页