编写要求:
公式在线网解答:
网友求助:
求助老师编写KDJ和DMI选股公式!
条件:1、KDJ金叉
2、DMI里的ADX大于60
解答如下:
====================
{同时满足}
RSV=(CLOSE-LLV(LOW,9))/(HHV(HIGH,9)-LLV(LOW,9))*100;
a=SMA(RSV,3,1);
b=SMA(a,3,1);
e=3*a-2*b;
金叉:=CROSS(e,b);
TR := SMA(MAX(MAX(HIGH-LOW,ABS(HIGH-REF(CLOSE,1))),ABS(LOW-REF(CLOSE,1))),14,1);
HD := HIGH-REF(HIGH,1);
LD := REF(LOW,1)-LOW;
DMP:= SMA(IF(HD>0 AND HD>LD,HD,0),14,1);
DMM:= SMA(IF(LD>0 AND LD>HD,LD,0),14,1);
PDI:=DMP*100/TR;
MDI:=DMM*100/TR;
ADX:=SMA(ABS(MDI-PDI)/(MDI+PDI)*100,14,1)>60;
金叉 AND ADX;