以下是通达信多空博弈修正源码副图贴图)
该指标为参考网上的经修改优化而成,图中洋红色曲线持股,绿色持币。其他自己也能看懂。
买线:=EMA(C,2);
卖线:=EMA(SLOPE(C,21)*20+C,42);
STICKLINE(买线>=卖线,-50+REFDATE(HHV(H,0),DATE)/5,-50+REFDATE(LLV(L,0),DATE)/5,6,0),COLORLIMAGENTA;
STICKLINE(买线<卖线,-50+REFDATE(HHV(H,0),DATE)/5,-50+REFDATE(LLV(L,0),DATE)/5,6,0),COLORLIBLUE;
RSV:=((((HHV(HIGH,10) - CLOSE) / (HHV(HIGH,10) - LLV(LOW,10))) * 200) - 125);
散户:=SMA(RSV,5,1)+15{,COLORGREEN,LINETHICK1};
RSV1:=((((CLOSE - LLV(LOW,10)) / (HHV(HIGH,10) - LLV(LOW,10))) * 200) - 105);
主力:SMA(RSV1,5,1)+15,COLORLIRED,LINETHICK1;
买进:IF(主力>REF(主力,1),主力,DRAWNULL),COLORMAGENTA,LINETHICK3;
{持币:IF(散户>REF(散户,1),散户,DRAWNULL),COLORGREEN,LINETHICK3;}
持币:IF(主力<REF(主力,1),主力,DRAWNULL),COLORGREEN,LINETHICK3;
{P(10,1,100),A(5,1,100);}
SVOL:=INTPART(SUM(V,0)/CAPITAL);
TJ0:=SVOL>REF(SVOL,1) OR BARSSINCE(CLOSE)=0;
S1:=BARSLAST(TJ0)+1;
TJ2:=S1<REF(S1,1);
S2:=IF(TJ2,REF(S1,1)+1,S1);
S3:=SUM(TJ2,0);
ZK1:="KD.K#WEEK"(9,3,3);
ZD2:="KD.D#WEEK"(9,3,3);
Z,1:="MACD.DIF#WEEK"(12,26,9);
ZA2:="MACD.DEA#WEEK"(12,26,9);
换手:=V/CAPITAL*100,LINETHICK0;
JCD:=FILTER(CROSS(ZK1,ZD2) AND REF(ZD2,1)<30,13),NODRAW;
取点:=BARSLAST(JCD);
吸筹区:=IF(取点>0 AND 取点<61,取点,0);
ZS1:=吸筹区;
ZS2:=吸筹区+1;
ZS3:=换手/5;
ZSA:=IF(ZS1>0,SUM((ZS3),吸筹区+1),0),NODRAW;
主力筹码%:ZSA,NODRAW;
建仓天数:ZS1,NODRAW;
阶段总额(万):=SUM(AMOUNT/10000,S2)*100,NODRAW;
阶段总量(手):=SUM(V,S2)*100,NODRAW;
阶段成本(元):(阶段总额(万)/(阶段总量(手)/100)),NODRAW;
换手冷清:STICKLINE(换手<3,-80,(换手+5-40)*2,0.0,0),COLORCYAN;
青换手冷清:(换手<3,-80,(换手-6)*4,0.0,0),COLORCYAN;
换手活跃:STICKLINE(换手>=3 AND 换手<7,-80,(换手+5-40)*2,0.0,0),COLORYELLOW;
黄换手活跃:(换手>=3 AND 换手<7,-80,(换手-6)*4,0.0,0),COLORYELLOW;
换手热烈:STICKLINE(换手>=7,-80,(换手+5-40)*2,0.5,0),COLORRED;
红换手热烈:(换手>=7,-80,(换手-6)*4,0.5,0),COLORRED;
STICKLINE(JCD,(0-6)*4,6*6,0.5,0),COLORGREEN;
DRAWTEXT(建仓天数,40,'建仓'),COLORGREEN;
LL:=REF(CLOSE,1);
MM:=SMA(MAX(CLOSE-LL,0),6,1)/SMA(ABS(CLOSE-LL),6,1)*100;
出:IF(CROSS(80,MM),90,100),COLORCYAN;
DRAWTEXT(CROSS(80,MM),MM,'卖 '),COLORWHITE;
DRAWTEXT(CROSS(主力,散户),0,'买 '),COLORRED;
AA:=(WINNER((CLOSE + ((CLOSE * 15) / 100))) * 100);
BB:=(WINNER((CLOSE + ((CLOSE * 0) / 100))) * 100);
CC:=(AA - BB);
DD:=((WINNER((CLOSE - ((CLOSE * 0.1) / 100))) - WINNER((CLOSE - ((CLOSE * 15) / 100)))) * 100);
EE:=(((CC < 3) AND (DD < 0.5)) AND (OPEN > LOW));
A1:=DYNAINFO(6);
A22:=IF((LOW > A1),0,IF((HIGH < A1),1,(((A1 - LOW) + 0.01) / ((HIGH - LOW) + 0.01))));
A3:=(VOL / WINNER(LOW));
A4:=REF(HHV(CLOSE,120),1);
A5:=REF(LLV(CLOSE,120),1);
A6:=((100 * (CLOSE - A5)) / (A4 - A5));
A7:=((A22 > 0) OR (A22 = 1));
A8:=((A7 AND ((A3 / REF(A3,3)) >= 3)) AND (A6 < 80));
A9:=(((REF(A8,1) OR REF(A8,2)) OR REF(A8,3)) OR REF(A8,4));
A10:=(A8 AND A9);
A11:=IF(FILTER(A8,3),5,0);
A12:=IF((FILTER(A10,3) OR EE),10,0);
进场:STICKLINE(A11,-48,-33,2.5,0),COLORFF7700;
加仓:STICKLINE(A12,-48,-20,2.5,0),COLORFF00FF;
STICKLINE(A11,-48,-33,2.2,0),COLORFF7700;
STICKLINE(A11,-48,-33,1.7,0),COLORFFDD00;
STICKLINE(A11,-48,-33,0.7,0),COLORFFEE00;
STICKLINE(A12,-48,-20,2.2,0),COLOR102066;
STICKLINE(A12,-48,-20,1.7,0),COLOR1020AA;
STICKLINE(A12,-48,-20,0.7,0),COLOR1020FF;
DRAWTEXT(进场=5,-33,'进场'),COLORFFFF00;
DRAWTEXT(加仓=10,-20,'加仓'),COLORFFFFFF;
VAR2L:=REF(LOW,1);
VAR3L:=SMA(ABS(LOW-VAR2L),3,1)/SMA(MAX(LOW-VAR2L,0),3,1)*110;
VAR4L:=EMA(IF(CLOSE*1.3,VAR3L*10,VAR3L/10),3);
VAR5L:=LLV(LOW,13);
VAR6L:=HHV(VAR4L,13);
VAR7L:=IF(MA(CLOSE,34),1,0);
VAR8L:=EMA(IF(LOW<=VAR5L,(VAR4L+VAR6L*2)/2,0),3)/618*VAR7L;
VAR9LL:=IF(VAR8L>110,110,VAR8L);
STICKLINE(VAR9LL<REF(VAR9LL,1),48,48+VAR9LL,0.5,0),COLORYELLOW;
RSV2:=(CLOSE-LLV(LOW,9))/(HHV(HIGH,9)-LLV(LOW,9))*100;
K:=SMA(RSV2,2,1);
D:=SMA(K,2,1);
J:=3*K-2*D;
J1:=REVERSE(J);
AA1:=REF(MA(C,1),10)>REF(MA(C,60),10);
买点:CROSS(J,J1) AND AA1,NODRAW;
STICKLINE(买点,0,30,5,0),COLOR0000FF;
STICKLINE(买点,30,55,3,0),COLORWHITE;
STICKLINE(买点,55,80,1,0),COLORYELLOW;
DRAWTEXT(买点,40,'庄现!'),COLORFF00FF;
买:IF(CROSS(K,D)AND AA1,10,0),COLORLIMAGENTA;