通达信龙头筹码筹码类公式红柱表示上升趋势公式副图源码

[复制链接]
查看109 | 回复0 | 2021-8-26 21:26:08 | 显示全部楼层 |阅读模式

以下是通达信龙头筹码筹码类公式红柱表示上升趋势公式副图源码(无源码的请下载附件导入)

龙头筹码,这是一个筹码类公式 红柱表示上升趋势
{C龙头筹码}

N:=9;M1:=3;M2:=3;
MA3:=MA(CLOSE,3);
MA5:=MA(CLOSE,5);
MA10:=MA(CLOSE,10);
MA20:=MA(CLOSE,20);
MA30:=MA(CLOSE,30);
MA60:=MA(CLOSE,60);

获利盘:WINNER(CLOSE*0.9)*100,COLORRED,LINETHICK0;
套牢盘:100-WINNER(CLOSE*1.1)*100,COLORGREEN,LINETHICK0;
浮动筹码:100-获利盘-套牢盘,COLORYELLOW,LINETHICK0;

STICKLINE(1,获利盘,获利盘+浮动筹码,2,0),COLORYELLOW;{YELLOW}
STICKLINE(1,0,获利盘,2,0),COLORRED;
STICKLINE(1,获利盘+浮动筹码,100,2,0),COLORGREEN;

获利盘10:MA(获利盘,10),COLORMAGENTA,LINETHICK0;{2}
套牢盘10:MA(套牢盘,10),COLORGREEN,LINETHICK0;{2}
浮动筹码10:MA(浮动筹码,10),COLORCYAN,LINETHICK0;{2}

{绘制小图标}
X_1:=(CLOSE-LLV(LOW,N))/(HHV(HIGH,N)-LLV(LOW,N))*100;
X_2:=SMA(X_1,M1,1);
X_3:=SMA(X_2,M2,1);
X_4:=3*X_2-2*X_3;
X_5:=5;
X_6:=4*SMA((CLOSE-LLV(LOW,X_5))/(HHV(HIGH,X_5)-LLV(LOW,X_5))*100,5,1)-3*SMA(SMA((CLOSE-LLV(LOW,X_5))/(HHV(HIGH,X_5)-LLV(LOW,X_5))*100,5,1),3.2,1);
X_7:=8;
X_8:=IF(CROSS(X_6,X_7),80,0);
X_9:=IF(X_6<=15,25,0);

DRAWICON(X_9=25,0.5,24);
DRAWICON(X_8=80,0.5,25);

X_10:=LLV(LOW,27);
X_11:=HHV(HIGH,34);
X_12:=EMA((CLOSE-X_10)/(X_11-X_10)*4,4)*25;
X_13:=HHV(HIGH,55)-LLV(LOW,55);
X_14:=SMA((CLOSE-LLV(LOW,55))/X_13*100,5,1);
X_15:=EMA(3*X_14-2*SMA(X_14,3,1),3)-REF(EMA(3*X_14-2*SMA(X_14,3,1),3),1)>0;
X_16:=EMA(3*X_14-2*SMA(X_14,3,1),3)-REF(EMA(3*X_14-2*SMA(X_14,3,1),3),1)<0;
X_17:=(EMA(3*X_14-2*SMA(X_14,3,1),3)-REF(EMA(3*X_14-2*SMA(X_14,3,1),3),1))/REF(EMA(3*X_14-2*SMA(X_14,3,1),3)-REF(EMA(3*X_14-2*SMA(X_14,3,1),3),1),1)>1;
X_18:=(EMA(3*X_14-2*SMA(X_14,3,1),3)-REF(EMA(3*X_14-2*SMA(X_14,3,1),3),1))/REF(EMA(3*X_14-2*SMA(X_14,3,1),3)-REF(EMA(3*X_14-2*SMA(X_14,3,1),3),1),1)<1 AND (EMA(3*X_14-2*SMA(X_14,3,1),3)-REF(EMA(3*X_14-2*SMA(X_14,3,1),3),1))/REF(EMA(3*X_14-2*SMA(X_14,3,1),3)-REF(EMA(3*X_14-2*SMA(X_14,3,1),3),1),1)>0;
X_19:=(EMA(3*X_14-2*SMA(X_14,3,1),3)-REF(EMA(3*X_14-2*SMA(X_14,3,1),3),1))/REF(EMA(3*X_14-2*SMA(X_14,3,1),3)-REF(EMA(3*X_14-2*SMA(X_14,3,1),3),1),1)<0 AND X_15 AND EMA(3*X_14-2*SMA(X_14,3,1),3)<97 AND EMA(3*X_14-2*SMA(X_14,3,1),3)>0;
X_20:=X_19 AND REF(X_16,2) OR (REF(X_19,1) AND X_15);

