网友求助:
需要满足的条件是:当(J值-K值)>(K值-D值)乘以2的时候提示“顶”;当(D值-K值)乘以2<(K值-J值)的时候提示“底”,谢谢
源码---
N=9;
M1=3;
M2=3;
RSV=(CLOSE-LLV(LOW,N))/(HHV(HIGH,N)-LLV(LOW,N))*100;
a=SMA(RSV,M1,1);
b=SMA(a,M2,1);
e=3*a-2*b;
IF(a<0) a=0;
IF(a>100) a=100;
IF(b<0) b=0;
IF(b>100) b=100;
IF(e<0) e=0;
IF(e>100) e=100;
K:a;
D:b;
J:e;
解答如下:
N=9;
M1=3;
M2=3;
RSV=(CLOSE-LLV(LOW,N))/(HHV(HIGH,N)-LLV(LOW,N))*100;
a=SMA(RSV,M1,1);
b=SMA(a,M2,1);
e=3*a-2*b;
IF(a<0) a=0;
IF(a>100) a=100;
IF(b<0) b=0;
IF(b>100) b=100;
IF(e<0) e=0;
IF(e>100) e=100;
K:a;
D:b;
J:e;
DRAWTEXT((j-k)>(k-d)*2,d,'顶');
DRAWTEXT((d-k)*2<(k-j),d,'底');
这是根据楼主给出的条件写的,和实际情况有出入。