以下是大智慧新一代和飞狐的缺口公式,和通达信软件自带的缺口提示相比,缺点在于达信软件自带的提示了主图界面范围内的未封闭的缺口,而它们提示了历史上未封闭的缺口,由于缺口历史价咯的问题,导致部分股票的主图K线被上下挤压.这个望能者进行优化为只提示主图界面范围内的未封闭的缺口.
大智慧新一代:
d:=BACKSET(BARSTATUS=2,BARSLAST(llv(l,0)=l)+1);
LS:=if(BARSTATUS=2,llv(l,250),9999);;
d1:=BACKSET(BARSTATUS=2,BARSLAST(llv(l,250)=l or BARPOS=1));
LD:=llVALL(LS);
qkg:=(l>ref(h,1))*d;;
gqk:=if(d=1 and qkg*ref(h,1)<LD,qkg,if(d1,qkg,0));
gqks:=sum(gqk,0);
g:=BACKSET(BARSTATUS=2,BARSLAST(hhv(h,0)=h)+1);
hS:=hhv(h,250);
g1:=BACKSET(BARSTATUS=2,BARSLAST(hS=h)+1);
HG:=HHVALL(g1*hS);
qkd:=(H<ref(L,1))*g;
dqk:=if(g=1 and qkd*ref(l,1)>HG,qkd,if(g1,qkd,0));
dqks:=sum(dqk,0);
qkZ:=l>ref(h,1) or h<ref(l,1);
QKS1:=SUM(QKZ,0);
qks:=gqks+dqks;
qklx:=if(h<ref(l,1),1,if(l>ref(h,1),2,0));
s:=HHVALL(qks)+1;
ds:s-qks,LINETHICK0;
ll:=L;
hh:=h;
t1:=BARSSINCE(dS=1)+1;
l1:=ref(l,T1);
h1:=ref(H,t1);
s1:=Any(H1>=ll,t1);
x1:=Any(l1<=hh,t1);
t2:=BARSSINCE(dS=2)+1;
l2:=ref(l,T2);
h2:=ref(H,t2);
s2:=Any(H2>=ll,t2);
x2:=Any(l2<=hh,t2);
t3:=BARSSINCE(dS=3)+1;
l3:=ref(l,T3);
h3:=ref(H,t3);
s3:=Any(H3>=ll,t3);
x3:=Any(l3<=hh,t3);
t4:=BARSSINCE(dS=4)+1;
l4:=ref(l,T4);
h4:=ref(H,t4);
s4:=Any(H4>=ll,t4);
x4:=Any(l4<=hh,t4);
t5:=BARSSINCE(dS=5)+1;
l5:=ref(l,T5);
h5:=ref(H,t5);
s5:=Any(H5>=ll,t5);
x5:=Any(l5<=hh,t5);
t6:=BARSSINCE(dS=6)+1;
l6:=ref(l,T6);
h6:=ref(H,t6);
s6:=Any(H6>=ll,t6);
x6:=Any(l6<=hh,t6);
t7:=BARSSINCE(dS=7)+1;
l7:=ref(l,T7);
h7:=ref(H,t7);
s7:=Any(H7>=ll,t7);
x7:=Any(l7<=hh,t7);
t8:=BARSSINCE(dS=8)+1;
l8:=ref(l,T8);
h8:=ref(H,t8);
s8:=Any(H8>=ll,t8);
x8:=Any(l8<=hh,t8);
t9:=BARSSINCE(dS=9)+1;
l9:=ref(l,T9);
h9:=ref(H,t9);
s9:=Any(H9>=ll,t9);
x9:=Any(l9<=hh,t9);
t10:=BARSSINCE(dS=10)+1;
l10:=ref(l,T10);
h10:=ref(H,t10);
s10:=Any(H10>=ll,t10);
x10:=Any(l10<=hh,t10);
t11:=BARSSINCE(dS=11)+1;
l11:=ref(l,T11);
h11:=ref(H,t11);
s11:=Any(H11>=ll,t11);
x11:=Any(l11<=hh,t11);
t12:=BARSSINCE(dS=12)+1;
l12:=ref(l,T12);
h12:=ref(H,t12);
s12:=Any(H12>=ll,t12);
x12:=Any(l12<=hh,t12);
t13:=BARSSINCE(dS=13)+1;
l13:=ref(l,T13);
h13:=ref(H,t13);
s13:=Any(H13>=ll,t13);
x13:=Any(l13<=hh,t13);
t14:=BARSSINCE(dS=14)+1;
l14:=ref(l,T14);
h14:=ref(H,t14);
s14:=Any(H14>=ll,t14);
x14:=Any(l14<=hh,t14);
t15:=BARSSINCE(dS=15)+1;
l15:=ref(l,T15);
h15:=ref(H,t15);
s15:=Any(H15>=ll,t15);
x15:=Any(l15<=hh,t15);
t16:=BARSSINCE(dS=16)+1;
l16:=ref(l,T16);
h16:=ref(H,t16);
s16:=Any(H16>=ll,t16);
x16:=Any(l16<=hh,t16);
t17:=BARSSINCE(dS=17)+1;
l17:=ref(l,T17);
h17:=ref(H,t17);
s17:=Any(H17>=ll,t17);
x17:=Any(l17<=hh,t17);
t18:=BARSSINCE(dS=18)+1;
l18:=ref(l,T18);
h18:=ref(H,t18);
s18:=Any(H18>=ll,t18);
x18:=Any(l18<=hh,t18);
t19:=BARSSINCE(dS=19)+1;
l19:=ref(l,T19);
h19:=ref(H,t19);
s19:=Any(H19>=ll,t19);
x19:=Any(l19<=hh,t19);
t20:=BARSSINCE(dS=20)+1;
l20:=ref(l,T20);
h20:=ref(H,t20);
s20:=Any(H20>=ll,t20);
x20:=Any(l20<=hh,t20);
t21:=BARSSINCE(dS=21)+1;
l21:=ref(l,T21);
h21:=ref(H,t21);
s21:=Any(H21>=ll,t21);
x21:=Any(l21<=hh,t21);
t22:=BARSSINCE(dS=22)+1;
l22:=ref(l,T22);
h22:=ref(H,t22);
s22:=Any(H22>=ll,t22);
x22:=Any(l22<=hh,t22);
t23:=BARSSINCE(dS=23)+1;
l23:=ref(l,T23);
h23:=ref(H,t23);
s23:=Any(H23>=ll,t23);
x23:=Any(l23<=hh,t23);
t24:=BARSSINCE(dS=24)+1;
l24:=ref(l,T24);
h24:=ref(H,t24);
s24:=Any(H24>=ll,t24);
x24:=Any(l24<=hh,t24);
t25:=BARSSINCE(dS=25)+1;
l25:=ref(l,T25);
h25:=ref(H,t25);
s25:=Any(H25>=ll,t25);
x25:=Any(l25<=hh,t25);
t26:=BARSSINCE(dS=26)+1;
l26:=ref(l,T26);
h26:=ref(H,t26);
s26:=Any(H26>=ll,t26);
x26:=Any(l26<=hh,t26);
t27:=BARSSINCE(dS=27)+1;
l27:=ref(l,T27);
h27:=ref(H,t27);
s27:=Any(H27>=ll,t27);
x27:=Any(l27<=hh,t27);
t28:=BARSSINCE(dS=28)+1;
l28:=ref(l,T28);
h28:=ref(H,t28);
s28:=Any(H28>=ll,t28);
x28:=Any(l28<=hh,t28);
t29:=BARSSINCE(dS=29)+1;
l29:=ref(l,T29);
h29:=ref(H,t29);
s29:=Any(H29>=ll,t29);
x29:=Any(l29<=hh,t29);
t30:=BARSSINCE(dS=30)+1;
l30:=ref(l,T30);
h30:=ref(H,t30);
s30:=Any(H30>=ll,t30);
x30:=Any(l30<=hh,t30);
t31:=BARSSINCE(dS=31)+1;
l31:=ref(l,T31);
h31:=ref(H,t31);
s31:=Any(H31>=ll,t31);
x31:=Any(l31<=hh,t31);
t32:=BARSSINCE(dS=32)+1;
l32:=ref(l,T32);
h32:=ref(H,t32);
s32:=Any(H32>=ll,t32);
x32:=Any(l32<=hh,t32);
t33:=BARSSINCE(dS=33)+1;
l33:=ref(l,T33);
h33:=ref(H,t33);
s33:=Any(H33>=ll,t33);
x33:=Any(l33<=hh,t33);
t34:=BARSSINCE(dS=34)+1;
l34:=ref(l,T34);
h34:=ref(H,t34);
s34:=Any(H34>=ll,t34);
x34:=Any(l34<=hh,t34);
t35:=BARSSINCE(dS=35)+1;
l35:=ref(l,T35);
h35:=ref(H,t35);
s35:=Any(H35>=ll,t35);
x35:=Any(l35<=hh,t35);
t36:=BARSSINCE(dS=36)+1;
l36:=ref(l,T36);
h36:=ref(H,t36);
s36:=Any(H36>=ll,t36);
x36:=Any(l36<=hh,t36);
t37:=BARSSINCE(dS=37)+1;
l37:=ref(l,T37);
h37:=ref(H,t37);
s37:=Any(H37>=ll,t37);
x37:=Any(l37<=hh,t37);
t38:=BARSSINCE(dS=38)+1;
l38:=ref(l,T38);
h38:=ref(H,t38);
s38:=Any(H38>=ll,t38);
x38:=Any(l38<=hh,t38);
t39:=BARSSINCE(dS=39)+1;
l39:=ref(l,T39);
h39:=ref(H,t39);
s39:=Any(H39>=ll,t39);
x39:=Any(l39<=hh,t39);
t40:=BARSSINCE(dS=40)+1;
l40:=ref(l,T40);
h40:=ref(H,t40);
s40:=Any(H40>=ll,t40);
x40:=Any(l40<=hh,t40);
t41:=BARSSINCE(dS=41)+1;
l41:=ref(l,T41);
h41:=ref(H,t41);
s41:=Any(H41>=ll,t41);
x41:=Any(l41<=hh,t41);
t42:=BARSSINCE(dS=42)+1;
l42:=ref(l,T42);
h42:=ref(H,t42);
s42:=Any(H42>=ll,t42);
x42:=Any(l42<=hh,t42);
t43:=BARSSINCE(dS=43)+1;
l43:=ref(l,T43);
h43:=ref(H,t43);
s43:=Any(H43>=ll,t43);
x43:=Any(l43<=hh,t43);
t44:=BARSSINCE(dS=44)+1;
l44:=ref(l,T44);
h44:=ref(H,t44);
s44:=Any(H44>=ll,t44);
x44:=Any(l44<=hh,t44);
t45:=BARSSINCE(dS=45)+1;
l45:=ref(l,T45);
h45:=ref(H,t45);
s45:=Any(H45>=ll,t45);
x45:=Any(l45<=hh,t45);
t46:=BARSSINCE(dS=46)+1;
l |