通达信版本的主力进出和资金进出改成选股公式的主要步骤:
主力进出场公式源码:
VAR1:=REF((LOW+OPEN+CLOSE+HIGH)/4,1);
VAR2:=SMA(ABS(LOW-VAR1),13,1)/SMA(MAX(LOW-VAR1,0),10,1);
VAR3:=EMA(VAR2,10);
VAR4:=LLV(LOW,33);
VAR5:=EMA(IF(LOW<=VAR4,VAR3,0),3) ;
主力进场:IF(VAR5>REF(VAR5,1),0,VAR5),COLORRED,NODRAW;
STICKLINE(VAR5>REF(VAR5,1),VAR5,0,3,0 ),COLORRED;
洗盘:IF(VAR5STICKLINE(VAR5VAR12:=SMA(ABS(VAR1-H),13,1)/SMA(MAX(VAR1-H,0),10,1);
VAR13:=EMA(VAR12,10);
VAR14:=HHV(H,33);
VAR15:=EMA(IF(H>=VAR14,VAR13,0),3);
主力出场:IF(VAR15STICKLINE(VAR15冲顶:IF(VAR15>REF(VAR15,1),VAR15,0),COLORFF00FF,POINTDOT,LINETHICK0;
STICKLINE(VAR15>REF(VAR15,1),0,VAR15,3,0),COLORFF00FF;
A1:=REF(CLOSE,2);
A2:=SMA(MAX(CLOSE-A1,0),7,1)/SMA(ABS(CLOSE-A1),7,1)*100;
波段介入点:IF(A2<19,19,0)COLORWHITE。
DIF:=EMA(CLOSE,13)-EMA(CLOSE,28);
DEA:=EMA(DIF,8);
MACD:=(DIF-DEA)*2;
STICKLINE((MACD > 0),0,MACD,3,3),COLORYELLOW;
STICKLINE((MACD <= 0),0,MACD,3,3),COLORGREEN;
VAR9:=((CLOSE-LLV(LOW,27))/(HHV(HIGH,27)-LLV(LOW,27)))*(100);
VAR10:=SMA(VAR9,3,1);
VAR11:=SMA(VAR10,3,1);
VAR12:=SMA(VAR11,3,1);
主力出现:DRAWICON(CROSS(VAR11,VAR12) AND (VAR11<40),0,1);
大概就是这样,你试试
DIF:=EMA(CLOSE,13)-EMA(CLOSE,28);
DEA:=EMA(DIF,8);
MACD:=(DIF-DEA)*2;
VAR9:=((CLOSE-LLV(LOW,27))/(HHV(HIGH,27)-LLV(LOW,27)))*(100);
VAR10:=SMA(VAR9,3,1);
VAR11:=SMA(VAR10,3,1);
VAR12:=SMA(VAR11,3,1);
主力出现:DRAWICON(CROSS(VAR11,VAR12) AND (VAR11<40),0,1);
不好意思,刚才的错了