9.从颜色上区分:红,蓝是主动;粉,绿是主力。
公式需要引用那其他的几个公式,请一起全部导入。
DRAWGBK(C>0, RGB(0,0,00),RGB(0,0,0),0,'H15',0);
DRAWBAND(MA(CLOSE,5),RGB(150,50,100),MA(CLOSE,10),RGB(83,123,68));
RSV:=(CLOSE-LLV(LOW,9))/(HHV(HIGH,9)-LLV(LOW,9))*100;
K:=SMA(RSV,3,1),LINETHICK0;
D:=SMA(K,3,1),LINETHICK0;
J:=3*K-2*D,LINETHICK0;
强弱界:MA(CLOSE,20),COLORCYAN,LINETHICK4;
上升趋势:IF(MA(CLOSE,20)>=REF(MA(CLOSE,20),1),MA(CLOSE,20),DRAWNULL),COLORMAGENTA,LINETHICK4;
{下降趋势:IF(MA(CLOSE,20)<REF(MA(CLOSE,20),1),MA(CLOSE,20),DRAWNULL),COLORCYAN,LINETHICK4;}
五日线:MA(CLOSE,5),LINETHICK3,COLORGREEN;
五日上升:IF(五日线>=REF(五日线,1),五日线,DRAWNULL),LINETHICK3,COLORRED;
十日线:MA(CLOSE,10),LINETHICK1,COLORWHITE;
生命线:MA(CLOSE,30),LINETHICK2,COLORRED;
六零线:MA(CLOSE,60),LINETHICK2,COLORWHITE;
{生命线:=EMA(CLOSE,20);}
STICKLINE(CLOSE>生命线 AND J>REF(J,1),OPEN,CLOSE,2,0),COLORRED;
STICKLINE(CLOSE>生命线 AND C>O AND J>REF(J,1),HIGH,LOW,0.1,0),COLORRED;
STICKLINE(CLOSE>生命线 AND C<O AND J>=REF(J,1),HIGH,LOW,0.05,0),COLORGREEN;
STICKLINE(CLOSE>生命线 AND J<REF(J,1),OPEN,CLOSE,2,0),COLORGRAY;
STICKLINE(CLOSE>生命线 AND C<O AND J<REF(J,1),HIGH,LOW,0.05,0),COLORGREEN;
STICKLINE(CLOSE>生命线 AND C>O AND {(J<K OR} J<REF(J,1),HIGH,LOW,0.05,0),COLORRED;
STICKLINE(CLOSE<生命线,OPEN,CLOSE,2,0),COLORGREEN;
STICKLINE(CLOSE<生命线 AND C>O,HIGH,LOW,0.05,0),COLORRED;
STICKLINE(CLOSE<生命线 AND C<O,HIGH,LOW,0.05,0),COLORGREEN;
{DRAWTEXTREL(5,20,STKLABEL+' '+STKNAME+' '+DYNAINFO(7)+'元'+' '+DYNAINFO(14)*100+'%'),LINETHICK2,COLORFFFF00;};
HD:=FILTER(BACKSET(FILTER(REF(C,10)=HHV(C,2*10+1),10),10+1),10);
LD:=FILTER(BACKSET(FILTER(REF(C,10)=LLV(C,2*10+1),10),10+1),10);
波峰:IF(BARSLAST(HD)<BARSLAST(LD) AND NOT(HD),REF(C,BARSLAST(HD)),REF(C,BARSLAST(HD))),COLORFF00FF,POINTDOT;
波谷:IF(BARSLAST(HD)>BARSLAST(LD) AND NOT(LD),REF(C,BARSLAST(LD)),REF(C,BARSLAST(LD))),COLOR80FF00,POINTDOT;
突破:=CROSS(C,波峰) AND VOL>MA(VOL,25) AND C/REF(C,1)>1.0143;
DRAWTEXT(突破,L*0.93,'突破'),COLORMAGENTA;
DRAWICON(突破,L*0.96,1);
DRAWTEXT_FIX(1,0.00,0,0,'所属行业:')COLOR00FFFF;
DRAWTEXT_FIX(1,0.06,0,0,HYBLOCK)COLOR00FFFF;
DRAWTEXT_FIX(1,0.14,0,0,'所属地区:')COLOR00FFFF;
DRAWTEXT_FIX(1,0.20,0,0,DYBLOCK)COLOR00FFFF;
DRAWTEXT_FIX(1,0.30,0.00,0,'主题投资:')COLOR00FFFF;
DRAWTEXT_FIX(1,0.36,0.00,0,EXTERNSTR(0,7))COLOR00FFFF;
DRAWTEXT_FIX(1,0.00,0.05,0,'主营业务:')COLOR00FFFF;
DRAWTEXT_FIX(1,0.06,0.05,0,EXTERNSTR(0,6))COLOR00FFFF;
DRAWTEXT_FIX(1,0.00,0.10,0,'解禁日期:')COLOR00FFFF;
DRAWTEXT_FIX(1,0.06,0.10,0,EXTERNSTR(0,8))COLOR00FFFF;
DRAWTEXT_FIX(1,0.00,0.15,0,'业绩预报:'),COLOR00FFFF;
DRAWTEXT_FIX(1,0.06,0.15,0,EXTERNSTR(0,3)),COLOR00FFFF;
{DRAWTEXT_FIX(1,0.980,20,1,'★分析家公式网'),COLOR666666; }
VAR111:=ZIG(3,10);
DRAWICON((REF(VAR111,2) > REF(VAR111,1)) AND (VAR111 > REF(VAR111,1)),LOW*0.98,5);
DRAWTEXT((REF(VAR111,2) > REF(VAR111,1)) AND (VAR111 > REF(VAR111,1)),LOW*0.95,'全仓'),COLORYELLOW;
DRAWICON((REF(VAR111,2) < REF(VAR111,1)) AND (VAR111 < REF(VAR111,1)),HIGH*1.03,15);
DRAWTEXT((REF(VAR111,2) < REF(VAR111,1)) AND (VAR111 < REF(VAR111,1)),HIGH*1.06,'清仓'),COLORYELLOW;
{全仓画红色K线主体,清仓画蓝色K线主体。}
STICKLINE((REF(VAR111,2)>REF(VAR111,1)) AND (VAR111>REF(VAR111,1)),CLOSE,OPEN,4,0),COLORYELLOW;
STICKLINE((REF(VAR111,2)<REF(VAR111,1)) AND (VAR111<REF(VAR111,1)),CLOSE,OPEN,4,0),COLORBLUE;
{在小于等于3个交易日,符合黄笑脸和全仓条件时,在屏幕左上角显示红色“进场”;符合跑人和清仓条件时,显示黄s“离场”。线的粗细不起作用
{DRAWTEXT_FIX(CURRBARSCOUNT<=3 AND REF(VAR111,2) > REF(VAR111,1)
AND VAR111 > REF(VAR111,1),0.00,0.28,0,'进场'),COLORRED;}
DRAWTEXT_FIX(CURRBARSCOUNT<=3 AND REF(VAR111,2) < REF(VAR111,1) AND VAR111 < REF(VAR111,1),0.00,0.28,0,'离场'),COLORYELLOW;
股价96:="Y395";
增幅96:=XMA(XMA(XMA(股价96,3),3),3)-REF(XMA(XMA(XMA(股价96,3),3),3),1);
X396:=XMA(股价96,3);
J396:=(XMA(股价96,3)*3+0.5*股价96-0.5*REF(股价96,1)+增幅96)/3;
Y396:IFF(CURRBARSCOUNT=1,J396,X396),LINETHICK4,COLORGREEN;
IF(Y396>REF(Y396,1),Y396,DRAWNULL),COLORRED,LINETHICK4;
高险区1:Y396*1.1,COLORLIRED,COLORFFFF00;
高风区2:Y396*1.125,COLORLIRED,COLORFF0000;
高风区3:Y396*1.15,COLORLIRED,COLOR00FF00;
良机区1:Y396*0.9,COLORLIBLUE,COLOR00FFFF;
良机区2:Y396*0.875,COLORLIBLUE,COLORFF00FF;
良机区3:Y396*0.85,COLOR0000FF;
JJJ:=IF(DYNAINFO(8)>0.01,0.01*DYNAINFO(10)/DYNAINFO(8),DYNAINFO(3));
DDD:=(DYNAINFO(5)<0.01 || DYNAINFO(6)<0.01);
JJJT:=IF(DDD,1,(JJJ<(DYNAINFO(5)+0.01) && JJJ>(DYNAINFO(6)-0.01)));
{CYC1:IF(JJJT,0.01*EXPMA(AMOUNT,P1)/EXPMA(VOL,P1),EMA((HIGH+LOW+CLOSE)/3,P1));
CYC2:IF(JJJT,0.01*EXPMA(AMOUNT,P2)/EXPMA(VOL,P2),EMA((HIGH+LOW+CLOSE)/3,P2));
CYC3:IF(JJJT,0.01*EXPMA(AMOUNT,P3)/EXPMA(VOL,P3),EMA((HIGH+LOW+CLOSE)/3,P3));}
{基础位移}
CYC∞:IF(JJJT,DMA(AMOUNT/(100*VOL),100*VOL/FINANCE(7)),EMA((HIGH+LOW+CLOSE)/3,120)),COLORBLUE,LINETHICK2;
{基础位移}
CYS∞:=(CLOSE-CYC∞)/CYC∞*100;
成本谷:=REF(CYC∞,BARSLAST(CYS∞<=0)-1),LINETHICK0,COLORRED;{赋值指标为最近一次刚上穿CYC∞时的CYC∞的数值}
负成本谷:=REF(CYC∞,BARSLAST(CYS∞>0)-1);
正基础位移:=100*(CLOSE-成本谷)/成本谷;
负基础位移:=100*(CLOSE-负成本谷)/负成本谷;
基础位移:=IF(CYS∞>=0,正基础位移,负基础位移),LINETHICK0,COLORYELLOW;
牛天数:=BARSLAST(CROSS(CYS∞,0))+1;
熊天数:=(-1)*BARSLAST(CROSS(0,CYS∞))-1;
牛熊天数:=IF(CYS∞>0,牛天数,熊天数),LINETHICK0,COLORMAGENTA;
DRAWTEXT_FIX(1,0.004,0.360,0,STRCAT('成本谷:',CON2STR(成本谷,2))),COLORWHITE;
DRAWTEXT_FIX(1,0.091,0.360,0,STRCAT('基础位移:',CON2STR(基础位移,2))),COLORWHITE;
DRAWTEXT_FIX(1,0.180,0.360,0,STRCAT('牛熊天数:',CON2STR(牛熊天数,0))),COLORWHITE;
{以下LCY有较大修改}
超B:=L2_AMO(0,2)/10000.0;
大B:=L2_AMO(1,2)/10000.0;
中B:=L2_AMO(2,2)/10000.0;
小B:=L2_AMO(3,