X_21:=(EMA(3*X_14-2*SMA(X_14,3,1),3)-REF(EMA(3*X_14-2*SMA(X_14,3,1),3),1))/REF(EMA(3*X_14-2*SMA(X_14,3,1),3)-REF(EMA(3*X_14-2*SMA(X_14,3,1),3),1),1)<0 AND X_15 AND REF(X_16,2) AND EMA(3*X_14-2*SMA(X_14,3,1),3)<99 AND EMA(3*X_14-2*SMA(X_14,3,1),3)>0;
X_22:=(EMA(3*X_14-2*SMA(X_14,3,1),3)-REF(EMA(3*X_14-2*SMA(X_14,3,1),3),1))/REF(EMA(3*X_14-2*SMA(X_14,3,1),3)-REF(EMA(3*X_14-2*SMA(X_14,3,1),3),1),1)<0 AND X_16 AND REF(X_15,2) AND EMA(3*X_14-2*SMA(X_14,3,1),3)>50;
X_23:=EMA(3*X_14-2*SMA(X_14,3,1),3)-REF(EMA(3*X_14-2*SMA(X_14,3,1),3),1)-REF(EMA(3*X_14-2*SMA(X_14,3,1),3)-REF(EMA(3*X_14-2*SMA(X_14,3,1),3),1),1)>0;
X_24:=X_15 AND X_18 AND EMA(3*X_14-2*SMA(X_14,3,1),3)>60;
X_25:=X_16 AND X_17 AND EMA(3*X_14-2*SMA(X_14,3,1),3)>40;
X_26:=X_16 AND X_18 AND EMA(3*X_14-2*SMA(X_14,3,1),3)<30;
X_27:=CLOSE=REF(CLOSE,1);
X_28:=CLOSE>REF(CLOSE,1);
TT1:=EMA(IF(EMA(SUM(IF(X_27,0,IF(X_28,VOL,-VOL)),0),3)-MA(SUM(IF(X_27,0,IF(X_28,VOL,-VOL)),0),9)>0,EMA(SUM(IF(X_27,0,IF(X_28,VOL,-VOL)),0),3)-MA(SUM(IF(X_27,0,IF(X_28,VOL,-VOL)),0),9),0),3);
TT2:=EMA(IF(EMA(SUM(IF(X_27,0,IF(X_28,VOL,-VOL)),0),3)-MA(SUM(IF(X_27,0,IF(X_28,VOL,-VOL)),0),9)>0,EMA(SUM(IF(X_27,0,IF(X_28,VOL,-VOL)),0),3)-MA(SUM(IF(X_27,0,IF(X_28,VOL,-VOL)),0),9),0),3);
TT4:=EMA(IF(EMA(SUM(IF(X_27,0,IF(X_28,VOL,-VOL)),0),3)-MA(SUM(IF(X_27,0,IF(X_28,VOL,-VOL)),0),9)>0,EMA(SUM(IF(X_27,0,IF(X_28,VOL,-VOL)),0),3)-MA(SUM(IF(X_27,0,IF(X_28,VOL,-VOL)),0),9),0),3);

