股价在96到100(是数值非价格)范围内连续两次下破主力线,且第二个股价线高点低于第一个股价线高点,给出个信号。
如何编写?
源码如下:
股价:3*SMA((CLOSE-LLV(LOW,27))/(HHV(HIGH,27)-LLV(LOW,27))*100,5,1)-2*SMA(SMA((CLOSE-LLV(LOW,27))/(HHV(HIGH,27)-LLV(LOW,27))*100,5,1),3,1),colorwhite;
底区:10.5,COLORYELLOW;
RSV30:=(CLOSE-LLV(LOW,30))/(HHV(HIGH,30)-LLV(LOW,30))*100;
K30:=SMA(RSV30,5,1);
D30:=SMA(K30,3,1);
J30:=3*K30-2*D30;
主力线:EMA(J30,2),COLORRED,LINETHICK1;
顶区:90,COLOR00FF00;
高风险火箭发射区:102,colorCCCC00;
绝对卖出:IF(CROSS(主力线,股价)and BETWEEN(股价,96,100),100,0),linethick2,color00ff00;
解答如下:
A:="KDJ.J"(27,5,3);{股价};
B:=EMA("KDJ.J"(30,5,3),2);{主力线};
D:=CROSS(B,A) AND A>=96;
E:=REF(HHV(A,3),BARSLAST(D));
CROSS(COUNT(D,10)>=2,0.5) AND E<REF(E,1);