输入几个K线根数就自动显示拐点的《神奇时间拐点》指标 主图源码
A起点:=0;
A低点:=0;
A高点:=0;
A次低:=0;
B高点:=0;
C低点:=0;
D高点:=0;
买入低位:=0;
买入高位:=0;
卖出高位:=0;
卖出低位:=0;
手动开关:=1;
DRAWTEXT_FIX(1,0.70,0.01,1,'说明: 打开指标参数调整窗,参考趋势线上的K线根数值,填进选择的高、低点位的K线根数相应位置,就会自动显示A、B、C、D四根拐点位置的竖线,两点手动空间预测是辅助拐点预测之用。'),COLORYELLOW;
AR1:=BARSCOUNT(C);
AR2:=CONST(AR1);
AR3:=AR2-AR1;
K线根数:AR3+1,NODRAW,COLORYELLOW;
A1:=(REF(HIGH,3)=HHV(HIGH,(2*3+1)));
B1:=FILTER(A1,3);
C1:=BACKSET(B1,(3+1));
D1:=FILTER(C1,3);
A2:=(REF(LOW,3)=LLV(LOW,(2*3+1)));
B2:=FILTER(A2,3);
C2:=BACKSET(B2,(3+1));
D2:=FILTER(C2,3);
E1:=(REF(LLV(LOW,2*3),1)+REF(HHV(HIGH,2*3),1))/2;
E2:=(HIGH+LOW)/2;
H1:=(D1 AND NOT(D2 AND E1>=E2)) OR ISLASTBAR OR BARSCOUNT(CLOSE)=1;
H2:=D1 AND NOT(D2 AND E1>=E2);
L1:=D2 AND NOT(D1 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);
A3:=H;
B3:=REF(H,REF(BARSLAST(HD),1)+1)>REF(H,REF(BARSLAST(HD),1)+2+REF(BARSLAST(HD),REF(BARSLAST(HD),1)+2));
D3:=A3 AND B3 AND HD;
E3:=BACKSET(D3,REF(BARSLAST(HD),1)+2);
HH:=E3>REF(E3,1);
A4:=L>REF(L,REF(BARSLAST(LD),1)+1);
B4:=REF(L,REF(BARSLAST(LD),1)+1); D4:=A4 AND B4 AND LD;
E4:=BACKSET(D4,REF(BARSLAST(LD),1)+2);
LL:=E4>REF(E4,1);
H3:=HH OR ISLASTBAR OR BARSCOUNT(C)=1;
X3:=REF(BARSLAST(H3),1)+1;
F3:=BACKSET(H3 AND COUNT(LL,X3)>0,LLVBARS(IF(LL,L,POW(10,20)),X3));
G3:=F3>REF(F3,1);
I3:=BACKSET(G3,2);
LZ:=I3>REF(I3,1);
L4:=LZ OR ISLASTBAR OR BARSCOUNT(C)=1;
X4:=REF(BARSLAST(L4),1)+1;
F4:=BACKSET(L4 AND COUNT(HH,X4)>0,HHVBARS(IF(HH,H,-POW(10,20)),X4));
G4:=F4>REF(F4,1);
I4:=BACKSET(G4,2);
HZ:=I4>REF(I4,1);
K1:=BACKSET(ISLASTBAR,MIN(BARSLAST(HZ),BARSLAST(LZ))+1);
K2:=K1>REF(K1,1);
UU:=BACKSET(ISLASTBAR,BARSLAST(LD)+1);
VV:=UU>REF(UU,1);
WW:=BACKSET(VV,REF(BARSLAST(LD),1)+2);
XX:=WW>REF(WW,1);
UU2:=BACKSET(ISLASTBAR,BARSLAST(HD)+1);
VV2:=UU2>REF(UU2,1);
WW2:=BACKSET(VV2,REF(BARSLAST(HD),1)+2);
XX2:=WW2>REF(WW2,1);
DRAWLINE(LD,L,HD,H,0),LINETHICK1,DOTLINE,COLOR0000FF;
DRAWLINE(HD,H,LD,L,0),LINETHICK1,DOTLINE,COLOR00FF00;
K:=CURRBARSCOUNT,NODRAW;
DRAWNUMBER(HD,H,K),COLORLIRED,DRAWABOVE;
DRAWNUMBER(LD,L,K),COLORFFFF00;
高点:=BARSLAST(HD);
低点:=BARSLAST(LD);
J1:=BACKSET(ISLASTBAR,MIN(高点,低点)+1);
J2:=J1>REF(J1,1);
起点A:=BARSLAST(CURRBARSCOUNT=A起点+1),NODRAW;
低点A:=BARSLAST(CURRBARSCOUNT=A低点+1),NODRAW;
高点A:=BARSLAST(CURRBARSCOUNT=A高点+1),NODRAW;
次低A:=BARSLAST(CURRBARSCOUNT=A次低+1),COLORFF8800,NODRAW;
高点B:=BARSLAST(CURRBARSCOUNT=B高点+1),COLORFF0080,NODRAW;
低点C:=BARSLAST(CURRBARSCOUNT=C低点+1),NODRAW;
高点D:=BARSLAST(CURRBARSCOUNT=D高点+1),NODRAW;
起点:1,COLORRED,NODRAW;
TA1:ABS(起点A-低点A+1),COLORGREEN,NODRAW;
TA2:ABS(起点A-高点A)+1,COLORRED,NODRAW;
TA3:ABS(起点A-次低A)+1,COLORGREEN,NODRAW;
TB4:IF(B高点>0,ABS(起点A-高点B)+1,DRAWNULL)COLORFF8800,NODRAW;
TC5:IF(C低点>0,ABS(起点A-低点C)+1,DRAWNULL)COLORLIRED,NODRAW;
TD6:IF(D高点>0,ABS(起点A-高点D)+1,DRAWNULL)COLORRED,NODRAW;
TB1:=TA3*TA2,NODRAW;
拐点A:INTPART(TB1/TA1),COLORYELLOW,NODRAW;
TB2:=TB4*TA3,NODRAW;
拐点B:INTPART(TB2/TA2),COLORMAGENTA,NODRAW;
TB3:=TC5*TB4,NODRAW;
拐点C:INTPART(TB3/TA3),COLORLIRED,NODRAW;
TB5:=TD6*TC5,NODRAW;
拐点D:INTPART(TB5/TB4),COLORGREEN,NODRAW;
STICKLINE(CURRBARSCOUNT=A起点-拐点A+1,H*1.5,L*0.95,0.05,-1),COLORFF9900;
STICKLINE(CURRBARSCOUNT=A起点-拐点B+1,H*1.5,L*0.95,0.05,-1),COLORMAGENTA;
STICKLINE(CURRBARSCOUNT=A起点-拐点C+1,H*1.5,L*0.95,0.05,-1),COLORYELLOW;
STICKLINE(CURRBARSCOUNT=A起点-拐点D+1,H*1.5,L*0.95,0.05,-1),COLORGREEN;
STICKLINE(CURRBARSCOUNT=A起点-拐点A+1,H,L,3.0,0),COLORFF9900;
STICKLINE(CURRBARSCOUNT=A起点-拐点B+1,H,L,3.0,0),COLORYELLOW;
STICKLINE(CURRBARSCOUNT=A起点-拐点C+1,H,L,3.0,0),COLORLIRED;
STICKLINE(CURRBARSCOUNT=A起点-拐点D+1,H,L,3.0,0),COLORFF0080;
DRAWLINE(CURRBARSCOUNT=A起点,H,CURRBARSCOUNT=A低点,L,0),COLORYELLOW,LINETHICK2;
DRAWLINE(CURRBARSCOUNT=A低点,L,CURRBARSCOUNT=A高点,H,0),COLORYELLOW,LINETHICK2;
DRAWLINE(CURRBARSCOUNT=A高点,H,CURRBARSCOUNT=A次低,L,0),COLORYELLOW,LINETHICK2;
DRAWLINE(CURRBARSCOUNT=A次低,L,CURRBARSCOUNT=B高点,H,0),COLORFF7700,LINETHICK2;
DRAWLINE(CURRBARSCOUNT=B高点,H,CURRBARSCOUNT=C低点,L,0),COLORGREEN,LINETHICK2;
DRAWLINE(CURRBARSCOUNT=C低点,L,CURRBARSCOUNT=D高点,H,0),COLORLIRED,LINETHICK2;
DRAWTEXT(CURRBARSCOUNT=A起点,H*1.01,VARCAT(('【起点】='),VAR2STR(1,0))),COLORRED,COLORRED;
DRAWTEXT(CURRBARSCOUNT=A低点,L*0.99,VARCAT(('【TA1】='),VAR2STR(TA1,0))),COLORRED,COLORGREEN;
DRAWTEXT(CURRBARSCOUNT=A高点,H*1.01,VARCAT(('【TA2】='),VAR2STR(TA2,0))),COLORRED,COLORGREEN;
DRAWTEXT(CURRBARSCOUNT=A次低,L*0.99,VARCAT(('【TA3】='),VAR2STR(TA3,0))),COLORRED,COLORGREEN;
DRAWTEXT(CURRBARSCOUNT=B高点,H*1.01,VARCAT(('【TB4】='),VAR2STR(TB4,0))),COLORRED,COLORRED;
DRAWTEXT(CURRBARSCOUNT=C低点,L*0.99,VARCAT(('【TC5】='),VAR2STR(TC5,0))),COLORRED,COLORFF8800;
DRAWTEXT(CURRBARSCOUNT=D高点,H*1.01,VARCAT(('【TD6】='),VAR2STR(TD6,0))),COLORRED,COLORYELLOW;
DRAWTEXT(CURRBARSCOUNT=A起点-拐点A+1,L*0.95,VARCAT(('拐点A='),VAR2STR(拐点A,0))),COLORYELLOW;
DRAWTEXT(CURRBARSCOUNT=A起点-拐点B+1,L*0.95,VARCAT(('拐点B='),VAR2STR(拐点B,0))),COLORMAGENTA;
DRAWTEXT(CURRBARSCOUNT=A起点-拐点C+1,L*0.95,VARCAT(('拐点C='),VAR2STR(拐点C,0))),COLORLIRED;
DRAWTEXT(CURRBARSCOUNT=A起点-拐点D+1,L*0.95,VARCAT(('拐点D='),VAR2STR(拐点D,0))),COLORWHITE;
DRAWICON(CURRBARSCOUNT=A起点,H,23);
LL1A:=REF(L,买入低位-1),NODRAW;
GG1A:=REF(H,买入高位-1),NODRAW;
LL1:=IF(手动开关=1 AND 买入低位>买入高位 AND GG1A>LL1A,LL1A,DRAWNULL),NODRAW;
GG1:=IF(手动开关=1 AND 买入低位>买入高位 AND GG1A>LL1A,GG1A,DRAWNULL),NODRAW;
VAR1A:=SQRT(GG1/LL1);
VAR2A:=SQRT(VAR1A);
A:=GG1/SQRT(VAR1A);
B:=GG1/VAR1A;
D:=GG1/(VAR1A+VAR2A-1);
{买C1A:CONST(A),COLORFF8800,NODRAW;
买C2A:CONST(B),COLORFF8800,NODRAW;
买C3A:CONST(D),COLORFF8800,NODRAW;}
IF(手动开关=1,DRAWLINE(CURRBARSCOUNT=买入低位,L,CURRBARSCOUNT=买入高位,H,0),DRAWNULL),COLORGREEN,LINETHICK3;
买C1:DRAWLINE(CURRBARSCOUNT=买入高位,CONST(A),CURRBARSCOUNT=1,CONST(A),1),COLORFF8800,DOTLINE;
买C2:DRAWLINE(CURRBARSCOUNT=买入高位,CONST(B),CURRBARSCOUNT=1,CONST(B),1),COLORFF8800,DOTLINE;
买C3:DRAWLINE(CURRBARSCOUNT=买入高位,CONST(D),CURRBARSCOUNT=1,CONST(D),1),COLORFF8800,DOTLINE;
DRAWTEXT(CURRBARSCOUNT=买入高位,CONST(A),VARCAT('买C1=',VAR2STR(CONST(A),2))),COLORWHITE;
DRAWTEXT(CURRBARSCOUNT=买入高位,CONST(B),VARCAT('买C2=',VAR2STR(CONST(B),2))),COLORWHITE;
DRAWTEXT(CURRBARSCOUNT=买入高位,CONST(D),VARCAT('买C3=',VAR2STR(CONST(D),2))),COLORWHITE;
DRAWTEXT(CURRBARSCOUNT=买入低位,L,VARCAT('低位【A】',VAR2STR(L,2))),COLORGREEN;
DRAWTEXT(CURRBARSCOUNT=买入高位,H,VARCAT('高位【B】',VAR2STR(H,2))),COLORRED;
STICKLINE(CURRBARSCOUNT=买入高位,H,CONST(D),0,-1),COLORFF8800;
GGB2:=REF(H,卖出高位-1),NODRAW;
LLB2:=REF(L,卖出低位-1),NODRAW;
GG3:=IF(手动开关=1 AND 卖出高位>卖出低位 AND GGB2>LLB2,GGB2,DRAWNULL),NODRAW;
LL3:=IF(手动开关=1 AND 卖出高位>卖出低位 AND GGB2>LLB2,LLB2,DRAWNULL),NODRAW;
VAR1C:=SQRT(GG3/LL3);
VAR2C:=SQRT(VAR1C);
F:=LL3*SQRT(VAR1C),NODRAW;
G:=LL3*VAR1C,NODRAW;
J:=LL3*(VAR1C+VAR2C-1),NODRAW;
{卖C1A:CONST(F),COLORMAGENTA,NODRAW;
卖C2A:CONST(G),COLORMAGENTA,NODRAW;
卖C3A:CONST(J),COLORMAGENTA,NODRAW;}
IF(手动开关=1,DRAWLINE(CURRBARSCOUNT=卖出高位,H,CURRBARSCOUNT=卖出低位,L,0),DRAWNULL),COLORMAGENTA,LINETHICK3;
卖C1:DRAWLINE(CURRBARSCOUNT=卖出低位, CONST(F), CURRBARSCOUNT=1,CONST(F),1),COLORMAGENTA,DOTLINE;
卖C2:DRAWLINE(CURRBARSCOUNT=卖出低位, CONST(G), CURRBARSCOUNT=1,CONST(G),1),COLORMAGENTA,DOTLINE;
卖C3:DRAWLINE(CURRBARSCOUNT=卖出低位, CONST(J), CURRBARSCOUNT=1,CONST(J),1),COLORMAGENTA,DOTLINE;
DRAWTEXT(CURRBARSCOUNT=卖出低位, CONST(F),VARCAT('卖C1=',VAR2STR(CONST(F),2))),COLORYELLOW;
DRAWTEXT(CURRBARSCOUNT=卖出低位, CONST(G),VARCAT('卖C2=',VAR2STR(CONST(G),2))),COLORYELLOW;
DRAWTEXT(CURRBARSCOUNT=卖出低位, CONST(J),VARCAT('卖C3=',VAR2STR(CONST(J),2))),COLORYELLOW;
DRAWTEXT(CURRBARSCOUNT=卖出高位,H,VARCAT('高位【A】',VAR2STR(H,2))),COLORRED;
DRAWTEXT(CURRBARSCOUNT=卖出低位,L,VARCAT('低位【B】',VAR2STR(L,2))),COLORGREEN;
STICKLINE(CURRBARSCOUNT=卖出低位,H,CONST(J),0,4),COLORMAGENTA;
预测走势:DRAWLINE(J2,IF(HD,H,L),ISLASTBAR,IF(高点>低点,H,L),0),DOTLINE,COLORFFFFFF;
未来函数检测结果如下:
该公式包含未来函数:BACKSET
解密、编写股票、期货策略请联系QQ或微信同号:88652583
相关股票指标公式
原理解析:
A起点赋值:0
A低点赋值:0
A高点赋值:0
A次低赋值:0
B高点赋值:0
C低点赋值:0
D高点赋值:0
买入低位赋值:0
买入高位赋值:0
卖出高位赋值:0
卖出低位赋值:0
手动开关赋值:1
当满足条件1时,在横轴0.70纵轴0.01位置书写文字
AR1赋值:C的有效数据周期数
AR2赋值:CONST(AR1)
AR3赋值:AR2-AR1
输出K线根数:AR3+1,NODRAW,COLORYELLOW
A1赋值:(3日前的HIGH=HHV(HIGH,(2*3+1)))
B1赋值:A1的3过滤
C1赋值:BACKSET(B1,(3+1))
D1赋值:C1的3过滤
A2赋值:(3日前的最低价=LLV(最低价,(2*3+1)))
B2赋值:A2的3过滤
C2赋值:BACKSET(B2,(3+1))
D2赋值:C2的3过滤
E1赋值:(REF(2*3日内最低价最低值,1)+REF(2*3日内HIGH最高值,1))/2
E2赋值:(HIGH+最低价)/2
H1赋值:(D1 AND NOT(D2 AND E1>=E2)) OR ISLASTBAR OR 收盘价的有效数据周期数=1
H2赋值:D1 AND NOT(D2 AND E1>=E2)
L1赋值:D2 AND NOT(D1 AND E1=E2)
X1赋值:REF(上次H1距今天数,1)+1
如果L1返回最低价否则返回10000
G1赋值:F1>1日前的F1
I1赋值:BACKSET(G1,2)
LD赋值:I1>1日前的I1
L2赋值:LD OR ISLASTBAR OR 收盘价的有效数据周期数=1
X2赋值:REF(上次L2距今天数,1)+1
如果H2返回HIGH否则返回0
G2赋值:F2>1日前的F2
I2赋值:BACKSET(G2,2)
HD赋值:I2>1日前的I2
A3赋值:H
B3赋值:REF(H,REF(上次HD距今天数,1)+1)>REF(H,REF(上次HD距今天数,1)+2+REF(上次HD距今天数,REF(上次HD距今天数,1)+2))
D3赋值:A3 AND B3 AND HD
E3赋值:BACKSET(D3,REF(上次HD距今天数,1)+2)
HH赋值:E3>1日前的E3
A4赋值:L>REF(L,REF(上次LD距今天数,1)+1)
B4赋值:REF(L,REF(上次LD距今天数,1)+1)
D4赋值:A4 AND B4 AND LD
E4赋值:BACKSET(D4,REF(上次LD距今天数,1)+2)
LL赋值:E4>1日前的E4
H3赋值:HH OR ISLASTBAR OR C的有效数据周期数=1
X3赋值:REF(上次H3距今天数,1)+1
F3赋值:BACKSET(H3 AND 统计X3日满足LL的天数>0,LLVBARS(IF(LL,L,POW(10,20)),X3))
G3赋值:F3>1日前的F3
I3赋值:BACKSET(G3,2)
LZ赋值:I3>1日前的I3
L4赋值:LZ OR ISLASTBAR OR C的有效数据周期数=1
X4赋值:REF(上次L4距今天数,1)+1
F4赋值:BACKSET(L4 AND 统计X4日满足HH的天数>0,HHVBARS(IF(HH,H,-POW(10,20)),X4))
G4赋值:F4>1日前的F4
I4赋值:BACKSET(G4,2)
HZ赋值:I4>1日前的I4
K1赋值:BACKSET(ISLASTBAR,MIN(上次HZ距今天数,BARSLAST(LZ))+1)
K2赋值:K1>1日前的K1
UU赋值:BACKSET(ISLASTBAR,上次LD距今天数+1)
VV赋值:UU>1日前的UU
WW赋值:BACKSET(VV,REF(上次LD距今天数,1)+2)
XX赋值:WW>1日前的WW
UU2:=BACKSET(ISLASTBAR,上次HD距今天数+1)
VV2:=UU2>1日前的UU2
WW2:=BACKSET(VV2,REF(上次HD距今天数,1)+2)
XX2赋值:WW2>1日前的WW2
DRAWLINE(LD,L,HD,H,0),LINETHICK1,DOTLINE,COLOR0000FF
DRAWLINE(HD,H,LD,L,0),LINETHICK1,DOTLINE,COLOR00FF00
K赋值:CURRBARSCOUNT,NODRAW
DRAWNUMBER(HD,H,K),COLORLIRED,DRAWABOVE
DRAWNUMBER(LD,L,K),COLORFFFF00
高点赋值:上次HD距今天数
低点赋值:上次LD距今天数
J1赋值:BACKSET(ISLASTBAR,高点和低点的较小值+1)
J2赋值:J1>1日前的J1
起点A赋值:上次CURRBARSCOUNT=A起点+1距今天数,NODRAW
低点A赋值:上次CURRBARSCOUNT=A低点+1距今天数,NODRAW
高点A赋值:上次CURRBARSCOUNT=A高点+1距今天数,NODRAW
次低A赋值:上次CURRBARSCOUNT=A次低+1距今天数,COLORFF8800,NODRAW
高点B赋值:上次CURRBARSCOUNT=B高点+1距今天数,COLORFF0080,NODRAW
低点C:=上次CURRBARSCOUNT=C低点+1距今天数,NODRAW
高点D赋值:上次CURRBARSCOUNT=D高点+1距今天数,NODRAW
输出起点:1,COLORRED,NODRAW
T输出A1:起点A-低点A+1的绝对值,COLORGREEN,NODRAW
T输出A2:起点A-高点A的绝对值+1,COLORRED,NODRAW
T输出A3:起点A-次低A的绝对值+1,COLORGREEN,NODRAW
T输出B4:IF(B高点>0,起点A-高点B的绝对值+1,DRAWNULL)COLORFF8800,NODRAW
输出TC5:IF(C低点>0,起点A-低点C的绝对值+1,DRAWNULL)COLORLIRED,NODRAW
输出TD6:IF(D高点>0,起点A-高点D的绝对值+1,DRAWNULL)COLORRED,NODRAW
TB1赋值:TA3*TA2,NODRAW
输出拐点A:INTPART(TB1/TA1),COLORYELLOW,NODRAW
TB2赋值:TB4*TA3,NODRAW
输出拐点B:INTPART(TB2/TA2),COLORMAGENTA,NODRAW
TB3赋值:TC5*TB4,NODRAW
输出拐点C:INTPART(TB3/TA3),COLORLIRED,NODRAW
TB5赋值:TD6*TC5,NODRAW
输出拐点D:INTPART(TB5/TB4),COLORGREEN,NODRAW
当满足条件CURRBARSCOUNT=A起点-拐点A+1时,在H*1.5和L*0.95之间画柱状线
当满足条件CURRBARSCOUNT=A起点-拐点B+1时,在H*1.5和L*0.95之间画柱状线
当满足条件CURRBARSCOUNT=A起点-拐点C+1时,在H*1.5和L*0.95之间画柱状线
当满足条件CURRBARSCOUNT=A起点-拐点D+1时,在H*1.5和L*0.95之间画柱状线
当满足条件CURRBARSCOUNT=A起点-拐点A+1时,在H和L之间画柱状线
当满足条件CURRBARSCOUNT=A起点-拐点B+1时,在H和L之间画柱状线
当满足条件CURRBARSCOUNT=A起点-拐点C+1时,在H和L之间画柱状线
当满足条件CURRBARSCOUNT=A起点-拐点D+1时,在H和L之间画柱状线
DRAWLINE(CURRBARSCOUNT=A起点,H,CURRBARSCOUNT=A低点,L,0),COLORYELLOW,LINETHICK2
DRAWLINE(CURRBARSCOUNT=A低点,L,CURRBARSCOUNT=A高点,H,0),COLORYELLOW,LINETHICK2
DRAWLINE(CURRBARSCOUNT=A高点,H,CURRBARSCOUNT=A次低,L,0),COLORYELLOW,LINETHICK2
DRAWLINE(CURRBARSCOUNT=A次低,L,CURRBARSCOUNT=B高点,H,0),COLORFF7700,LINETHICK2
DRAWLINE(CURRBARSCOUNT=B高点,H,CURRBARSCOUNT=C低点,L,0),COLORGREEN,LINETHICK2
DRAWLINE(CURRBARSCOUNT=C低点,L,CURRBARSCOUNT=D高点,H,0),COLORLIRED,LINETHICK2
DRAWTEXT(CURRBARSCOUNT=A起点,H*1.01,VARCAT(('【起点】='),VAR2STR(1,0))),COLORRED,COLORRED
DRAWTEXT(CURRBARSCOUNT=A低点,L*0.99,VARCAT(('【TA1】='),VAR2STR(TA1,0))),COLORRED,COLORGREEN
DRAWTEXT(CURRBARSCOUNT=A高点,H*1.01,VARCAT(('【TA2】='),VAR2STR(TA2,0))),COLORRED,COLORGREEN
DRAWTEXT(CURRBARSCOUNT=A次低,L*0.99,VARCAT(('【TA3】='),VAR2STR(TA3,0))),COLORRED,COLORGREEN
DRAWTEXT(CURRBARSCOUNT=B高点,H*1.01,VARCAT(('【TB4】='),VAR2STR(TB4,0))),COLORRED,COLORRED
DRAWTEXT(CURRBARSCOUNT=C低点,L*0.99,VARCAT(('【TC5】='),VAR2STR(TC5,0))),COLORRED,COLORFF8800
DRAWTEXT(CURRBARSCOUNT=D高点,H*1.01,VARCAT(('【TD6】='),VAR2STR(TD6,0))),COLORRED,COLORYELLOW
DRAWTEXT(CURRBARSCOUNT=A起点-拐点A+1,L*0.95,VARCAT(('拐点A='),VAR2STR(拐点A,0))),COLORYELLOW
DRAWTEXT(CURRBARSCOUNT=A起点-拐点B+1,L*0.95,VARCAT(('拐点B='),VAR2STR(拐点B,0))),COLORMAGENTA
DRAWTEXT(CURRBARSCOUNT=A起点-拐点C+1,L*0.95,VARCAT(('拐点C='),VAR2STR(拐点C,0))),COLORLIRED
DRAWTEXT(CURRBARSCOUNT=A起点-拐点D+1,L*0.95,VARCAT(('拐点D='),VAR2STR(拐点D,0))),画白色
当满足条件CURRBARSCOUNT=A起点时,在H和23之间画图标
LL1A赋值:买入低位-1日前的L,NODRAW
GG1A赋值:买入高位-1日前的H,NODRAW
如果手动开关=1 AND 买入低位>买入高位 AND GG1A>LL1A返回LL1A否则返回DRAWNULL
如果手动开关=1 AND 买入低位>买入高位 AND GG1A>LL1A返回GG1A否则返回DRAWNULL
VAR1A赋值:SQRT(GG1/LL1)
VAR2A赋值:SQRT(VAR1A)
A赋值:GG1/SQRT(VAR1A)
B赋值:GG1/VAR1A
D赋值:GG1/(VAR1A+VAR2A-1)
{买C1输出A:CONST(A),COLORFF8800,NODRAW
买C2输出A:CONST(B),COLORFF8800,NODRAW
买C3输出A:CONST(D),COLORFF8800,NODRAW
}
IF(手动开关=1,DRAWLINE(CURRBARSCOUNT=买入低位,L,CURRBARSCOUNT=买入高位,H,0),DRAWNULL),COLORGREEN,LINETHICK3
买输出C1:DRAWLINE(CURRBARSCOUNT=买入高位,CONST(A),CURRBARSCOUNT=1,CONST(A),1),COLORFF8800,DOTLINE
买输出C2:DRAWLINE(CURRBARSCOUNT=买入高位,CONST(B),CURRBARSCOUNT=1,CONST(B),1),COLORFF8800,DOTLINE
输出买C3:DRAWLINE(CURRBARSCOUNT=买入高位,CONST(D),CURRBARSCOUNT=1,CONST(D),1),COLORFF8800,DOTLINE
DRAWTEXT(CURRBARSCOUNT=买入高位,CONST(A),VARCAT('买C1=',VAR2STR(CONST(A),2))),画白色
DRAWTEXT(CURRBARSCOUNT=买入高位,CONST(B),VARCAT('买C2=',VAR2STR(CONST(B),2))),画白色
DRAWTEXT(CURRBARSCOUNT=买入高位,CONST(D),VARCAT('买C3=',VAR2STR(CONST(D),2))),画白色
DRAWTEXT(CURRBARSCOUNT=买入低位,L,VARCAT('低位【A】',VAR2STR(L,2))),COLORGREEN
DRAWTEXT(CURRBARSCOUNT=买入高位,H,VARCAT('高位【B】',VAR2STR(H,2))),COLORRED
STICKLINE(CURRBARSCOUNT=买入高位,H,CONST(D),0,-1),COLORFF8800
GGB2赋值:卖出高位-1日前的H,NODRAW
LLB2赋值:卖出低位-1日前的L,NODRAW
如果手动开关=1 AND 卖出高位>卖出低位 AND GGB2>LLB2返回GGB2否则返回DRAWNULL
如果手动开关=1 AND 卖出高位>卖出低位 AND GGB2>LLB2返回LLB2否则返回DRAWNULL
VAR1C:=SQRT(GG3/LL3)
VAR2C:=SQRT(VAR1C)
F赋值:LL3*SQRT(VAR1C),NODRAW
G赋值:LL3*VAR1C,NODRAW
J赋值:LL3*(VAR1C+VAR2C-1),NODRAW
{卖C1输出A:CONST(F),COLORMAGENTA,NODRAW
卖C2输出A:CONST(G),COLORMAGENTA,NODRAW
卖C3输出A:CONST(J),COLORMAGENTA,NODRAW
}
IF(手动开关=1,DRAWLINE(CURRBARSCOUNT=卖出高位,H,CURRBARSCOUNT=卖出低位,L,0),DRAWNULL),COLORMAGENTA,LINETHICK3
卖输出C1:DRAWLINE(CURRBARSCOUNT=卖出低位, CONST(F), CURRBARSCOUNT=1,CONST(F),1),COLORMAGENTA,DOTLINE
卖输出C2:DRAWLINE(CURRBARSCOUNT=卖出低位, CONST(G), CURRBARSCOUNT=1,CONST(G),1),COLORMAGENTA,DOTLINE
输出卖C3:DRAWLINE(CURRBARSCOUNT=卖出低位, CONST(J), CURRBARSCOUNT=1,CONST(J),1),COLORMAGENTA,DOTLINE
DRAWTEXT(CURRBARSCOUNT=卖出低位, CONST(F),VARCAT('卖C1=',VAR2STR(CONST(F),2))),COLORYELLOW
DRAWTEXT(CURRBARSCOUNT=卖出低位, CONST(G),VARCAT('卖C2=',VAR2STR(CONST(G),2))),COLORYELLOW
DRAWTEXT(CURRBARSCOUNT=卖出低位, CONST(J),VARCAT('卖C3=',VAR2STR(CONST(J),2))),COLORYELLOW
DRAWTEXT(CURRBARSCOUNT=卖出高位,H,VARCAT('高位【A】',VAR2STR(H,2))),COLORRED
DRAWTEXT(CURRBARSCOUNT=卖出低位,L,VARCAT('低位【B】',VAR2STR(L,2))),COLORGREEN
STICKLINE(CURRBARSCOUNT=卖出低位,H,CONST(J),0,4),COLORMAGENTA
如果HD返回H否则返回L