X_29:=IF(TT1>=VOL,VOL,IF(TT2<VOL,EMA(IF(EMA(SUM(IF(X_27,0,IF(X_28,VOL,-VOL)),0),3)-MA(SUM(IF(X_27,0,IF(X_28,VOL,-VOL)),0),9)>0,EMA(SUM(IF(X_27,0,IF(X_28,VOL,-VOL)),0),3)-MA(SUM(IF(X_27,0,IF(X_28,VOL,-VOL)),0),9),0),3),0));
X_30:=REF(EMA(DMA((HIGH+LOW+CLOSE*2)/4,0.9),3),1);
TT3:=IF(CLOSE>OPEN,VOL/((HIGH-LOW)*2-ABS(CLOSE-OPEN))*(HIGH-LOW),IF(CLOSE<OPEN,VOL/((HIGH-LOW)*2-ABS(CLOSE-OPEN))*(HIGH-OPEN+(CLOSE-LOW)),VOL/2));
X_31:=TT3+IF(CLOSE>OPEN,0-VOL/((HIGH-LOW)*2-ABS(CLOSE-OPEN))*(HIGH-CLOSE+(OPEN-LOW)),IF(CLOSE<OPEN,0-VOL/((HIGH-LOW)*2-ABS(CLOSE-OPEN))*(HIGH-LOW),0-VOL/2));
X_32:=IF(VOL/CAPITAL>10,10,VOL/CAPITAL);
X_33:=EMA(X_31/20/1.15*0.55+REF(X_31/20/1.15,1)*0.33+REF(X_31/20/1.15,2)*0.22,8);
X_34:=CONST(IF(VOL=HHV(VOL,9),VOL,REF(VOL,BARSLAST(VOL=HHV(VOL,9)))));
TT6:=REF(EMA(IF(EMA(SUM(IF(X_27,0,IF(X_28,VOL,-VOL)),0),3)-MA(SUM(IF(X_27,0,IF(X_28,VOL,-VOL)),0),9)>0,EMA(SUM(IF(X_27,0,IF(X_28,VOL,-VOL)),0),3)-MA(SUM(IF(X_27,0,IF(X_28,VOL,-VOL)),0),9),0),3),1);
X_35:=IF(TT4>TT6 AND MA3>REF(MA3,1),X_29/1000,0);
X_36:=(X_31/20/1.15*0.4+EMA(X_31/20/1.15*0.55+REF(X_31/20/1.15,1)*0.33+REF(X_31/20/1.15,2)*0.22,3))/1000-REF((X_31/20/1.15*0.4+EMA(X_31/20/1.15*0.55+REF(X_31/20/1.15,1)*0.33+REF(X_31/20/1.15,2)*0.22,3))/1000,1)>0;
X_37:=EMA(X_31/20/1.15*0.55+REF(X_31/20/1.15,1)*0.33+REF(X_31/20/1.15,2)*0.22,3)/1000-REF(EMA(X_31/20/1.15*0.55+REF(X_31/20/1.15,1)*0.33+REF(X_31/20/1.15,2)*0.22,3)/1000,1)>0;
X_38:=(X_31/20/1.15*0.4+EMA(X_31/20/1.15*0.55+REF(X_31/20/1.15,1)*0.33+REF(X_31/20/1.15,2)*0.22,3))/1000-REF((X_31/20/1.15*0.4+EMA(X_31/20/1.15*0.55+REF(X_31/20/1.15,1)*0.33+REF(X_31/20/1.15,2)*0.22,3))/1000,1)>0;
X_39:=EMA(X_31/20/1.15*0.55+REF(X_31/20/1.15,1)*0.33+REF(X_31/20/1.15,2)*0.22,3)/1000-REF(EMA(X_31/20/1.15*0.55+REF(X_31/20/1.15,1)*0.33+REF(X_31/20/1.15,2)*0.22,3)/1000,1)>0 AND X_36;
X_40:=EMA(X_31/20/1.15*0.55+REF(X_31/20/1.15,1)*0.33+REF(X_31/20/1.15,2)*0.22,3)/1000-REF(EMA(X_31/20/1.15*0.55+REF(X_31/20/1.15,1)*0.33+REF(X_31/20/1.15,2)*0.22,3)/1000,1)>0 OR X_36;
X_41:=EMA(X_31/20/1.15*0.55+REF(X_31/20/1.15,1)*0.33+REF(X_31/20/1.15,2)*0.22,3)/1000>0 AND (X_31/20/1.15*0.4+EMA(X_31/20/1.15*0.55+REF(X_31/20/1.15,1)*0.33+REF(X_31/20/1.15,2)*0.22,3))/1000>0;
TT7:=(X_31/20/1.15*0.4+EMA(X_31/20/1.15*0.55+REF(X_31/20/1.15,1)*0.33+REF(X_31/20/1.15,2)*0.22,3))/1000>REF((X_31/20/1.15*0.4+EMA(X_31/20/1.15*0.55+REF(X_31/20/1.15,1)*0.33+REF(X_31/20/1.15,2)*0.22,3))/1000,1);
TT8:=EMA(X_31/20/1.15*0.55+REF(X_31/20/1.15,1)*0.33+REF(X_31/20/1.15,2)*0.22,3)/1000>REF(EMA(X_31/20/1.15*0.55+REF(X_31/20/1.15,1)*0.33+REF(X_31/20/1.15,2)*0.22,3)/1000,1);
X_42:=COUNT(TT7-ABS(REF((X_31/20/1.15*0.4+EMA(X_31/20/1.15*0.55+REF(X_31/20/1.15,1)*0.33+REF(X_31/20/1.15,2)*0.22,3))/1000,1))*0.1,3)=3;
X_43:=COUNT(TT8-ABS(REF(EMA(X_31/20/1.15*0.55+REF(X_31/20/1.15,1)*0.33+REF(X_31/20/1.15,2)*0.22,3)/1000,1))*0.1,3)=3;
X_44:=X_40 AND (X_15 AND X_17) AND X_41 AND EMA(3*X_14-2*SMA(X_14,3,1),3)>10;
X_45:=X_39 AND X_15 AND X_41 AND EMA(3*X_14-2*SMA(X_14,3,1),3)>10 OR (X_39 AND X_15 AND EMA(3*X_14-2*SMA(X_14,3,1),3)>50);
X_46:=CLOSE>OPEN AND X_15 AND X_40 AND X_41 AND EMA(3*X_14-2*SMA(X_14,3,1),3)>10;
X_47:=X_39 AND (X_15 AND X_17) AND X_41 AND EMA(3*X_14-2*SMA(X_14,3,1),3)>10;
X_48:=X_44 OR X_45 OR X_46 OR X_47;
X_49:=CLOSE>OPEN AND X_15=0 AND X_40 AND X_41 AND (COUNT(REF(X_41,1) OR REF(X_39,1),2)=2 AND COUNT(REF(CLOSE>OPEN,1),2)=2);
X_50:=CLOSE>OPEN=0 AND X_17 AND X_15 AND X_40 AND X_41 AND X_35;
X_51:=CLOSE>OPEN=0 AND X_15 AND X_17 AND VOL<REF(VOL,1) AND EMA(X_31/20/1.15*0.55+REF(X_31/20/1.15,1)*0.33+REF(X_31/20/1.15,2)*0.22,3)/1000>0 AND X_35 AND CLOSE>MA5 AND MA5>MA30;
X_52:=EMA(3*X_14-2*SMA(X_14,3,1),3)<10 AND X_41 AND EMA(3*X_14-2*SMA(X_14,3,1),3)-REF(EMA(3*X_14-2*SMA(X_14,3,1),3),1)+REF(EMA(3*X_14-2*SMA(X_14,3,1),3)-REF(EMA(3*X_14-2*SMA(X_14,3,1),3),1),1)>0;
TT10:=CLOSE>MA5 AND REF(CLOSE,1)>REF(MA5,1) AND MA5>MA10 AND MA10>MA20 AND MA20>MA30 AND MA30>MA60;
TT11:=(TT10 OR (CLOSE>MA10 AND REF(CLOSE,1)>REF(MA5,1) AND MA5>MA10 AND MA10>MA20 AND MA20>MA30 AND MA30>MA60) OR (CLOSE>MA5 AND REF(CLOSE,1)>REF(MA5,1) AND MA5>MA10*0.99 AND MA10>MA20*0.99 AND MA20>MA30*0.99 AND MA30>MA60*0.99));
X_53:=X_15 AND EMA(3*X_14-2*SMA(X_14,3,1),3)-REF(EMA(3*X_14-2*SMA(X_14,3,1),3),1)>0.5 AND TT11 AND X_41 AND X_35;
X_54:=X_48 OR (X_49 OR X_50 OR X_51 OR X_52 OR X_53) OR (X_15 AND X_41 AND (X_15 AND X_17 OR X_39 OR (CLOSE>OPEN AND (X_31/20/1.15*0.4+EMA(X_31/20/1.15*0.55+REF(X_31/20/1.15,1)*0.33+REF(X_31/20/1.15,2)*0.22,3))/1000>EMA(X_31/20/1.15*0.55+REF(X_31/20/1.15,1)*0.33+REF(X_31/20/1.15,2)*0.22,3)/1000)));
TT12:=(REF(X_19,1) AND X_15 AND (X_39 OR (X_40 AND CLOSE>OPEN)));
TT13:=EMA(3*X_14-2*SMA(X_14,3,1),3)>0 AND EMA(3*X_14-2*SMA(X_14,3,1),3)<89;
TT14:=REF(X_19 AND REF(X_16,2) OR (REF(X_19,1) AND X_15 AND (X_39 OR (X_40 AND CLOSE>OPEN))) AND EMA(3*X_14-2*SMA(X_14,3,1),3)>0 AND EMA(3*X_14-2*SMA(X_14,3,1),3)<89 AND X_15,1);
X_55:=X_19 AND REF(X_16,2) OR TT12 AND TT13 AND X_15 OR TT14 OR (REF(X_19 AND REF(X_16,2) OR (REF(X_19,1) AND X_15 AND (X_39 OR (X_40 AND CLOSE>OPEN))) AND EMA(3*X_14-2*SMA(X_14,3,1),3)>0 AND EMA(3*X_14-2*SMA(X_14,3,1),3)<89 AND X_15,2) AND REF(X_15,1)) AND X_15 AND (X_39 OR (X_40 AND CLOSE>OPEN));
X_56:=X_55 AND (IF(REF(X_55,1),0,1) OR IF(REF(X_55,2),0,1));
TT15:=(REF(X_55 AND (X_54 OR X_17 AND X_40),2) AND COUNT(X_54,2)=2);
TT16:=(REF(X_55 AND (X_54 OR X_17 AND X_40),3) AND COUNT(X_54,3)=3);
TT17:=(REF(X_55 AND (X_54 OR X_17 AND X_40),4) AND COUNT(X_54,4)=4);
TT18:=(REF(X_55 AND (X_54 OR X_17 AND X_40),5) AND COUNT(X_54,5)=5);
TT19:=(REF(X_55 AND (X_54 OR X_17 AND X_40),5) AND COUNT(X_54,6)=6);
TT20:=(REF(X_55 AND (X_54 OR X_17 AND X_40),7) AND COUNT(X_54,7)=7);
X_57:=REF(X_55 AND (X_54 OR X_17 AND X_40),1) AND X_54 OR TT15 OR TT16 OR TT17 OR TT18 OR TT19 OR TT20;
X_58:=COUNT(X_15 AND X_17,2)=2 OR (COUNT(X_15,6)>=5 OR COUNT(X_15,3)>=3) AND (X_15 AND X_17) AND EMA(3*X_14-2*SMA(X_14,3,1),3)>0 AND EMA(3*X_14-2*SMA(X_14,3,1),3)<90;
X_59:=REF(X_58,1) AND X_54 OR (REF(X_58,2) AND COUNT(X_54,2)=2) OR (REF(X_58,3) AND COUNT(X_54,3)=3) OR (REF(X_58,4) AND COUNT(X_54,4)=4) OR (REF(X_58,5) AND COUNT(X_54,5)=5) OR (REF(X_58,6) AND COUNT(X_54,6)=6) OR (REF(X_58,7) AND COUNT(X_54,7)=7) OR (REF(X_58,8) AND COUNT(X_54,8)=8) OR (REF(X_58,9) AND COUNT(X_54,9)=9);
X_60:=EMA(3*X_14-2*SMA(X_14,3,1),3)>80 AND X_41 AND (X_40 OR X_39) AND X_15;
X_61:=REF(X_60,1) AND X_54 OR (REF(X_60,2) AND COUNT(X_54,2)=2) OR (REF(X_60,3) AND COUNT(X_54,3)=3) OR (REF(X_60,4) AND COUNT(X_54,4)=4) OR (REF(X_60,5) AND COUNT(X_54,5)=5) OR (REF(X_60,6) AND COUNT(X_54,6)=6) OR (REF(X_60,7) AND COUNT(X_54,7)=7);
X_62:=(X_58 OR X_59 OR (X_55 AND (X_54 OR X_17 AND X_40) OR X_57) OR (X_60 OR X_61))*100;
建仓区:IF(X_12<10,(-25),(-5)),COLOR00CCFF;
超短买入:IF(X_62<100,105,125),COLORRED;
{画底部横线}
0,COLORFFCC00,LINETHICK2;
{画中部横线}
XX:50,COLORLIBLUE,LINETHICK2;

17555841.png

17555841.png

回复

使用道具 举报

您需要登录后才可以回帖 登录 | 立即注册

本版积分规则