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


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

   

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


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

主题:请问如何表达

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


加好友 发短信
等级:超级版主 帖子:8439 积分:0 威望:0 精华:0 注册:2014/7/14 13:43:36
  发帖心情 Post By:2014/8/7 14:35:26    Post IP:58.246.57.26[显示全部帖子]

TT:=date=currentdate and time<=145500;

测试历史情况把TT里的红字部分去掉

[此贴子已经被作者于2014/8/7 14:10:28编辑过]


 


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


加好友 发短信
等级:超级版主 帖子:8439 积分:0 威望:0 精华:0 注册:2014/7/14 13:43:36
  发帖心情 Post By:2014/8/7 14:54:21    Post IP:58.246.57.26[显示全部帖子]

去掉红字,补充历史数据测试没有问题的


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

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


加好友 发短信
等级:超级版主 帖子:8439 积分:0 威望:0 精华:0 注册:2014/7/14 13:43:36
  发帖心情 Post By:2014/8/7 15:31:23    Post IP:58.246.57.26[显示全部帖子]

是的

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


加好友 发短信
等级:超级版主 帖子:8439 积分:0 威望:0 精华:0 注册:2014/7/14 13:43:36
  发帖心情 Post By:2014/8/7 15:42:38    Post IP:58.246.57.26[显示全部帖子]

那么就一天一天的测,不是可以选择测试时间段吗

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


加好友 发短信
等级:超级版主 帖子:8439 积分:0 威望:0 精华:0 注册:2014/7/14 13:43:36
  发帖心情 Post By:2014/8/7 16:41:27    Post IP:58.246.57.26[显示全部帖子]

用下边这个,测试和交易通用

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

H1:=hhv(h, todaybar);
if h1-L>=12 and n=0 and TT THEN
begin
buyshort(holding=0,1,market);
n:=1;
en:=enterbars;
end

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


 

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

H2:=hhv(h,ex+1);
if H2-L>=12 and TT and ex>1 then
BEGIN
 buyshort(holding=0,1,market);
en:=enterbars;
end

if H-L2>=12 and TT and ex>1 then
begin
buy(holding=0,1,market);
en:=enterbars;
end

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

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

LL2:=llv(L,ex+1);
if h-LL2>=12 and TT and ex>1 then
begin
 buy(holding=0,1,market);
 en:=enterbars;
 end

if HH2-L>=12 and TT and ex>1 then
begin
buyshort(holding=0,1,market);
en:=enterbars;
end

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

if time>150000 THEN
begin
sell(holding>0, 0, market);
sellshort(holding<0, 0, market);
ex:=exitbars;
end

if time=closeTIME(0) then
begin
n:=0;
m:=0;
en:=0;
ex:=0;
end

 


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


加好友 发短信
等级:超级版主 帖子:8439 积分:0 威望:0 精华:0 注册:2014/7/14 13:43:36
  发帖心情 Post By:2014/8/8 9:13:26    Post IP:58.246.57.26[显示全部帖子]

你说的不让当根平仓,所以平仓前都加了enterbars的限制导致没有当根止损。

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


加好友 发短信
等级:超级版主 帖子:8439 积分:0 威望:0 精华:0 注册:2014/7/14 13:43:36
  发帖心情 Post By:2014/8/8 9:40:42    Post IP:58.246.57.26[显示全部帖子]

哪个品种,哪个周期,几月几日的信号?
[此贴子已经被作者于2014/8/8 9:40:47编辑过]

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


加好友 发短信
等级:超级版主 帖子:8439 积分:0 威望:0 精华:0 注册:2014/7/14 13:43:36
  发帖心情 Post By:2014/8/8 10:04:23    Post IP:58.246.57.26[显示全部帖子]

稍微改了下

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

H1:=hhv(h, todaybar);
if h1-L>=12 and n=0 and TT and holding=0 THEN
begin
buyshort(1,1,market);
n:=1;
en:=enterbars;
end

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


 

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

H2:=hhv(h,ex+1);
if H2-L>=12 and TT and ex>1 and holding=0 then
BEGIN
 buyshort(1,1,market);
en:=enterbars;
end

if H-L2>=12 and TT and ex>1 and holding=0 then
begin
buy(1,1,market);
en:=enterbars;
end

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

HH2:=hhv(h,en+1);

if (HH2-L>=6 or enterprice-L>=4) and en >1 and holding>0 then
begin
sell(1,1,market);
ex:=exitbars;
end

LL2:=llv(L,ex+1);
if h-LL2>=12 and TT and ex>1 and holding=0 then
begin
 buy(1,1,market);
 en:=enterbars;
 end

if HH2-L>=12 and TT and ex>1 and holding=0 then
begin
buyshort(1,1,market);
en:=enterbars;
end

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

if time>150000 and holding>0 THEN
begin
sell(1, 0, market);
ex:=exitbars;
end

if time>150000 and holding<0 THEN
begin
sellshort(1, 0, market);
ex:=exitbars;
end


if time=closeTIME(0) then
begin
n:=0;
m:=0;
en:=0;
ex:=0;
end


 

[此贴子已经被作者于2014/8/8 10:04:42编辑过]

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


加好友 发短信
等级:超级版主 帖子:8439 积分:0 威望:0 精华:0 注册:2014/7/14 13:43:36
  发帖心情 Post By:2014/8/8 11:14:24    Post IP:58.246.57.26[显示全部帖子]

之前的用全局变量有问题,改后

VARIABLE:n:=0,m:=0;

TT:=time<=145500;

H1:=hhv(h, todaybar);
afd:h1-L>=12 and n=0 and holding=0;
if h1-L>=12 and n=0 and holding=0 THEN
begin
buyshort(1,1,market);
n:=1;
end
L1:=llv(L,todaybar);
if h-L1>=12 and m=0 and holding=0 then
begin
buy(1,1,market);
m:=1;
end

b1:=min(enterbars+1,TODAYBAR);
L2:=LLv(L,b1);
if (H-L2>=6 or H-enterprice >=4) and enterbars >1 then sellshort(holding<0,1,market);
b2:=min(exitbars+1,todaybar);
H2:=hhv(h,b2);

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,b2);
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,b1);

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

LL2:=llv(L,b2);

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,b2);

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

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

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


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


加好友 发短信
等级:超级版主 帖子:8439 积分:0 威望:0 精华:0 注册:2014/7/14 13:43:36
  发帖心情 Post By:2014/8/8 13:30:22    Post IP:58.246.57.26[显示全部帖子]

平多仓之后的最低价(C1点)升12点开多 或者 平多仓之前与上次开仓后之间的最高点(B1点)跌12点开空 或者 平多仓之后的最高。。。。。

是红字部分开的空,对应的代码是if HH2-L>=12 and TT and exitbars>1 then buyshort(holding=0,1,market);
这个图上输出是满足条件开空。


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

 回到顶部
总数 33 上一页 1 2 3 4 下一页