死叉横线做个输出
更多金钻指标股票技术讨论QQ群:966329692 技术讨论QQ群:220302856 技术讨论QQ群:39652085 如群满可换一个

编写要求:

请老师给死叉横线做个输出,即有数值出来,能看到MA6和MA18的死叉点位,谢谢。MA1:MA(C,6);MA2:MA(C,18);SXN:=BARSLAST(CROSS(MA2,MA1));XL1:=(MA1-REF(MA1,1))/MA1;XL2:=(MA2-REF(MA2,1))/MA2;N:=(REF(MA1,1)-REF(MA2,1))/(XL1*REF(MA1,1)-XL2*REF(MA2,1));JP:=(1-N*XL1)*REF(MA1,1);JZ:=IF(SXN=0,JP,REF(JP,SXN));死叉横线:STICKLINE(SXN>0,JZ,JZ,20,1),COLORred;

解答:

 MA1:MA(C,6),PRECIS2;

MA2:MA(C,18),PRECIS2;
SXN:=BARSLAST(CROSS(MA2,MA1));
XL1:=(MA1-REF(MA1,1))/MA1;
XL2:=(MA2-REF(MA2,1))/MA2;
N:=(REF(MA1,1)-REF(MA2,1))/(XL1*REF(MA1,1)-XL2*REF(MA2,1));
JP:=(1-N*XL1)*REF(MA1,1);
JZ:=IF(SXN=0,JP,REF(JP,SXN));
死叉横线:JZ,LINETHICK0,COLORRED,PRECIS2;
DRAWTEXT(SXN=0,死叉横线,NUMTOSTRN(死叉横线,2),-12),COLORWHITE;
STICKLINE(SXN>0,JZ,JZ,20,1),COLORred;

选股票看什么指标最好 >股票指标网