平顶:=h=ref(h,1) or (h=ref(h,2) and h>ref(h,1));
drawtext(平顶,h*1.01,'平顶'),colorgreen;
partline(平顶,h),colorgreen;
平底:=l=ref(l,1) or (l=ref(l,2) and l
drawtext(平底,l*0.99,'平底'),colorgreen;
partline(平底,l),colorgreen;
阳子母:=c>ref(max(c,o),1) and h>ref(h,1) and lo and ref(max(c,o),1)/ref(min(c,o),1)>1.01 and (o<>l or c<>h);
drawtext(阳子母,l*0.99,'阳子母'),coloryellow;
阴子母:=cref(h,1) and l1.01 and (o<>h or c<>l);
drawtext(阴子母,h*1.01,'阴子母'),colorblue;
阴母子:=c>ref(min(c,o),1) and href(l,1) and c
阳母子:=cref(l,1) and c>o and c/o>1.01;
drawtext(阳母子,l*0.99,'阳母子'),coloryellow;
乌云盖顶:=ref(c,1)/ref(o,1)>1.03 and c
drawtext(乌云盖顶,h*1.01,'乌云盖顶'),colorblue;
曙光初现:=ref(o,1)/ref(c,1)>1.03 and c>o and h(ref(c,1)+ref(o,1))/2;
drawtext(曙光初现,l*0.99,'曙光初现'),coloryellow;
空戳多:=c1.03 and c
drawtext(空戳多,h*1.01,'空戳多'),colorblue;
多戳空:=c>ref(c,1) and ref(o,1)/ref(c,1)>1.03 and c>o and h
drawtext(多戳空,l*0.99,'多戳空'),coloryellow;
空头反攻:=c=ref(c,1) and ref(c,1)/ref(o,1)>1.03 and c
drawtext(空头反攻,h*1.01,'空头反攻'),colorblue;
多头反攻:=c=ref(c,1) and ref(o,1)/ref(c,1)>1.03 and c>o and h
drawtext(多头反攻,l*0.99,'多头反攻'),coloryellow;
玉柱:=c>ref(max(c,o),1) and h>ref(h,1) and lo and ref(max(c,o),1)/ref(min(c,o),1)>1.01 and o=l and c=h;
drawtext(玉柱,l*0.99,'玉柱'),coloryellow;
危楼:=cref(h,1) and l1.01 and o=h and c=l;
drawtext(危楼,h*1.01,'危楼'),colorblue;
{3根k线组合}
红三兵:=count(h/c<1.02,3)=3 and count(c/o>1.01,3)=3 and count(c>ref(c,1),2)=2 and count(h>ref(h,1),2)=2 and count(l>ref(l,1),2)=2 and abs(ref(c,2)/ref(o,2)-ref(c,1)/ref(o,1))<0.02 and abs(ref(c,1)/ref(o,1)-c/o)<0.02;
drawtext(红三兵,l*0.99,'红三兵'),coloryellow;
黑三兵:=count(c/l<1.02,3)=3 and count(o/c>1.01,3)=3 and count(c
drawtext(黑三兵,h*1.01,'黑三兵'),colorblue;
大敌当前:=count(c/o<1.03,2)=2 and count(h/c>1.015,2)=2 and count(c>o,3)=3 and count(c>ref(c,1),2)=2 and count(h>ref(h,1),2)=2 and count(l>ref(l,1),2)=2 and ref(c,2)/ref(o,2)>1.03 and ref(c,2)/ref(o,2)>ref(c,1)/ref(o,1) and ref(c,2)/ref(o,2)>c/o and h/c>ref(h/c,2) and ref(h/c,1)>ref(h/c,2);
drawtext(大敌当前,l*0.99,'大敌当前'),colorblue;
步步为营:=count(c>o,3)=3 and count(c>ref(c,1),2)=2 and count(h>ref(h,1),2)=2 and count(l>ref(l,1),2)=2 and (ref(c/o,2)>1.03 or ref(c/o,1)>1.03) and c/oref(h/c,2) and h/c>ref(h/c,1)) and h/c>1.02;
drawtext(步步为营,l*0.99,'步步为营'),colorblue;
离黑战车:=ref(c/o,2)>1.01 and ref(o/c,1)>1.01 and c/o>1.01 and ref(h/c,2)<1.02 and ref(h/o,1)<1.02 and h/c<1.02 and ref(o,1)>ref(c,2) and c>ref(o,1) and count(h>ref(h,1),2)=2 and count(l>ref(l,1),2)=2 and abs(ref(c/o,2)-ref(o/c,1))<0.02 and abs(ref(o/c,1)-c/o)<0.02 and ref(c,1)>ref(o,2);
drawtext(离黑战车,l*0.99,'离黑战车'),coloryellow;
离白战车:=ref(o/c,2)>1.01 and ref(c/o,1)>1.01 and o/c>1.01 and ref(h/o,2)<1.02 and ref(h/c,1)<1.02 and h/o<1.02 and (ref(c,1)=ref(o,2) or ref(c,1)
drawtext(离白战车,h*1.01,'离白战车'),colorblue;
晨星:=(ref(c/o,2)<0.97 and abs(ref(c/o,1)-1)<0.015 and c/o>1.025 and ref(max(c,o),1)ref(max(c,o),1))
or (ref(c/o,3)<0.97 and abs(ref(c/o,1)-1)<0.02 and abs(ref(c/o,2)-1)<0.02 and c/o>1.025 and ref(max(c,o),2)ref(max(c,o),1) and o>ref(max(c,o),2));
drawtext(晨星,l*0.99,'晨星'),coloryellow;
夜星:=(ref(o/c,2)<0.97 and abs(ref(c/o,1)-1)<0.015 and o/c>1.025 and ref(min(c,o),1)>ref(c,2) and o
or (ref(o/c,3)<0.97 and abs(ref(c/o,1)-1)<0.02 and abs(ref(c/o,2)-1)<0.02 and o/c>1.025 and ref(min(c,o),2)>ref(c,3) and ref(min(c,o),1)>ref(c,3) and o
drawtext(夜星,h*1.01,'夜星'),colorblue;
双鸦:=ref(c/o,2)>1.03 and ref(o/c,1)-1<0.015 and ref(c,1)>ref(c,2) and ref(o,1)>ref(c,2) and o/c>1.025 and oref(c,1) and h
drawtext(双鸦,h*1.01,'双鸦'),colorblue;
双鸦耀空:=ref(c/o,2)>1.03 and ref(o/c,1)<1.015 and o/c<1.015 and ref(c,1)>ref(c,2) and c>ref(c,2) and c
上肩缺口:=ref(h,1)=ref(hhv(h,20),1) and count(ma(c,10)>ref(ma(c,10),1),13)>10 and ref(c/o,2)>1.03 and ref(c/o,1)>1.02 and ref(l,1)>ref(h,2) and h1.02 and c>ref(h,2);
drawtext(上肩缺口,l*0.99,'上肩缺口'),coloryellow;
下肩缺口:=ref(l,1)=ref(llv(l,20),1) and count(ma(c,10)10 and ref(o/c,2)>1.03 and ref(o/c,1)>1 and ref(h,1)ref(l,1) and c>ref(o,1) and h>ref(h,1) and o>ref(c,1) and c/o>1.02 and c
drawtext(下肩缺口,h*1.01,'下肩缺口'),colorblue;
{4根k线组合}
上扬三法:=ref(c/o,3)>1.03 and ref(h,2)>ref(h,3) and ref(c,2)ref(c,3) and ref(h,1)ref(o,3) and count(o/c>1.03,3)<2 and count(o/c>1.01,3)>1 and count(c
下跌三法:=ref(o/c,3)>1.03 and ref(l,2)ref(c,3) and ref(o,2)ref(h,2) and ref(l,1)>ref(l,2) and h>ref(h,1) and l>ref(l,1) and ref(c,1)>ref(c,2) and c>ref(c,1) and h1.03,3)<2 and count(c/o>1.01,3)>1 and count(c>o,3)=3;
drawtext(下跌三法,h*1.01,'下跌三法'),colorblue;
宝塔翻白:=ref(count(c>ref(c,1),3),1)=0 and ref(count(c
drawtext(宝塔翻白,l*0.99,'宝塔翻白'),coloryellow;
宝塔翻黑:=ref(count(co,3),1)=3 and h>ref(h,1) and o>ref(c,1) and l
drawtext(宝塔翻黑,h*1.01,'宝塔翻黑'),colorblue;
{多根k线组合}
离黑:=ma(c,13)>ref(ma(c,13),1) and ref(count(hhv(c,10)/llv(o,10)<1.15,10),1)=10 and o/ref(max(c,o),1)>1.01 and c/ref(h,1)>1.05 and h=hhv(h,15) and h/c<1.02;
drawtext(离黑,l*0.99,'离黑'),coloryellow;
离白:=ma(c,13)
drawtext(离白,h*1.01,'离白'),colorblue;