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


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

   

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


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

主题:请问如何表达

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


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

平空仓之后: 平仓后最高价跌12点开空 或 平仓前与上次开仓后之间的最低点升12点开多

平多仓之后: 平仓后最低价升12点开空 或 平仓前与上次开仓后之间的最高点跌12点开空

1,第二行应该是开多吧,笔误还是本意就是开空?

2,这两句的或后面的内容无法实现,图表不支持锁仓,空仓平掉前不能开多。

[此贴子已经被作者于2014/8/4 17:20:17编辑过]

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


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

VARIABLE:n:=0,m:=0;
hh:=hhv(h,TODAYBAR);
if hh-l>=12 and n<1 THEN
begin
buyshort(holding=0,1,market);
n:=1;
end
ll:=llv(l,TODAYBAR);
if h-ll>=12 and m<1 THEN
begin
buy(holding=0,1,market);
m:=1;
end
//平空
l1:=llv(l,enterbars+1);
if h-l1>=6 or h-ENTERPRICE>=4 then sellshort(holding<0,1,market);
//平多
h1:=hhv(h,ENTERBARS+1);
if h1-l>=6 or ENTERPRICE-l>=4 THEN sell(holding>0,1,market);

h2:=hhv(h,exitbars+1);
if h2-l>=12 THEN buyshort(holding=0,1,market);
l3:=llv(l,enterbars+1);
if h>=l3+12 then buy(holding=0,1,market);
l2:=llv(l,EXITBARS+1);
if h-l2>=12 then buy(holding=0,1,market);
h3:=hhv(h,enterbars+1);
if h3-l>=12 then buyshort(holding=0,1,market);
//收盘赋值为0
if time=closetime(0) then
begin
n:=0;
m:=0;
end

[此贴子已经被作者于2014/8/5 10:43:53编辑过]

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


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

编写中请您耐心等待

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


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

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(1,1,market);
m:=1;
end

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

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

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

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


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


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

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 THEN sellshort(holding<0,1,market);

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

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

 

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

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

 

[此贴子已经被作者于2014/8/6 11:15:20编辑过]

 回到顶部
美女呀,离线,留言给我吧!
pyd
  6楼 | 信息 | 搜索 | 邮箱 | 主页 | 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[显示全部帖子]

代码是按照您描述的写的

 回到顶部
美女呀,离线,留言给我吧!
pyd
  7楼 | 信息 | 搜索 | 邮箱 | 主页 | 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[显示全部帖子]

实现不了

 回到顶部
美女呀,离线,留言给我吧!
pyd
  8楼 | 信息 | 搜索 | 邮箱 | 主页 | 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

 


 回到顶部
美女呀,离线,留言给我吧!
pyd
  9楼 | 信息 | 搜索 | 邮箱 | 主页 | 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);


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


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

那个只是你视觉上的第一个信号,实际上前边还有信号,你限制下图上其实时间更方便查看

k线图点击右键-》窗格属性-》指定开始时间,

然后灰色白条要拉到最左端


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

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