求大神将以下指标公式改为选股公式,通达信的,谢谢

2024-11-06 18:28:57
推荐回答(1个)
回答1:

公式是改过了也经通达信测试通过。因其中参数(N,M1,M2等)没给出,暂按系统公式参数设置,可根据您自己需要做相应调整。(以下为源码及附图)

 

【如果觉得对您有帮助,请采纳答案,谢谢】

 

RSV:=(CLOSE-LLV(LOW,9))/(HHV(HIGH,9)-LLV(LOW,9))*100;
K:=SMA(RSV,3,1);
D:=SMA(K,3,1);
多方:=IF((3*K-2*D)>0,(3*K-2*D),0)LINESTICK;
黄金坑:STICKLINE((3*K-2*D)<0,0,-2,3,0) COLORYELLOW;DRAWTEXT((3*K-2*D)<0,-1,'黄金坑');
LC:=REF(CLOSE,1);
RSI:(SMA(MAX(CLOSE-LC,0),6,1)/SMA(ABS(CLOSE-LC),6,1)*20)LINETHICK2  COLORRED;
MID:MA(RSI,5)LINETHICK2 COLORGREEN;
UPPER:MID+10*STD(RSI,5)LINETHICK2  COLORYELLOW;
LOWER:MID-10*STD(RSI,5)LINETHICK2 COLORBLUE;
IF(RSITYP:=(HIGH+LOW+CLOSE)/3;
CCI:=(TYP-MA(TYP,6))/(0.015*AVEDEV(TYP,6));
DRAWICON(CROSS(CCI,-100) AND (RSI>MID),1,24);
DRAWTEXT((CROSS(CCI,-100) AND (RSI>MID)),0,'CCI买');
MOBV:=OBV-MA(OBV,3); 
 OBV高:=REF(OBV,BARSLAST(FILTER(BACKSET(FILTER(REF(OBV,3)=HHV(OBV,2*3+1),3),3+1),3)));
C高:=REF(C,BARSLAST(FILTER(BACKSET(FILTER(REF(C,3)=HHV(C,2*3+1),3),3+1),3))),NODRAW;
量入为主:=CROSS(OBV,OBV高) AND HDRAWICON(量入为主,2,25); 
V1:=MA(C,3)=HHV(MA(C,3),7);
V2:=MA(C,3)>MA(C,5);
V3:=MA(V,5)>MA(V,10)*1.01;
V4:=COUNT(MA(C,1)>REF(C,1),2)=2;
LC20:=REF(CLOSE,1);
RSI20:=SMA(MAX(CLOSE-LC20,0),4.1,1)/SMA(ABS(CLOSE-LC20),4.1,1)*100;
 STICKLINE((CROSS(RSI20,11)*1)AND(RSI>MID),0,5,2,0),COLORYELLOW;
VAR3A:=3;
VAR2A:=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);MTM:=C-REF(C,1);
DX:=100*EMA(EMA(MTM,6),6)/EMA(EMA(ABS(MTM),6),6);
YXF:=IF(LLV(DX,2)=LLV(DX,7) AND COUNT(DX<0,2) AND CROSS(DX,MA(DX,2)),1,0);
加仓:IF(FILTER(YXF=1,3)AND(RSI>MID),5,0),STICK,COLORLIBLUE,LINETHICK3;
A51:=3*SMA((C-LLV(L,55))/(HHV(H,55)-LLV(L,55))*100,5,1)-2*SMA((C-LLV(L,55))/(HHV(H,55)-LLV(L,55))*100,5,1);
FY:=EMA(A51,5);A54:=((C-LLV(L,21))/(HHV(H,21)-LLV(L,21)))*100;TIM:=IF(C,1,0);
缩倍柱:=(VOL*1.95<=REF(VOL,1))*TIM;百日低量:=(VOL=LLV(VOL,10))*TIM;
倍量柱:=(VOL>=1.95*REF(VOL,1))*TIM;四日前倍量柱:=(REF(VOL,3)>1.95*REF(VOL,4))*TIM;
DRAWICON((VOL=LLV(VOL,50))*TIM AND(RSI>MID),0,1);吸货线:8,POINTDOT,LINETHICK2,COLORCYAN;
DRAWTEXT(ISLASTBAR,8,'加仓线'),COLORFF9900;强:10,POINTDOT,LINETHICK2,COLOR70DB93;
DRAWTEXT(ISLASTBAR,10,'强弱分界'),COLOR70DB93;卖:12,POINTDOT,LINETHICK2,COLORCYAN;
DRAWTEXT(ISLASTBAR,12,'减仓线'),COLORYELLOW;满:6,POINTDOT,LINETHICK2,COLORCYAN;
DRAWTEXT(ISLASTBAR,6,'建仓线'),COLORFFFFFF;清:14,POINTDOT,LINETHICK2,COLORCYAN;
DRAWTEXT(ISLASTBAR,14,'清仓线'),COLORFF00FF;SHOU:=IF(DATE<=1150520,1,0);
SHI:=BETWEEN((DCLOSE*SHOU)/(SUM(AMOUNT,BARSCOUNT((DCLOSE*SHOU)))/SUM(VOL*100,BARSCOUNT((DCLOSE*SHOU)))),1.05,0.95);
TOU:=IF(SHI=0,MA((DCLOSE*SHOU),BARSCOUNT((DCLOSE*SHOU))),(SUM(AMOUNT,BARSCOUNT((DCLOSE*SHOU)))/SUM(VOL*100,BARSCOUNT((DCLOSE*SHOU)))));
动力线:=EXPMA((DCLOSE/TOU),13);
XG:CROSS(动力线,1.03);