通达信超级短期指标【MACD 机买 主力差 超级短】
DIFF:=EMA(CLOSE,7) - EMA(CLOSE,19);
DEA:=EMA(DIFF,9);
MACD:=2*(DIFF-DEA);
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("KDJ.K"(9,3,3),"KDJ.D"(9,3,3)),1));
B2:=REF(C,A2+1)>C AND REF("KDJ.K"(9,3,3),A2+1)<"KDJ.K"(9,3,3) AND CROSS("KDJ.K"(9,3,3),"KDJ.D"(9,3,3));
A3:=BARSLAST(REF(CROSS("RSI.RSI1"(6,12,24),"RSI.RSI2"(6,12,24)),1));
B3:=REF(C,A3+1)>C AND REF("RSI.RSI1"(6,12,24),A3+1)<"RSI.RSI1"(6,12,24) AND CROSS("RSI.RSI1"(6,12,24),"RSI.RSI2"(6,12,24));
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("KDJ.D"(9,3,3),"KDJ.K"(9,3,3)),1));
D2:=REF(C,C2+1)<C AND REF("KDJ.K"(9,3,3),C2+1)>"KDJ.K"(9,3,3) AND CROSS("KDJ.D"(9,3,3),"KDJ.K"(9,3,3));
C3:=BARSLAST(REF(CROSS("RSI.RSI2"(6,12,24),"RSI.RSI1"(6,12,24)),1));
D3:=REF(C,C3+1)<C AND REF("RSI.RSI1"(6,12,24),C3+1)>"RSI.RSI1"(6,12,24) AND CROSS("RSI.RSI2"(6,12,24),"RSI.RSI1"(6,12,24));
{MACD底背:=IF(B1>0,-0.1,0);
KDJ底背:=IF(B2>0,-0.1,0);
RSI底背:=IF(B3>0,-0.1,0);}
MACD顶背:=IF(D1>0,0.1,0);
KDJ顶背:=IF(D2>0,0.1,0);
RSI顶背:=IF(D3>0,0.1,0);
VARA1:=(DVOL/C)/2;
VARA2:=SUM(IF(VARA1>100 AND CLOSE>REF(CLOSE,1),VARA1,0),0);
VARA3:=SUM(IF(VARA1>100 AND CLOSE<REF(CLOSE,1),VARA1,0),0);
VARA4:=SUM(IF(VARA1<100 AND CLOSE>REF(CLOSE,1),VARA1,0),0);
VARA5:=SUM(IF(VARA1<100 AND CLOSE<REF(CLOSE,1),VARA1,0),0);
VARA6:=VARA2+VARA3+VARA4+VARA5;
机买:=(VARA2/VARA6)*100;
机卖:=(VARA3/VARA6)*100;
主力差:=机买-机卖;
强度:=主力差-REF(主力差,1);
近期:=强度>1.5;
VAR1:=(CLOSE-LLV(LOW,60))/(HHV(HIGH,60)-LLV(LOW,60))*80;
B:=SMA(VAR1,7,1);
VAR2:=SMA(B,5,1);
短买:=CROSS(B,VAR2) AND B<40;
超级短:近期;
未来函数检测结果如下:
该公式包含未来函数:DVOL
解密、编写股票、期货策略请联系QQ或微信同号:88652583
相关股票指标公式
原理解析:
DIFF赋值:收盘价的7日指数移动平均 - 收盘价的19日指数移动平均
DEA赋值:DIFF的9日指数移动平均
MACD赋值:2*(DIFF-DEA)
A1赋值:上次1日前的DIFF上穿DEA距今天数
B1赋值:A1+1日前的C>C AND A1+1日前的DIFF
A2赋值:上次REF(CROSS("KDJ.K"(9,3,3距今天数,"KDJ.D"(9,3,3)),1))
B2赋值:A2+1日前的C>C AND REF("KDJ.K"(9,3,3),A2+1)<"KDJ.K"(9,3,3) AND CROSS("KDJ.K"(9,3,3),"KDJ.D"(9,3,3))
A3赋值:上次REF(CROSS("RSI.RSI1"(6,12,24距今天数,"RSI.RSI2"(6,12,24)),1))
B3赋值:A3+1日前的C>C AND REF("RSI.RSI1"(6,12,24),A3+1)<"RSI.RSI1"(6,12,24) AND CROSS("RSI.RSI1"(6,12,24),"RSI.RSI2"(6,12,24))
C1赋值:上次1日前的DEA上穿DIFF距今天数
D1赋值:C1+1日前的CDIFF AND DEA上穿DIFF
C2赋值:上次REF(CROSS("KDJ.D"(9,3,3距今天数,"KDJ.K"(9,3,3)),1))
D2赋值:C2+1日前的C"KDJ.K"(9,3,3) AND CROSS("KDJ.D"(9,3,3),"KDJ.K"(9,3,3))
C3赋值:上次REF(CROSS("RSI.RSI2"(6,12,24距今天数,"RSI.RSI1"(6,12,24)),1))
D3赋值:C3+1日前的C"RSI.RSI1"(6,12,24) AND CROSS("RSI.RSI2"(6,12,24),"RSI.RSI1"(6,12,24))
如果B1>0返回-0.1否则返回0
如果B2>0返回-0.1否则返回0
如果B3>0返回-0.1否则返回0
如果D1>0返回0.1否则返回0
如果D2>0返回0.1否则返回0
如果D3>0返回0.1否则返回0
VARA1赋值:(D成交量/C)/2
VARA2赋值:SUM(IF(VARA1>100 AND 收盘价>1日前的收盘价,VARA1,0),0)
VARA3赋值:SUM(IF(VARA1>100 AND 收盘价<1日前的收盘价,VARA1,0),0)
VARA4赋值:SUM(IF(VARA1<100 AND 收盘价>1日前的收盘价,VARA1,0),0)
VARA5赋值:SUM(IF(VARA1<100 AND 收盘价<1日前的收盘价,VARA1,0),0)
VARA6赋值:VARA2+VARA3+VARA4+VARA5
机买赋值:(VARA2/VARA6)*100
机卖赋值:(VARA3/VARA6)*100
主力差赋值:机买-机卖
强度赋值:主力差-1日前的主力差
近期赋值:强度>1.5
VAR1赋值:(收盘价-60日内最低价最低值)/(60日内最高价最高值-60日内最低价最低值)*80
VAR1的7日[1日权重]移动平均
B的5日[1日权重]移动平均
短买赋值:B上穿VAR2 AND B<40
输出
超级短:近期