当前位置:首页 > 通达信 > 正文

【通达信源码分享】精品指标公式-主力动向源码

2023-04-15未知 编 辑:掌上指标


公式源码:
 
 
 
量:V,VOLSTICK;
 
PJJ:=DMA((((HIGH + LOW) + (CLOSE * 2)) / 4),0.9);
 
JJ:=REF(EMA(PJJ,3),1);
 
QJJ:=(VOL / (((HIGH - LOW) * 2) - ABS((CLOSE - OPEN)))); XVL:=(IF((CLOSE > OPEN),(QJJ * (HIGH - LOW)),IF((CLOSE < OPEN),(QJJ * ((HIGH - OPEN) + (CLOSE - LOW))),(VOL / 2))) + IF((CLOSE > OPEN)
 
,(0 - (QJJ * ((HIGH - CLOSE) + (OPEN - LOW)))),IF((CLOSE < OPEN),(0 - (QJJ * (HIGH - LOW))),(0 - (VOL / 2)))));
 
ZLL:=(VOL / CAPITAL);
 
HSL1:=IF((ZLL > 10),10,ZLL);
 
HSL:=((XVL / 20) / 1.15); 
 
进攻流量:=(((HSL * 0.55) + (REF(HSL,1) * 0.33)) + (REF(HSL,2) * 0.22));
 
GJJ:=EMA(进攻流量,8); LLJX:=EMA(进攻流量,3);
 
动态天量:=CONST(IF(V=HHV(V,20),V,REF(V,BARSLAST(V=HHV(V,20))))),COLOR00FF00,POINTDOT;
 
STICKLINE(((HSL * 0.4) >= 0),动态天量+((HSL * 0.4) +LLJX)*20,动态天量,3,0),COLORYELLOW;
 
STICKLINE(((HSL * 0.4) < 0),动态天量+((HSL * 0.4) +LLJX)*20,动态天量,3,0),COLOR00FF00;
 
资金流入:=IF((HSL*0.4+LLJX)>0,(HSL*0.4+LLJX),DRAWNULL),COLORRED;
 
资金流出:=IF((HSL*0.4+LLJX)<0,(HSL*0.4+LLJX),DRAWNULL),COLOR00FF00;
 
资金收支:=(HSL*0.4+LLJX),LINETHICK0;
 
万元:=AMOUNT/10000{0000},VOLSTICK,COLORFF00FF;
 
资金净收支:IF((HSL*0.4+LLJX)>0,资金流入,资金流出),COLORWHITE,POINTDOT;
 
收支比例%:IF((HSL*0.4+LLJX)>0,资金流入/万元*100,资金流出/万元*100),COLORYELLOW;
 
连红天1:=BARSLASTCOUNT(资金净收支>0),,COLORA20FFD,NODRAW;
 
连红天2:=IF(连红天1=0,REF(连红天1,1),连红天1),,COLORA20FFD,NODRAW;
 
连红天3:=IF(连红天2=0,REF(连红天1,2),连红天2),,COLORA20FFD,NODRAW;
 
连红天4:=IF(连红天3=0,REF(连红天1,3),连红天3),,COLORA20FFD,NODRAW;
 
近期连红天:IF(连红天4=0,REF(连红天1,4),连红天4),,COLORYELLOW,NODRAW; 
 
三日资金:SUM(资金收支,3),COLORWHITE,NODRAW;
 
五日资金:SUM(资金收支,5),COLORFF00FF,NODRAW; 
 
十日资金:SUM(资金收支,10),COLOR0000FF,NODRAW;
 
资金流量:=LLJX,LINETHICK0,COLOR0000FF;
 
STICKLINE((资金流量 > 0),动态天量+资金流量*20,动态天量,3,0),COLOR0000FF;
 
STICKLINE((资金流量 < 0),动态天量+资金流量*20,动态天量,3,0),COLOR008000;
 
 
 
 
 
 
 
MID:=(3*CLOSE+LOW+OPEN+HIGH)/6;
 
主力:(20*MID+19*REF(MID,1)+18*REF(MID,2)+17*REF(MID,3)+
 
16*REF(MID,4)+15*REF(MID,5)+14*REF(MID,6)+
 
13*REF(MID,7)+12*REF(MID,8)+11*REF(MID,9)+
 
10*REF(MID,10)+9*REF(MID,11)+8*REF(MID,12)+
 
7*REF(MID,13)+6*REF(MID,14)+5*REF(MID,15)+
 
4*REF(MID,16)+3*REF(MID,17)+2*REF(MID,18)+REF(MID,20))/210,COLORRED;
 
 
 
IF(主力>=REF(主力,1),主力,DRAWNULL),COLORFF00FF,LINETHICK3;
 
IF(主力<=REF(主力,1),主力,DRAWNULL),COLORGREEN,LINETHICK3;
 
 
 
 
 
A7:=C-REF(C,1);
 
A8:=100*EMA(EMA(A7,6),6)/EMA(EMA(ABS(A7),6),6);
 
进:(LLV(A8,2)=LLV(A8,7) AND COUNT(A8<0,2) AND CROSS(A8,MA(A8,2))),STICK,COLORRED;
 
 
 
DRAWICON(进>0,进,23);
 
 
 
VAR1:=1;
 
 VAR2:=((((2*CLOSE)+HIGH)+LOW) / 4);
 
 
 
 VAR4:=LLV(LOW,5);
 
 VAR5:=HHV(HIGH,4);
 
 C1:=(EMA((((VAR2-VAR4)/(VAR5-VAR4))*100),4)*VAR1);
 
 C2:=(EMA(((0.667*REF(C1,1))+(0.333*C1)),2)*VAR1);
 
卖1:IF( CROSS(C2,C1),C2,DRAWNULL)COLORFFFF15,STICK;
 
 
 
DRAWICON(卖1>0,卖1,35);
 
 F1_:=IF(CROSS(C2,C1),C2,DRAWNULL);
 
 
 
底:IF( CROSS(C1,C2),C1,DRAWNULL),STICK,COLORRED;
 
 
 
DRAWICON(底>0,底,34);
 
 F2_:=IF(CROSS(C1,C2),C1,DRAWNULL);
 
 
 
条件:=CROSS(C1,C2) AND C1<40;
 
条件0:=CROSS(C2,C1) AND C1>90;
 
 TJ1:=CROSS(C1,C2);
 
 TJ2:=CROSS(C2,C1);
 
 TJ3:=CROSS(C1,C2) AND REF(C1,1)<20;
 
 TJ4:=CROSS(C2,C1) AND REF(C1,1)>80;
 
 
 
最新:C,COLORFFFFFF,CIRCLEDOT,NODRAW;
 
 IF(C>=REF(C,1),C,DRAWNULL),COLORRED,CIRCLEDOT,NODRAW;
 
 AA10:=SUM(AMOUNT,BARSCOUNT(C))/SUM(VOL*100,BARSCOUNT(C));
 
 BB10:=BETWEEN(C/AA10,C+H,C-H);
 
 DRAWICON(ISLASTBAR AND C>REF(C,1),C,1);
 
 DRAWICON(ISLASTBAR AND C<REF(C,1),C,2);
 
大家都爱看
查看更多热点新闻
点击进入掌上指标资源网-下载各类指标