DIFF:EMA(CLOSE,5) - EMA(CLOSE,26);
DEA:EMA(DIFF,50);
MACD:2*(DIFF-DEA),COLORSTICK;
RSV:=(CLOSE-LLV(LOW,9))/(HHV(HIGH,9)-LLV(LOW,9))*100;//收盘价与N周期最低值做差,N周期最高值与N周期最低值做差,两差之间做比值。
K:=SMA(RSV,3,1);//RSV的移动平均值
D:=SMA(K,3,1);//K的移动平均值
J:=3*K-2*D;
LC := REF(CLOSE,1);//前一周期收盘价
RSI1:=SMA(MAX(CLOSE-LC,0),6,1)/SMA(ABS(CLOSE-LC),6,1)*100;//当根K线收盘价与前一周期收盘价做差,在该差值与0之间取最大值,做N1周期移动平均。收盘价与前一周期收盘价做差值,取该差值的N1周期移动平均值,两平均值之间做比值。
RSI2:=SMA(MAX(CLOSE-LC,0),12,1)/SMA(ABS(CLOSE-LC),12,1)*100;//当根K线收盘价与前一周期收盘价做差,在该差值与0之间取最大值,做N2周期移动平均。收盘价与前一周期收盘价做差值,取该差值的N2周期移动平均值,两平均值之间做比值。
A1:=BARSLAST(REF(CROSS(DIFF,DEA),1));
B1:=REF(C,A1+1)>C AND REF(DIFF,A1+1)<DIFF AND CROSS(DIFF,DEA);
A2:=BARSLAST(REF(CROSS(K,D),1));
B2:=REF(C,A2+1)>C AND REF(K,A2+1)<D AND CROSS(K,D);
A3:=BARSLAST(REF(CROSS(RSI1,RSI2),1));
B3:=REF(C,A3+1)>C AND REF(RSI1,A3+1)<RSI1 AND CROSS(RSI1,RSI2);
C1:=BARSLAST(REF(CROSS(DEA,DIFF),1));
D1:=REF(C,C1+1)<C AND REF(DIFF,C1+1)>DIFF AND CROSS(DEA,DIFF);
C2:=BARSLAST(REF(CROSS(K,D),1));
D2:=REF(C,C2+1)<C AND REF(K,C2+1)>K AND CROSS(D,K);
C3:=BARSLAST(REF(CROSS(RSI2,RSI1),1));
D3:=REF(C,C3+1)<C AND REF(RSI1,C3+1)>RSI1 AND CROSS(RSI2,RSI1);
低位金叉:CROSS(DIFF,DEA) AND DIFF<-,NODRAW;
STICKLINE(低位金叉,0,DIFF,1,0),COLORRED;
DRAWTEXT(低位金叉,DIFF,' 低位金叉'),COLORRED;
DRAWTEXT(B1>0,MACD,'MACD底背'),COLORRED;
DRAWTEXT(B2>0,MACD,'KDJ底背'),COLORRED;
DRAWTEXT(B3>0,MACD*,'RSI底背'),COLORRED
文华期货软件指标文华财经指标公式源码期货做期货用什么指标最好 来自淘豆网m.daumloan.com转载请标明出处.