DIFF:Ema(CLOSE,5)-EMA(CLOSE,26);
DEA:EMA(DIFF,50);
:2*(DIFF-DEA),COLORstICK;
A1:=BArslAST(REF(crOSS(DIFF,DEA),1));
B1:=REF(C,A1+1) CANDREF(DIFF,A1+1) DIFFANDCROSS(DIFF,DEA);
A2:=BARSLAST(REF(CROSS(".K"(9,3,3),"kdJ.D"(9,3,3)),1));
B2:=REF(C,A2+1) CANDREF("KDJ.K"(9,3,3),A2+1) "KDJ.K"(9,3,3)ANDCROSS("KDJ.K"(9,3,3),"KDJ.D"(9,3,3));
A3:=BARSLAST(REF(CROSS(".RSI1"(6,12,24),"RSI.RSI2"(6,12,24)),1));
B3:=REF(C,A3+1) CANDREF("RSI.RSI1"(6,12,24),A3+1) "RSI.RSI1"(6,12,24)ANDCROSS("RSI.RSI1"(6,12,24),"RSI.RSI2"(6,12,24));
C1:=BARSLAST(REF(CROSS(DEA,DIFF),1));
D1:=REF(C,C1+1) CANDREF(DIFF,C1+1) DIFFANDCROSS(DEA,DIFF);
C2:=BARSLAST(REF(CROSS("KDJ.D"(9,3,3),"KDJ.K"(9,3,3)),1));
D2:=REF(C,C2+1) CANDREF("KDJ.K"(9,3,3),C2+1) "KDJ.K"(9,3,3)ANDCROSS("KDJ.D"(9,3,3),"KDJ.K"(9,3,3));
C3:=BARSLAST(REF(CROSS("RSI.RSI2"(6,12,24),"RSI.RSI1"(6,12,24)),1));
D3:=REF(C,C3+1) CANDREF("RSI.RSI1"(6,12,24),C3+1) "RSI.RSI1"(6,12,24)ANDCROSS("RSI.RSI2"(6,12,24),"RSI.RSI1"(6,12,24));
MacD底背:IF(B1 0,-0.1,0),COLORRED,POINTDOT;
KDJ底背:IF(B2 0,-0.1,0),COLORFF00FF,POINTDOT;
RSI底背:IF(B3 0,-0.1,0),COLORYELLOW,POINTDOT;
MACD顶背:IF(D1 0,0.1,0),COLOR00FF00,POINTDOT;
KDJ顶背:IF(D2 0,0.1,0),COLORFFCC66,POINTDOT;
RSI顶背:IF(D3 0,0.1,0),COLORWHITE,POINTDOT;
STICKLINE(B1 0,-0.1,0,2,0),COLORRED;
STICKLINE(B2 0,-0.1,0,2,0),COLORFF00FF;
STICKLINE(B3 0,-0.1,0,2,0),COLORYELLOW;
STICKLINE(D1 0,0.1,0,2,0),COLOR00FF00;
STICKLINE(D2 0,0.1,0,2,0),COLORFFCC66;
STICKLINE(D3 0,0.1,0,2,0),COLORWHITE;
STICKLINE(MACD REF(MACD,1)ANDMACD 0,0,MACD,0,0),COLORRED;
STICKLINE(MACD =REF(MACD,1)ANDMACD 0,0,MACD,0,0),COLORYELLOW;
STICKLINE(MACD REF(MACD,1)ANDMACD 0,0,MACD,0,0),COLORCYAN;
STICKLINE(MACD =REF(MACD,1)ANDMACD 0,0,MACD,0,0),COLORMAGENTA;
STICKLINE(C 0,0,0,50,1),COLORBLUE;
DIFF,COLORGREEN;
DEA,COLORYELLOW;
强:IF(DIFF MA(DIFF,2),DIFF,DRAWNULL),COLORRED;
弱:IF(DEA MA(DEA,2),DEA,DRAWNULL),COLORMAGENTA;
必买:IF(TROUGHBARS(3,15,1)=0ANDHIGH LOW+0.01,1,-0),COLORYELLOW,LINETHICK4;
必卖:IF(PEAKBARS(3,15,1)=1,1,-0),COLORGREEN,LINETHICK4;
MA30:=EMA(CLOSE,30);
强弱:EMA(CLOSE,900);
STICKLINE((MA30 强弱),MA30,强弱,1,0),COLOR0000FF;
STICKLINE((MA30 强弱),MA30,强弱,1,0),COLOR00FF00;
LC:=REF(CLOSE,1);
H1:=MAX(LC,HIGH);
L1:=MIN(LC,LOW);
P1:=H1-L1;
阻力:L1+P1*7/8,COLOR00DD00;
支撑:L1+P1*0.5/8,COLOR00DD00;
现价:CLOSE,COLORWHITE,LINETHICK1;
STICKLINE(CROSS(支撑,现价),支撑,阻力,1,0),COLORYELLOW;
DRAWTEXT(CROSS(支撑,现价),支撑*1.001,'★B'),COLORYELLOW;{吸}
DRAWTEXT(CROSS(现价,阻力),现价,'★'),COLORRED;{抛};
[源码注释]分时主图买入涨停公公式解读
输出DIFF:收盘价的5日指数移动平均-收盘价的26日指数移动平均
输出DEA:DIFF的50日指数移动平均
输出平滑异同平:2*(DIFF-DEA),COLORSTICK
A1赋值:上次1日前的DIFF上穿DEA距今天数
B1赋值:A1+1日前的收盘价 CANDREF(DIFF,A1+1) DIFFANDCROSS(DIFF,DEA)
A2赋值:上次1日前的"KDJ的K"(9,3,3)上穿"KDJ的D"(9,3,3)距今天数
B2赋值:A2+1日前的收盘价 CANDREF("KDJ的K"(9,3,3),A2+1) "KDJ的K"(9,3,3)ANDCROSS("KDJ的K"(9,3,3),"KDJ的D"(9,3,3))
A3赋值:上次1日前的"RSI的RSI1"(6,12,24)上穿"RSI的RSI2"(6,12,24)距今天数
B3赋值:A3+1日前的收盘价 CANDREF("RSI的RSI1"(6,12,24),A3+1) "RSI的RSI1"(6,12,24)ANDCROSS("RSI的RSI1"(6,12,24),"RSI的RSI2"(6,12,24))
C1赋值:上次1日前的DEA上穿DIFF距今天数
D1赋值:C1+1日前的收盘价 CANDREF(DIFF,C1+1) DIFFANDCROSS(DEA,DIFF)
C2赋值:上次1日前的"KDJ的D"(9,3,3)上穿"KDJ的K"(9,3,3)距今天数
D2赋值:C2+1日前的收盘价 CANDREF("KDJ的K"(9,3,3),C2+1) "KDJ的K"(9,3,3)ANDCROSS("KDJ的D"(9,3,3),"KDJ的K"(9,3,3))
C3赋值:上次1日前的"RSI的RSI2"(6,12,24)上穿"RSI的RSI1"(6,12,24)距今天数
D3赋值:C3+1日前的收盘价 CANDREF("RSI的RSI1"(6,12,24),C3+1) "RSI的RSI1"(6,12,24)ANDCROSS("RSI的RSI2"(6,12,24),"RSI的RSI1"(6,12,24))
输出MACD底背:如果B1 0,返回-0.1,否则返回0,画红色,POINTDOT
输出KDJ底背:如果B2 0,返回-0.1,否则返回0,COLORFF00FF,POINTDOT
输出RSI底背:如果B3 0,返回-0.1,否则返回0,画黄色,POINTDOT
输出MACD顶背:如果D1 0,返回0.1,否则返回0,COLOR00FF00,POINTDOT
输出KDJ顶背:如果D2 0,返回0.1,否则返回0,COLORFFCC66,POINTDOT
输出RSI顶背:如果D3 0,返回0.1,否则返回0,画白色,POINTDOT
当满足条件B1 0时,在-0.1和0位置之间画柱状线,宽度为2,0不为0则画空心柱.,画红色
当满足条件B2 0时,在-0.1和0位置之间画柱状线,宽度为2,0不为0则画空心柱.,COLORFF00FF
当满足条件B3 0时,在-0.1和0位置之间画柱状线,宽度为2,0不为0则画空心柱.,画黄色
当满足条件D1 0时,在0.1和0位置之间画柱状线,宽度为2,0不为0则画空心柱.,COLOR00FF00
当满足条件D2 0时,在0.1和0位置之间画柱状线,宽度为2,0不为0则画空心柱.,COLORFFCC66
当满足条件D3 0时,在0.1和0位置之间画柱状线,宽度为2,0不为0则画空心柱.,画白色
当满足条件MACD 1日前的MACDANDMACD 0时,在0和MACD位置之间画柱状线,宽度为0,0不为0则画空心柱.,画红色
当满足条件MACD =1日前的MACDANDMACD 0时,在0和MACD位置之间画柱状线,宽度为0,0不为0则画空心柱.,画黄色
当满足条件MACD 1日前的MACDANDMACD 0时,在0和MACD位置之间画柱状线,宽度为0,0不为0则画空心柱.,画青色
当满足条件MACD =1日前的MACDANDMACD 0时,在0和MACD位置之间画柱状线,宽度为0,0不为0则画空心柱.,画洋红色
当满足条件收盘价 0时,在0和0位置之间画柱状线,宽度为50,1不为0则画空心柱.,画蓝色
DIFF,画绿色
DEA,画黄色
输出强:如果DIFF DIFF的2日简单移动平均,返回DIFF,否则返回无效数,画红色
输出弱:如果DEA DEA的2日简单移动平均,返回DEA,否则返回无效数,画洋红色
输出必买:如果收盘价15%之字转向的前1个波谷位置=0ANDHIGH 最低价+0.01,返回1,否则返回-0,画黄色,线宽为4
输出必卖:如果收盘价15%之字转向的前1个波峰位置=1,返回1,否则返回-0,画绿色,线宽为4
MA30赋值:收盘价的30日指数移动平均
输出强弱:收盘价的900日指数移动平均
当满足条件(MA30 时,在?和?位置之间画柱状线,宽度为?,?不为0则画空心柱.
强弱),MA30,强弱,1,0),COLOR0000FF
当满足条件(MA30 时,在?和?位置之间画柱状线,宽度为?,?不为0则画空心柱.
强弱),MA30,强弱,1,0),COLOR00FF00
LC赋值:1日前的收盘价
H1赋值:LC和最高价的较大值
L1赋值:LC和最低价的较小值
P1赋值:H1-L1
输出阻力:L1+P1*7/8,COLOR00DD00
输出支撑:L1+P1*0.5/8,COLOR00DD00
输出现价:收盘价,画白色,线宽为1
当满足条件支撑上穿现价时,在支撑和阻力位置之间画柱状线,宽度为1,0不为0则画空心柱.,画黄色
当满足条件支撑上穿现价时,在支撑*1.001位置书写文字,画黄色
当满足条件现价上穿阻力时,在现价位置书写文字,画红色