单边上涨/下跌
如何界定
最后一个条件没写出,回落不给个固定值写不出
zs:=callstock(stklabel,vtclose,6,-1);//昨收
jk:=valuewhen(todaybar=1,open);//今开
variable:n=0,m=0;
variable:x=0,y=0;
variable:cishu1=0,cishu2=0;
variable:biaoji=0;
if jk>zs+10*mindiff then buyshort(holding=0,1,market);
if close<zs-10*mindiff then sellshort(holding<0,1,market);
if jk<zs-10*mindiff then buy(holding=0,1,market);
if close>zs+10*mindiff then sell(holding>0,1,market);
if close>zs+10*mindiff then buyshort(holding=0,1,market);
if close<zs-10*mindiff then sellshort(holding<0,0,market);
if close<zs-10*mindiff then buy(holding=0,1,market);
if close>zs+10*mindiff then sell(holding>0,0,market);
if h>ref(hhv(h,todaybar),1) then n:=n+1;
nn1:=ref(barslast(h>ref(hhv(h,todaybar),1))+1,1);
if h>ref(hhv(h,todaybar),1) and llv(l,nn1)>zs then x:=1;
if n=3 and h>ref(hhv(h,todaybar),1) and x=1 and biaoji=0 then begin
buyshort(holding=0,1,market);
biaoji:=1;
n:=0;
x:=0;
end
if biaoji=1 and enterprice-c>15*mindiff then begin
sellshort(holding<0,0,market);
biaoji:=0;
end
if l<ref(llv(l,todaybar),1) then m:=m+1;
nn2:=ref(barslast(l>ref(llv(l,todaybar),1))+1,1);
if l<ref(llv(l,todaybar),1) and hhv(h,nn2)<zs then y:=1;
if m=3 and l<ref(llv(l,todaybar),1) and y=1 and biaoji=0 then begin
buy(holding=0,1,market);
biaoji:=1;
m:=0;
y:=0;
end
if biaoji:=1 and c-enterprice>15*mindiff then begin
sell(1,0,market);
biaoji:=0;
end
{7.单边上涨,连续4次创今日新高后并且创新高之间没有跌破昨日收盘价 开多。盈利20个点后,平多
8.反之单边下跌,连续4次创今日新低后并且创新低之间没有涨破昨日收盘价 开空。盈利20个点后,平空
单边上涨->一直未突破昨日的收盘价。 一直在昨日的收盘价之上。
如果创新高再回落(未突破昨日收盘价),连续4次这样的话,就开多。反之开空。}
dbsz:=llv(l,todaybar)>zs;
dbxd:=hhv(h,todaybar)<zs;
if dbsz and n=4 and x=0 then buy(holding=0,1,market);
if c-enterprice>20*mindiff then sell(holding>0,0,market);
if dbxd and m=4 and y=0 then buyshort(holding=0,1,market);
if enterprice-c>20*mindiff then sellshort(holding<0,0,market);
if c-enterprice>10*mindiff then sellshort(1,0,market);
if enterprice-c>10*mindiff then sell(1,0,market);