大智慧主控战略K线主图指标公式

平顶:=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<ref(l,1));

drawtext(平底,l*0.99,'平底'),colorgreen;

partline(平底,l),colorgreen;

阳子母:=c>ref(max(c,o),1) and h>ref(h,1) and l<ref(l,1) and c>o and ref(max(c,o),1)/ref(min(c,o),1)>1.01 and (o<>l or c<>h);

drawtext(阳子母,l*0.99,'阳子母'),coloryellow;

阴子母:=c<ref(min(c,o),1) and h>ref(h,1) and l<ref(l,1) and c<o and ref(max(c,o),1)/ref(min(c,o),1)>1.01 and (o<>h or c<>l);

drawtext(阴子母,h*1.01,'阴子母'),colorblue;

阴母子:=c>ref(min(c,o),1) and h<ref(h,1) and l>ref(l,1) and c<o and c/o<0.99;

drawtext(阴母子,h*1.01,'阴母子'),colorblue;

阳母子:=c<ref(max(c,o),1) and h<ref(h,1) and l>ref(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<o and h>ref(h,1) and c>ref(o,1) and l>ref(l,1) and o>ref(h,1) and c<(ref(c,1)+ref(o,1))/2;

drawtext(乌云盖顶,h*1.01,'乌云盖顶'),colorblue;

曙光初现:=ref(o,1)/ref(c,1)>1.03 and c>o and h<ref(h,1) and c<ref(o,1) and l<ref(l,1) and o<ref(l,1) and c>(ref(c,1)+ref(o,1))/2;

drawtext(曙光初现,l*0.99,'曙光初现'),coloryellow;

空戳多:=c<ref(c,1) and ref(c,1)/ref(o,1)>1.03 and c<o and h>ref(h,1) and c>ref(o,1) and l>ref(l,1) and o>ref(h,1) and c>(ref(c,1)+ref(o,1))/2;

drawtext(空戳多,h*1.01,'空戳多'),colorblue;

多戳空:=c>ref(c,1) and ref(o,1)/ref(c,1)>1.03 and c>o and h<ref(h,1) and c<ref(o,1) and l<ref(l,1) and o<ref(l,1) and c<(ref(c,1)+ref(o,1))/2;

drawtext(多戳空,l*0.99,'多戳空'),coloryellow;

空头反攻:=c=ref(c,1) and ref(c,1)/ref(o,1)>1.03 and c<o and h>ref(h,1) and c>ref(o,1) and l>ref(l,1) and o>ref(h,1);

drawtext(空头反攻,h*1.01,'空头反攻'),colorblue;

多头反攻:=c=ref(c,1) and ref(o,1)/ref(c,1)>1.03 and c>o and h<ref(h,1) and c<ref(o,1) and l<ref(l,1) and o<ref(l,1);

drawtext(多头反攻,l*0.99,'多头反攻'),coloryellow;

玉柱:=c>ref(max(c,o),1) and h>ref(h,1) and l<ref(l,1) and c>o and ref(max(c,o),1)/ref(min(c,o),1)>1.01 and o=l and c=h;

drawtext(玉柱,l*0.99,'玉柱'),coloryellow;

危楼:=c<ref(min(c,o),1) and h>ref(h,1) and l<ref(l,1) and c<o and ref(max(c,o),1)/ref(min(c,o),1)>1.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<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(黑三兵,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/o<ref(c/o,2) and c/o<ref(c/o,1 and h/c>ref(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)<ref(o,2)) and o<ref(c,1) 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;

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(c,2) and o>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(c,3) and ref(max(c,o),1)<ref(c,3) and o>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<ref(min(c,o),1))

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<ref(min(c,o),1) and o<ref(min(c,o),2));

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 o<ref(o,1) and o>ref(c,1) and h<ref(h,1) and c<ref(c,2);

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<o and ref(c,1)<ref(o,1);

drawtext(双鸦耀空,h*1.01,'双鸦耀空'),colorblue;

上肩缺口:=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 h<ref(h,1) and o<ref(c,1) and l<ref(l,1) and c<ref(o,1) and o/c>1.02 and c>ref(h,2);

drawtext(上肩缺口,l*0.99,'上肩缺口'),coloryellow;

下肩缺口:=ref(l,1)=ref(llv(l,20),1) and count(ma(c,10)<ref(ma(c,10),1),13)>10 and ref(o/c,2)>1.03 and ref(o/c,1)>1 and ref(h,1)<ref(l,2) and l>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<ref(l,2);

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(o,2)>ref(c,3) and ref(h,1)<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 l>ref(o,3) and count(o/c>1.03,3)<2 and count(o/c>1.01,3)>1 and count(c<o,3)=3;

drawtext(上扬三法,l*0.99,'上扬三法'),coloryellow;

下跌三法:=ref(o/c,3)>1.03 and ref(l,2)<ref(l,3) and ref(c,2)>ref(c,3) and ref(o,2)<ref(c,3) and ref(h,1)>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 h<ref(o,3) and count(c/o>1.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<o,3),1)=3 and l<ref(l,1) and o<ref(c,1) and h>ref(hhv(h,3),1) and c>ref(hhv(c,3),1);

drawtext(宝塔翻白,l*0.99,'宝塔翻白'),coloryellow;

宝塔翻黑:=ref(count(c<ref(c,1),3),1)=0 and ref(count(c>o,3),1)=3 and h>ref(h,1) and o>ref(c,1) and l<ref(llv(l,3),1) and c<ref(hhv(o,3),1);

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)<ref(ma(c,13),1) and ref(count(hhv(c,10)/llv(o,10)<1.15,10),1)=10 and o/ref(min(c,o),1)<0.99 and c/ref(l,1)<0.95 and l=llv(l,15) and l/c<1.02;

drawtext(离白,h*1.01,'离白'),colorblue;