以下是通达信SSL指标公式源码和使用说明
使用说明如下:
识别支撑位和阻力位:通过绘制SSL指标的结果,可以直观地观察到价格相对稳定的水平。支撑位通常表明价格有可能反弹,而阻力位则表明价格有可能下跌。
分析价格走势:通过观察价格与SSL指标的交互作用,可以更好地理解价格的走势。当价格接近支撑位时,可能会出现反弹;当价格接近阻力位时,可能会出现下跌。
确定买入和卖出信号:SSL指标的交叉点可以用作买入和卖出的信号。当SSL指标从下方交叉到上方时,可能是一个买入信号;当SSL指标从上方交叉到下方时,可能是一个卖出信号。
通达信SSL指标公式源码:
TS:=350;N:=95;
DA1:=IF(TS>TOTALBARSCOUNT,TOTALBARSCOUNT,TS);
DA:=IF(CURRBARSCOUNT>DA1,0,DA1);
HI:=REFDATE(HHV(H,DA),DATE);{最高价}
LO:=REFDATE(LLV(L,DA),DATE);
C1:=IF(CURRBARSCOUNT<=DA,C,DRAWNULL);
GZ:=EXP(LN(HI/LO)/15);{对数格值}
LH1:=SUM(IF(C1>=(HI/GZ),V,0),DA);
LH2:=SUM(IF(C1>=(HI/POW(GZ,2))ANDC1<(HI/GZ),V,0),DA);
LH3:=SUM(IF(C1>=(HI/POW(GZ,3))ANDC1<(HI/POW(GZ,2)),V,0),DA);
LH4:=SUM(IF(C1>=(HI/POW(GZ,4))ANDC1<(HI/POW(GZ,3)),V,0),DA);
LH5:=SUM(IF(C1>=(HI/POW(GZ,5))ANDC1<(HI/POW(GZ,4)),V,0),DA);
LH6:=SUM(IF(C1>=(HI/POW(GZ,6))ANDC1<(HI/POW(GZ,5)),V,0),DA);
LH7:=SUM(IF(C1>=(HI/POW(GZ,7))ANDC1<(HI/POW(GZ,6)),V,0),DA);
LH8:=SUM(IF(C1>=(HI/POW(GZ,8))ANDC1<(HI/POW(GZ,7)),V,0),DA);
LH9:=SUM(IF(C1>=(HI/POW(GZ,9))ANDC1<LO*POW(GZ,7),V,0),DA);
LH10:=SUM(IF(C1>=(LO*POW(GZ,5))ANDC1<LO*POW(GZ,6),V,0),DA);
LH11:=SUM(IF(C1>=(LO*POW(GZ,4))ANDC1<LO*POW(GZ,5),V,0),DA);
LH12:=SUM(IF(C1>=(LO*POW(GZ,3))ANDC1<LO*POW(GZ,4),V,0),DA);
LH13:=SUM(IF(C1>=(LO*POW(GZ,2))ANDC1<LO*POW(GZ,3),V,0),DA);
LH14:=SUM(IF(C1>=(LO*GZ)ANDC1<LO*POW(GZ,2),V,0),DA);
LH15:=SUM(IF(C1>=LOANDC1<LO*GZ,V,0),DA);
L1:=REFDATE(HHV(LH1,DA),DATE);
L2:=REFDATE(HHV(LH2,DA),DATE);
L3:=REFDATE(HHV(LH3,DA),DATE);
L4:=REFDATE(HHV(LH4,DA),DATE);
L5:=REFDATE(HHV(LH5,DA),DATE);
L6:=REFDATE(HHV(LH6,DA),DATE);
L7:=REFDATE(HHV(LH7,DA),DATE);
L8:=REFDATE(HHV(LH8,DA),DATE);
L9:=REFDATE(HHV(LH9,DA),DATE);
L10:=REFDATE(HHV(LH10,DA),DATE);
L11:=REFDATE(HHV(LH11,DA),DATE);
L12:=REFDATE(HHV(LH12,DA),DATE);
L13:=REFDATE(HHV(LH13,DA),DATE);
L14:=REFDATE(HHV(LH14,DA),DATE);
L15:=REFDATE(HHV(LH15,DA),DATE);
SS:=(L1+L2+L3+L4+L5+L6+L7+L8+L9+L10+L11+L12+L13+L14+L15);
stICKLINE(CEILING(DA*L1/SS)*3>=CURRBARSCOUNT,HI*N/100,HI/GZ,5,0)COLORYELLOW;
STICKLINE(CEILING(DA*L2/SS)*3>=CURRBARSCOUNT,HI/POW(GZ,1)*N/100,HI/POW(GZ,2),5,0)COLORLIGRAY;
STICKLINE(CEILING(DA*L3/SS)*3>=CURRBARSCOUNT,HI/POW(GZ,2)*N/100,HI/POW(GZ,3),5,0)COLORGRAY;
STICKLINE(CEILING(DA*L4/SS)*3>=CURRBARSCOUNT,HI/POW(GZ,3)*N/100,HI/POW(GZ,4),5,0)COLORLIGRAY;
STICKLINE(CEILING(DA*L5/SS)*3>=CURRBARSCOUNT,HI/POW(GZ,4)*N/100,HI/POW(GZ,5),5,0)COLORGRAY;
STICKLINE(CEILING(DA*L6/SS)*3>=CURRBARSCOUNT,HI/POW(GZ,5)*N/100,HI/POW(GZ,6),5,0)COLORLIGRAY;
STICKLINE(CEILING(DA*L7/SS)*3>=CURRBARSCOUNT,HI/POW(GZ,6)*N/100,HI/POW(GZ,7),5,0)COLORGRAY;
STICKLINE(CEILING(DA*L8/SS)*3>=CURRBARSCOUNT,LO*POW(GZ,7),LO*POW(GZ,8)*N/100,5,0)COLORLIGRAY;
STICKLINE(CEILING(DA*L9/SS)*3>=CURRBARSCOUNT,LO*POW(GZ,6),LO*POW(GZ,7)*N/100,5,0)COLORGRAY;
STICKLINE(CEILING(DA*L10/SS)*3>=CURRBARSCOUNT,LO*POW(GZ,5),LO*POW(GZ,6)*N/100,5,0)COLORLIGRAY;
STICKLINE(CEILING(DA*L11/SS)*3>=CURRBARSCOUNT,LO*POW(GZ,4),LO*POW(GZ,5)*N/100,5,0)COLORGRAY;
STICKLINE(CEILING(DA*L12/SS)*3>=CURRBARSCOUNT,LO*POW(GZ,3),LO*POW(GZ,4)*N/100,5,0)COLORLIGRAY;
STICKLINE(CEILING(DA*L13/SS)*3>=CURRBARSCOUNT,LO*POW(GZ,2),LO*POW(GZ,3)*N/100,5,0)COLORGRAY;
STICKLINE(CEILING(DA*L14/SS)*3>=CURRBARSCOUNT,LO*POW(GZ,1),LO*POW(GZ,2)*N/100,5,0)COLORLICYAN;
STICKLINE(CEILING(DA*L15/SS)*3>=CURRBARSCOUNT,LO,LO*POW(GZ,1)*N/100,5,0)COLORGRAY;
TS:=350;N:=95;
DA1:=IF(TS>TOTALBARSCOUNT,TOTALBARSCOUNT,TS);
DA:=IF(CURRBARSCOUNT>DA1,0,DA1);
HI:=REFDATE(HHV(H,DA),DATE);{最高价}
LO:=REFDATE(LLV(L,DA),DATE);
C1:=IF(CURRBARSCOUNT<=DA,C,DRAWNULL);
GZ:=EXP(LN(HI/LO)/15);{对数格值}
LH1:=SUM(IF(C1>=(HI/GZ),V,0),DA);
LH2:=SUM(IF(C1>=(HI/POW(GZ,2))ANDC1<(HI/GZ),V,0),DA);
LH3:=SUM(IF(C1>=(HI/POW(GZ,3))ANDC1<(HI/POW(GZ,2)),V,0),DA);
LH4:=SUM(IF(C1>=(HI/POW(GZ,4))ANDC1<(HI/POW(GZ,3)),V,0),DA);
LH5:=SUM(IF(C1>=(HI/POW(GZ,5))ANDC1<(HI/POW(GZ,4)),V,0),DA);
LH6:=SUM(IF(C1>=(HI/POW(GZ,6))ANDC1<(HI/POW(GZ,5)),V,0),DA);
LH7:=SUM(IF(C1>=(HI/POW(GZ,7))ANDC1<(HI/POW(GZ,6)),V,0),DA);
LH8:=SUM(IF(C1>=(HI/POW(GZ,8))ANDC1<(HI/POW(GZ,7)),V,0),DA);
LH9:=SUM(IF(C1>=(HI/POW(GZ,9))ANDC1<LO*POW(GZ,7),V,0),DA);
LH10:=SUM(IF(C1>=(LO*POW(GZ,5))ANDC1<LO*POW(GZ,6),V,0),DA);
LH11:=SUM(IF(C1>=(LO*POW(GZ,4))ANDC1<LO*POW(GZ,5),V,0),DA);
LH12:=SUM(IF(C1>=(LO*POW(GZ,3))ANDC1<LO*POW(GZ,4),V,0),DA);
LH13:=SUM(IF(C1>=(LO*POW(GZ,2))ANDC1<LO*POW(GZ,3),V,0),DA);
LH14:=SUM(IF(C1>=(LO*GZ)ANDC1<LO*POW(GZ,2),V,0),DA);
LH15:=SUM(IF(C1>=LOANDC1<LO*GZ,V,0),DA);
L1:=REFDATE(HHV(LH1,DA),DATE);
L2:=REFDATE(HHV(LH2,DA),DATE);
L3:=REFDATE(HHV(LH3,DA),DATE);
L4:=REFDATE(HHV(LH4,DA),DATE);
L5:=REFDATE(HHV(LH5,DA),DATE);
L6:=REFDATE(HHV(LH6,DA),DATE);
L7:=REFDATE(HHV(LH7,DA),DATE);
L8:=REFDATE(HHV(LH8,DA),DATE);
L9:=REFDATE(HHV(LH9,DA),DATE);
L10:=REFDATE(HHV(LH10,DA),DATE);
L11:=REFDATE(HHV(LH11,DA),DATE);
L12:=REFDATE(HHV(LH12,DA),DATE);
L13:=REFDATE(HHV(LH13,DA),DATE);
L14:=REFDATE(HHV(LH14,DA),DATE);
L15:=REFDATE(HHV(LH15,DA),DATE);
TS:=350;N:=95;
DA1:=IF(TS>TOTALBARSCOUNT,TOTALBARSCOUNT,TS);
DA:=IF(CURRBARSCOUNT>DA1,0,DA1);
HI:=REFDATE(HHV(H,DA),DATE);{最高价}
LO:=REFDATE(LLV(L,DA),DATE);
C1:=IF(CURRBARSCOUNT<=DA,C,DRAWNULL);
GZ:=EXP(LN(HI/LO)/15);{对数格值}
LH1:=SUM(IF(C1>=(HI/GZ),V,0),DA);
LH2:=SUM(IF(C1>=(HI/POW(GZ,2))ANDC1<(HI/GZ),V,0),DA);
LH3:=SUM(IF(C1>=(HI/POW(GZ,3))ANDC1<(HI/POW(GZ,2)),V,0),DA);
LH4:=SUM(IF(C1>=(HI/POW(GZ,4))ANDC1<(HI/POW(GZ,3)),V,0),DA);
LH5:=SUM(IF(C1>=(HI/POW(GZ,5))ANDC1<(HI/POW(GZ,4)),V,0),DA);
LH6:=SUM(IF(C1>=(HI/POW(GZ,6))ANDC1<(HI/POW(GZ,5)),V,0),DA);
LH7:=SUM(IF(C1>=(HI/POW(GZ,7))ANDC1<(HI/POW(GZ,6)),V,0),DA);
LH8:=SUM(IF(C1>=(HI/POW(GZ,8))ANDC1<(HI/POW(GZ,7)),V,0),DA);
LH9:=SUM(IF(C1>=(HI/POW(GZ,9))ANDC1<LO*POW(GZ,7),V,0),DA);
LH10:=SUM(IF(C1>=(LO*POW(GZ,5))ANDC1<LO*POW(GZ,6),V,0),DA);
LH11:=SUM(IF(C1>=(LO*POW(GZ,4))ANDC1<LO*POW(GZ,5),V,0),DA);
LH12:=SUM(IF(C1>=(LO*POW(GZ,3))ANDC1<LO*POW(GZ,4),V,0),DA);
LH13:=SUM(IF(C1>=(LO*POW(GZ,2))ANDC1<LO*POW(GZ,3),V,0),DA);
LH14:=SUM(IF(C1>=(LO*GZ)ANDC1<LO*POW(GZ,2),V,0),DA);
LH15:=SUM(IF(C1>=LOANDC1<LO*GZ,V,0),DA);
L1:=REFDATE(HHV(LH1,DA),DATE);
L2:=REFDATE(HHV(LH2,DA),DATE);
L3:=REFDATE(HHV(LH3,DA),DATE);
L4:=REFDATE(HHV(LH4,DA),DATE);
L5:=REFDATE(HHV(LH5,DA),DATE);
L6:=REFDATE(HHV(LH6,DA),DATE);
L7:=REFDATE(HHV(LH7,DA),DATE);
L8:=REFDATE(HHV(LH8,DA),DATE);
L9:=REFDATE(HHV(LH9,DA),DATE);
L10:=REFDATE(HHV(LH10,DA),DATE);
L11:=REFDATE(HHV(LH11,DA),DATE);
L12:=REFDATE(HHV(LH12,DA),DATE);
L13:=REFDATE(HHV(LH13,DA),DATE);
L14:=REFDATE(HHV(LH14,DA),DATE);
L15:=REFDATE(HHV(LH15,DA),DATE);
SS:=(L1+L2+L3+L4+L5+L6+L7+L8+L9+L10+L11+L12+L13+L14+L15);
STICKLINE(CEILING(DA*L1/SS)*3>=CURRBARSCOUNT,HI*N/100,HI/GZ,5,0)COLORYELLOW;
STICKLINE(CEILING(DA*L2/SS)*3>=CURRBARSCOUNT,HI/POW(GZ,1)*N/100,HI/POW(GZ,2),5,0)COLORLIGRAY;
STICKLINE(CEILING(DA*L3/SS)*3>=CURRBARSCOUNT,HI/POW(GZ,2)*N/100,HI/POW(GZ,3),5,0)COLORGRAY;
STICKLINE(CEILING(DA*L4/SS)*3>=CURRBARSCOUNT,HI/POW(GZ,3)*N/100,HI/POW(GZ,4),5,0)COLORLIGRAY;
STICKLINE(CEILING(DA*L5/SS)*3>=CURRBARSCOUNT,HI/POW(GZ,4)*N/100,HI/POW(GZ,5),5,0)COLORGRAY;
STICKLINE(CEILING(DA*L6/SS)*3>=CURRBARSCOUNT,HI/POW(GZ,5)*N/100,HI/POW(GZ,6),5,0)COLORLIGRAY;
STICKLINE(CEILING(DA*L7/SS)*3>=CURRBARSCOUNT,HI/POW(GZ,6)*N/100,HI/POW(GZ,7),5,0)COLORGRAY;
STICKLINE(CEILING(DA*L8/SS)*3>=CURRBARSCOUNT,LO*POW(GZ,7),LO*POW(GZ,8)*N/100,5,0)COLORLIGRAY;
STICKLINE(CEILING(DA*L9/SS)*3>=CURRBARSCOUNT,LO*POW(GZ,6),LO*POW(GZ,7)*N/100,5,0)COLORGRAY;
STICKLINE(CEILING(DA*L10/SS)*3>=CURRBARSCOUNT,LO*POW(GZ,5),LO*POW(GZ,6)*N/100,5,0)COLORLIGRAY;
STICKLINE(CEILING(DA*L11/SS)*3>=CURRBARSCOUNT,LO*POW(GZ,4),LO*POW(GZ,5)*N/100,5,0)COLORGRAY;
STICKLINE(CEILING(DA*L12/SS)*3>=CURRBARSCOUNT,LO*POW(GZ,3),LO*POW(GZ,4)*N/100,5,0)COLORLIGRAY;
STICKLINE(CEILING(DA*L13/SS)*3>=CURRBARSCOUNT,LO*POW(GZ,2),LO*POW(GZ,3)*N/100,5,0)COLORGRAY;
STICKLINE(CEILING(DA*L14/SS)*3>=CURRBARSCOUNT,LO*POW(GZ,1),LO*POW(GZ,2)*N/100,5,0)COLORLICYAN;
STICKLINE(CEILING(DA*L15/SS)*3>=CURRBARSCOUNT,LO,LO*POW(GZ,1)*N/100,5,0)COLORGRAY;
SS:=(L1+L2+L3+L4+L5+L6+L7+L8+L9+L10+L11+L12+L13+L14+L15);
STICKLINE(CEILING(DA*L1/SS)*3>=CURRBARSCOUNT,HI*N/100,HI/GZ,5,0)COLORYELLOW;
STICKLINE(CEILING(DA*L2/SS)*3>=CURRBARSCOUNT,HI/POW(GZ,1)*N/100,HI/POW(GZ,2),5,0)COLORLIGRAY;
STICKLINE(CEILING(DA*L3/SS)*3>=CURRBARSCOUNT,HI/POW(GZ,2)*N/100,HI/POW(GZ,3),5,0)COLORGRAY;
STICKLINE(CEILING(DA*L4/SS)*3>=CURRBARSCOUNT,HI/POW(GZ,3)*N/100,HI/POW(GZ,4),5,0)COLORLIGRAY;
STICKLINE(CEILING(DA*L5/SS)*3>=CURRBARSCOUNT,HI/POW(GZ,4)*N/100,HI/POW(GZ,5),5,0)COLORGRAY;
STICKLINE(CEILING(DA*L6/SS)*3>=CURRBARSCOUNT,HI/POW(GZ,5)*N/100,HI/POW(GZ,6),5,0)COLORLIGRAY;
STICKLINE(CEILING(DA*L7/SS)*3>=CURRBARSCOUNT,HI/POW(GZ,6)*N/100,HI/POW(GZ,7),5,0)COLORGRAY;
STICKLINE(CEILING(DA*L8/SS)*3>=CURRBARSCOUNT,LO*POW(GZ,7),LO*POW(GZ,8)*N/100,5,0)COLORLIGRAY;
STICKLINE(CEILING(DA*L9/SS)*3>=CURRBARSCOUNT,LO*POW(GZ,6),LO*POW(GZ,7)*N/100,5,0)COLORGRAY;
STICKLINE(CEILING(DA*L10/SS)*3>=CURRBARSCOUNT,LO*POW(GZ,5),LO*POW(GZ,6)*N/100,5,0)COLORLIGRAY;
STICKLINE(CEILING(DA*L11/SS)*3>=CURRBARSCOUNT,LO*POW(GZ,4),LO*POW(GZ,5)*N/100,5,0)COLORGRAY;
STICKLINE(CEILING(DA*L12/SS)*3>=CURRBARSCOUNT,LO*POW(GZ,3),LO*POW(GZ,4)*N/100,5,0)COLORLIGRAY;
STICKLINE(CEILING(DA*L13/SS)*3>=CURRBARSCOUNT,LO*POW(GZ,2),LO*POW(GZ,3)*N/100,5,0)COLORGRAY;
STICKLINE(CEILING(DA*L14/SS)*3>=CURRBARSCOUNT,LO*POW(GZ,1),LO*POW(GZ,2)*N/100,5,0)COLORLICYAN;
STICKLINE(CEILING(DA*L15/SS)*3>=CURRBARSCOUNT,LO,LO*POW(GZ,1)*N/100,5,0)COLORGRAY;
通达信SSL指标公式截图
评论(0)