{参数:高点---1.00--99999.00---23.00
低点---1.00---99999.00---16.00
自动预测周期---1.00---999.00---7.00
全画开关---0.00---1.00---0.00}
找高低点的”k线计数“的方法:先把光标放在一波的高点k线处,双击后看上面“k线计数”处显示的数字,再右击"k线计数“把显示的数字填入到“调整指标参数“中。找低点同样方法
源码:
VAR1:=BARSCOUNT(C);
VAR2:=CONST(VAR1);
VAR3:=VAR2-VAR1;
K线计数:VAR3+1,NODRAW,COLORYELLOW;
{自动预测周期}
DRAWKLINE(H,O,L,C);
A1 := (REF(HIGH,自动预测周期) = HHV(HIGH,(自动预测周期 + 1)));
B1 := FILTER(A1,自动预测周期);
C1 := BACKSET(B1,(自动预测周期 + 1));
D1 := FILTER(C1,自动预测周期);
A2 := (REF(LOW,自动预测周期) = LLV(LOW,(自动预测周期 + 1)));
B2 := FILTER(A2,自动预测周期);
C2 := BACKSET(B2,(自动预测周期 + 1));
D2 := FILTER(C2,自动预测周期);
E1 := ((REF(LLV(LOW,自动预测周期),1) + REF(HHV(HIGH,自动预测周期),1)) / 2);
E2 := ((HIGH + LOW) / 2);
H1 := (((D1 AND NOT((D2 AND (E1 >= E2)))) OR ISLASTBAR) OR (BARSCOUNT(CLOSE) = 1));
L1 := (D2 AND NOT((D1 AND (E1 < E2))));
H2 := (D1 AND NOT((D2 AND (E1 >= E2))));
X1 := REF(BARSLAST(H1),1) + 1;
F1 := BACKSET((H1 AND (COUNT(L1,X1) > 0)),LLVBARS(IF(L1,LOW,10000),X1));
G1 := (F1 > REF(F1,1));
I1 := BACKSET(G1,2);
LD := (I1 > REF(I1,1));
L2 := ((LD OR ISLASTBAR) OR (BARSCOUNT(CLOSE) = 1));
X2 := (REF(BARSLAST(L2),1) + 1);
F2 := BACKSET((L2 AND (COUNT(H2,X2) > 0)),HHVBARS(IF(H2,HIGH,0),X2));
G2 := (F2 > REF(F2,1));
I2 := BACKSET(G2,2);
HD := (I2 > REF(I2,1));
{全画}
IF(全画开关=1,DRAWLINE(LD,L,HD,H,0),DRAWNULL)COLORRED;
IF(全画开关=1,DRAWLINE(HD,H,LD,L,0),DRAWNULL)COLORGREEN;
DRAWTEXT(全画开关=1 AND LD AND BARSLAST(HD)<BARSLAST(REF(LD,1)) ,L*0.98,'A'),COLORRED;
DRAWNUMBER(全画开关=1 AND LD AND BARSLAST(HD)<BARSLAST(REF(LD,1)) ,L*0.98,L),COLORRED;
DRAWTEXT(全画开关=1 AND HD,H*1.01,'B'),COLORGREEN;
DRAWNUMBER(全画开关=1 AND HD,H*1.01,H),COLORGREEN;
最高价格:=HHV(REF(HIGH,高点-1),2),NODRAW;
最低价格:=LLV(REF(LOW,低点-1),2),NODRAW;
高低比:=最高价格/最低价格;
高低比平方:=SQRT(高低比);
再平放:=SQRT(高低比平方);
预测高点:CONST(最高价格/再平放),NODRAW;
预测中点:CONST(最高价格/高低比平方),NODRAW;
VAR11:=SQRT(高低比)+再平放-1;
VAR12:=最高价格/VAR11;
预测低点:CONST(VAR12),NODRAW;
{DRAWLINE(CURRBARSCOUNT<=高点,预测高点,预测低点,预测低点,0)CIRCLEDOT,LINETHICK2,COLOREB9B00;}
DRAWLINE(CURRBARSCOUNT<=高点,预测高点,预测高点,预测高点,0)DOTLINE,LINETHICK1,COLOREB9B00;
DRAWLINE(CURRBARSCOUNT<=高点,预测中点,预测中点,预测中点,0)DOTLINE,LINETHICK1,COLOREB9B00;
DRAWLINE(CURRBARSCOUNT<=高点,预测低点,预测低点,预测低点,0)DOTLINE,LINETHICK1,COLOREB9B00;
DRAWTEXT(CURRBARSCOUNT=高点,预测高点*0.98,STRCAT(' C1:',CON2STR(预测高点,2)))COLOREB9B00;
DRAWTEXT(CURRBARSCOUNT=高点,预测低点*0.98,STRCAT(' C3:',CON2STR(预测低点,2)))COLOREB9B00;
DRAWTEXT(CURRBARSCOUNT=高点,预测中点*0.98,STRCAT(' C2:',CON2STR(预测中点,2)))COLOREB9B00;
STICKLINE(CURRBARSCOUNT=高点,H,预测低点,0,-1),COLOREB9B00;{高点到低划线}
DRAWTEXT(CURRBARSCOUNT=高点,H,'( 高B )'),COLORYELLOW;
DRAWTEXT(CURRBARSCOUNT=低点,L,'( 低A )'),COLORYELLOW;
DRAWLINE(CURRBARSCOUNT=高点 ,H,CURRBARSCOUNT=低点,L,0)COLOREB9B00,LINETHICK2;{最高到低点划线}
DRAWLINE(CURRBARSCOUNT=低点,L,CURRBARSCOUNT=高点,H,0)COLOREB9B00,LINETHICK2;{最低到高点划线};
DRAWICON(CURRBARSCOUNT=低点,L,38);{历史低点标记}
DRAWICON(CURRBARSCOUNT=高点,H,39);{历史高点标记};
DRAWLINE(CURRBARSCOUNT=高点,H,预测低点,预测低点,-1)DOTLINE,LINETHICK1,COLOREB9B00;
{两点买入:通过低点A、高B,算出点C1、C2、C3的三个买入点为,这个思路是买上涨趋势股回头思路;}
联系客服