金量柱,成交量类,和谐通达信公式源码分享 副图
{金量柱
参数1: 均线, 最小: 0, 最大: 2, 缺省: 1参数2: 画虚拟量, 最小: 0, 最大: 1, 缺省: 1参数3: 平量误差, 最小: 1, 最大: 10, 缺省: 5参数4: 换手周期画线, 最小: 0, 最大: 1, 缺省: 0}VAR1:=DATE<=117010199;VAR2:=CURRBARSCOUNT;VAR3:=CURRBARSCOUNT-1;VAR4:=1-平量误差/100;VAR5:=1+平量误差/100;VAR6:=PERIOD=5;VAR7:=CLOSE/REF(CLOSE,1)>=1.099 AND CLOSE=HIGH;VAR8:=CLOSE/REF(CLOSE,1)<=0.901 AND LOW=CLOSE;VAR9:=VOL/REF(VOL,1)>=1.9;VAR10:=VOL=HHV(VOL,60);VAR11:=VOL=LLV(VOL,60);VAR12:=VOL=HHV(VOL,20);VAR13:=VOL=LLV(VOL,20);VAR14:=BETWEEN(VOL/REF(VOL,1),VAR4,VAR5) OR REFX(BETWEEN(VOL/REF(VOL,1),VAR4,VAR5),1);VAR15:=IF(VAR1,VOL/10000,DRAWNULL);VAR16:=MA(VOL,5);VAR17:=MA(VOL,30);VAR18:=MA(VOL,120);VAR19:=VOL<VAR18 AND VOL<VAR17 AND VAR16<VAR18 AND (VOL<VAR16 OR IF(VAR16<VAR17*0.75,VOL<VAR16*1.1,0));VAR20:=MAX(OPEN,CLOSE)/MIN(OPEN,CLOSE)>=1.03;VAR21:=CLOSE<=REF(CLOSE,1)*0.95 AND VAR19 AND VAR20;VAR22:=CLOSE>=REF(CLOSE,1)*1.05 AND VAR19 AND VAR20;VAR23:=CLOSE<=REF(CLOSE,1)*0.95 AND VAR19 AND VAR20 AND NOT(VAR8);长阴次涨:REFX(COUNT(REF(VAR23,1) AND CLOSE>REF(CLOSE,1),250)/COUNT(VAR23,250)*100,VAR3),NODRAW,COLORYELLOW;VAR24:=(CLOSE-LLV(LOW,250))/LLV(LOW,250)*100;VAR25:=SMA(VAR24,3,1);VAR26:=SMA(VAR25,3,1);年KDJ:REFX(VAR26,VAR3),NODRAW,COLORWHITE;VAR27:=CLOSE>1000;VAR28:=REF(CLOSE,1)/REF(CLOSE,2)>=1.099 AND REF(CLOSE,1)=REF(HIGH,1) AND REF(LOW,1)!=REF(HIGH,1);VAR29:=VAR28 AND CLOSE>REF(CLOSE,1);VAR30:=REFX(COUNT(VAR28,250),VAR3);年涨停:VAR30,NODRAW,COLORMAGENTA;次涨:REFX(COUNT(VAR29,250),VAR3),NODRAW,COLORLIMAGENTA;概率:IF(VAR27,DRAWNULL,次涨/VAR30*100),NODRAW,COLORYELLOW;VAR31:=VAR15*2/3;VAR32:=VAR15/2;VAR33:=VAR15<VAR31;VAR34:=VAR15<VAR32;VAR35:=均线=1 OR 均线=2;VAR36:=均线=2;五:IF(VAR36,MA(VAR15,5),DRAWNULL),NODRAW,COLORWHITE;三十:IF(VAR36,MA(VAR15,30),DRAWNULL),NODRAW,COLORMAGENTA;均120:IF(VAR35,MA(VAR15,120),DRAWNULL),NODRAW,COLORLIBLUE;万手:VAR15,NODRAW,COLORWHITE;亿:AMOUNT/100000000,NODRAW,COLORYELLOW;倍:VOL/REF(VOL,1),NODRAW,COLORWHITE;VAR37:=SSRP;今换:REFX(VAR37,VAR3),NODRAW,COLORGREEN;十:REFX(SUM(VAR37,10),VAR3),NODRAW,COLORWHITE;五十:REFX(SUM(VAR37,50),VAR3),NODRAW,COLORCYAN;低:REFX(LOW,VAR3),NODRAW,COLORGREEN;高:REFX(HIGH,VAR3),NODRAW,COLORMAGENTA;开:REFX(OPEN,VAR3),NODRAW,COLORWHITE;收:REFX(CLOSE,VAR3),NODRAW,COLORYELLOW;幅:REFX((CLOSE-REF(CLOSE,1))/REF(CLOSE,1)*100,VAR3),NODRAW,COLORRED;上量:REFX(VAR15>=均120,VAR3),NODRAW,COLORWHITE;上线:REFX(CLOSE>MA(CLOSE,20),VAR3),NODRAW,COLORMAGENTA;VAR38:=VAR15>=均120;VAR39:=VAR15<均120;VAR40:=COUNT(VAR39,3)=3;VAR41:=COUNT(VAR38,3)=3;VAR42:=VAR40 OR REFX(VAR40,1) OR REFX(VAR40,2);VAR43:=BARSLAST(VAR41)<BARSLAST(VAR40);VAR44:=BARSNEXT(VAR40)-2;VAR45:=BARSNEXT(VAR41)-2;VAR46:=VAR41 OR REFX(VAR41,1) OR REFX(VAR41,2) OR IF(VAR43,VAR44=DRAWNULL OR NOT(VAR42) OR VAR45<VAR44,0);VAR47:=CLOSE>REF(CLOSE,1);VAR48:=CLOSE<=REF(CLOSE,1);VAR49:=(-1);VAR50:=0;VAR51:=1;VAR52:=IF(PERIOD=1,5,IF(PERIOD=2,15,IF(PERIOD=3,30,IF(PERIOD=4,60,IF(PERIOD=5,240,1)))));VAR53:=MOD(FROMOPEN,VAR52);VAR54:=IF(VAR53<0.5,VAR52,VAR53);VAR55:=IF(CURRBARSCOUNT=1 AND 画虚拟量,VAR15*VAR52/VAR54,DRAWNULL);STICKLINE(画虚拟量 AND CURRBARSCOUNT=1 AND (SETCODE=0 OR SETCODE=1),VAR55,0,VAR49,(-1)),COLORLIGRAY;VAR56:=VAR15*6/7;STICKLINE(VAR47,0,VAR15,VAR49,VAR51),COLORRED;STICKLINE(VAR47 AND VAR9,VAR32,VAR15,VAR49,VAR50),COLOR0000CC;STICKLINE(VAR47 AND VAR12,VAR56,VAR15,VAR49,VAR50),COLORRED;STICKLINE(VAR47 AND VAR13,0,VAR15,VAR49,VAR50),COLORRED;STICKLINE(VAR47 AND VAR10,VAR56,VAR15,VAR49,VAR50),COLORMAGENTA;STICKLINE(VAR47 AND VAR11,0,VAR15,VAR49,VAR50),COLORMAGENTA;STICKLINE(VAR48,0,VAR15,VAR49,VAR50),COLORLIGREEN;STICKLINE(VAR48 AND VAR9,0,VAR15,VAR49,VAR51),COLORLIGREEN;STICKLINE(VAR48 AND VAR9,VAR32,VAR15,VAR49,VAR50),COLORLIGREEN;STICKLINE(VAR48 AND VAR12,VAR56,VAR15,VAR49,VAR50),COLORCYAN;STICKLINE(VAR48 AND VAR13,0,VAR15,VAR49,VAR50),COLORCYAN;STICKLINE(VAR48 AND VAR10,VAR56,VAR15,VAR49,VAR50),COLORGREEN;STICKLINE(VAR48 AND VAR11,0,VAR15,VAR49,VAR50),COLORGREEN;STICKLINE(VAR21,0,VAR32,0.1,0),COLORBLUE;STICKLINE(VAR22,0,VAR32,0.1,0),COLORRED;VAR57:=ABS((WINNER(REF(CLOSE,1))-WINNER(CLOSE))*100)>=18 AND VOL/CAPITAL*100<=3;STICKLINE(VAR57 AND CLOSE>REF(CLOSE,1),VAR32,VAR15,0.1,0),COLORRED;STICKLINE(VAR57 AND CLOSE<REF(CLOSE,1),VAR32,VAR15,0.1,0),COLORBLUE;VAR58:=3;VAR59:=VAR58-1;VAR60:=REF(CLOSE,VAR59)<=REF(CLOSE,VAR58) AND REF(VOL,VAR59)<REF(VOL,VAR58) OR (REF(CLOSE,VAR59)<=REF(CLOSE,VAR58) AND REF(VOL,VAR59)>REF(VOL,VAR58) AND REF(CLOSE,VAR58)>REF(CLOSE,VAR58+1)) AND COUNT(VOL>REF(VOL,1) AND CLOSE<=REF(CLOSE,1),VAR59)=VAR59;DRAWTEXT(VAR60,VAR15,VAR2STR(VAR58,0)),COLORYELLOW,LINETHICK9;VAR61:=4;VAR62:=VAR61-1;VAR63:=REF(CLOSE,VAR62)<=REF(CLOSE,VAR61) AND REF(VOL,VAR62)<REF(VOL,VAR61) OR (REF(CLOSE,VAR62)<=REF(CLOSE,VAR61) AND REF(VOL,VAR62)>REF(VOL,VAR61) AND REF(CLOSE,VAR61)>REF(CLOSE,VAR61+1)) AND COUNT(VOL>REF(VOL,1) AND CLOSE<=REF(CLOSE,1),VAR62)=VAR62;DRAWTEXT(VAR63,VAR15,VAR2STR(VAR61,0)),COLORYELLOW,LINETHICK9;VAR64:=3;VAR65:=VAR64-1;VAR66:=REF(CLOSE,VAR65)>REF(CLOSE,VAR64) AND REF(VOL,VAR65)<REF(VOL,VAR64) OR (REF(CLOSE,VAR65)>REF(CLOSE,VAR64) AND REF(VOL,VAR65)>REF(VOL,VAR64) AND REF(CLOSE,VAR64)<=REF(CLOSE,VAR64+1)) AND COUNT(VOL>REF(VOL,1) AND CLOSE>REF(CLOSE,1),VAR65)=VAR65;DRAWTEXT(VAR66,VAR15,VAR2STR(VAR64,0)),COLORYELLOW,LINETHICK9;VAR67:=REF(REF(CLOSE,VAR65)>REF(CLOSE,VAR64) AND REF(VOL,VAR65)<REF(VOL,VAR64) OR (REF(CLOSE,VAR65)>REF(CLOSE,VAR64) AND REF(VOL,VAR65)>REF(VOL,VAR64) AND REF(CLOSE,VAR64)<=REF(CLOSE,VAR64+1)) AND COUNT(VOL>REF(VOL,1) AND CLOSE>REF(CLOSE,1),VAR65)=VAR65,1);DRAWTEXT(VAR67 AND VOL<REF(VOL,1) AND CLOSE>REF(CLOSE,1),VAR15,VAR2STR(VAR64+1,0)),COLORGREEN,LINETHICK9;VAR68:=4;VAR69:=VAR68-1;VAR70:=REF(CLOSE,VAR69)>REF(CLOSE,VAR68) AND REF(VOL,VAR69)<REF(VOL,VAR68) OR (REF(CLOSE,VAR69)>REF(CLOSE,VAR68) AND REF(VOL,VAR69)>REF(VOL,VAR68) AND REF(CLOSE,VAR68)<=REF(CLOSE,VAR68+1)) AND COUNT(VOL>REF(VOL,1) AND CLOSE>REF(CLOSE,1),VAR69)=VAR69;DRAWTEXT(VAR70,VAR15,VAR2STR(VAR68,0)),COLORYELLOW,LINETHICK9;VAR71:=5;VAR72:=VAR71-1;VAR73:=REF(CLOSE,VAR72)>REF(CLOSE,VAR71) AND REF(VOL,VAR72)<REF(VOL,VAR71) OR (REF(CLOSE,VAR72)>REF(CLOSE,VAR71) AND REF(VOL,VAR72)>REF(VOL,VAR71) AND REF(CLOSE,VAR71)<=REF(CLOSE,VAR71+1)) AND COUNT(VOL>REF(VOL,1) AND CLOSE>REF(CLOSE,1),VAR72)=VAR72;DRAWTEXT(VAR73,VAR15,VAR2STR(VAR71,0)),COLORYELLOW,LINETHICK9;VAR74:=6;VAR75:=VAR74-1;VAR76:=REF(CLOSE,VAR75)>REF(CLOSE,VAR74) AND REF(VOL,VAR75)<REF(VOL,VAR74) OR (REF(CLOSE,VAR75)>REF(CLOSE,VAR74) AND REF(VOL,VAR75)>REF(VOL,VAR74) AND REF(CLOSE,VAR74)<=REF(CLOSE,VAR74+1)) AND COUNT(VOL>REF(VOL,1) AND CLOSE>REF(CLOSE,1),VAR75)=VAR75;DRAWTEXT(VAR76,VAR15,VAR2STR(VAR74,0)),COLORYELLOW,LINETHICK9;VAR77:=7;VAR78:=VAR77-1;VAR79:=REF(CLOSE,VAR78)>REF(CLOSE,VAR77) AND REF(VOL,VAR78)<REF(VOL,VAR77) OR (REF(CLOSE,VAR78)>REF(CLOSE,VAR77) AND REF(VOL,VAR78)>REF(VOL,VAR77) AND REF(CLOSE,VAR77)<=REF(CLOSE,VAR77+1)) AND COUNT(VOL>REF(VOL,1) AND CLOSE>REF(CLOSE,1),VAR78)=VAR78;DRAWTEXT(VAR79,VAR15,VAR2STR(VAR77,0)),COLORYELLOW,LINETHICK9;STICKLINE(VAR14,0,VAR15/50,VAR49,VAR50),COLORYELLOW;VAR80:=SUMBARS(VAR37,100);VAR81:=SUMBARS(VAR37,200);VAR82:=SUMBARS(VAR37,300);VAR83:=SUMBARS(VAR37,400);VAR84:=SUMBARS(VAR37,500);VAR85:=REFX(VAR80,VAR3);VAR86:=REFX(VAR81,VAR3);VAR87:=REFX(VAR82,VAR3);VAR88:=REFX(VAR83,VAR3);VAR89:=REFX(VAR84,VAR3);VAR90:=REF(VAR15,VAR85-VAR2);VAR91:=REF(VAR15,VAR86-VAR2);VAR92:=REF(VAR15,VAR87-VAR2);VAR93:=REF(VAR15,VAR88-VAR2);VAR94:=REF(VAR15,VAR89-VAR2);NOTEXT11:IF(VAR2<=VAR85 AND 换手周期画线,VAR90,DRAWNULL),COLORGREEN;NOTEXT12:IF(VAR2>VAR85 AND 换手周期画线 AND VAR2<=VAR86,VAR91,DRAWNULL),COLORCYAN;NOTEXT13:IF(VAR2>VAR86 AND 换手周期画线 AND VAR2<=VAR87,VAR92,DRAWNULL),COLORYELLOW;NOTEXT14:IF(VAR2>VAR87 AND 换手周期画线 AND VAR2<=VAR88,VAR93,DRAWNULL),COLORGREEN;NOTEXT15:IF(VAR2>VAR88 AND 换手周期画线 AND VAR2<=VAR89,VAR94,DRAWNULL),COLORCYAN;VAR95:=ISLASTBAR AND 换手周期画线;DRAWTEXT_FIX(VAR95,0.6,0,0,VAR2STR(VAR89-VAR88,0)),COLORCYAN;DRAWTEXT_FIX(VAR95,0.65,0,0,VAR2STR(VAR88-VAR87,0)),COLORGREEN;DRAWTEXT_FIX(VAR95,0.7,0,0,VAR2STR(VAR87-VAR86,0)),COLORYELLOW;DRAWTEXT_FIX(VAR95,0.75,0,0,VAR2STR(VAR86-VAR85,0)),COLORCYAN;DRAWTEXT_FIX(VAR95,0.8,0,0,VAR2STR(VAR85,0)),COLORGREEN;VAR96:=3;VAR97:=VAR96-1;VAR98:=VAR96+1;VAR99:=REF(CLOSE,VAR96)<REF(CLOSE,VAR98) AND REF(CLOSE,VAR98)<REF(CLOSE,VAR98+1) AND COUNT(CLOSE>REF(CLOSE,1) AND VOL<REF(VOL,1),VAR96)=VAR96;DRAWTEXT(VAR99,VAR15,VAR2STR(VAR96,0)),COLORGREEN,LINETHICK9;VAR100:=4;VAR101:=VAR100-1;VAR102:=VAR100+1;VAR103:=REF(CLOSE,VAR100)<REF(CLOSE,VAR102) AND REF(CLOSE,VAR102)<REF(CLOSE,VAR102+1) AND COUNT(CLOSE>REF(CLOSE,1) AND VOL<REF(VOL,1),VAR100)=VAR100;DRAWTEXT(VAR103,VAR15,VAR2STR(VAR100,0)),COLORGREEN,LINETHICK9;VAR104:=5;VAR105:=VAR104-1;VAR106:=VAR104+1;VAR107:=REF(CLOSE,VAR104)<REF(CLOSE,VAR106) AND REF(CLOSE,VAR106)<REF(CLOSE,VAR106+1) AND COUNT(CLOSE>REF(CLOSE,1) AND VOL<REF(VOL,1),VAR104)=VAR104;DRAWTEXT(VAR107,VAR15,VAR2STR(VAR104,0)),COLORGREEN,LINETHICK9;VAR108:=6;VAR109:=VAR108-1;VAR110:=VAR108+1;VAR111:=REF(CLOSE,VAR108)<REF(CLOSE,VAR110) AND REF(CLOSE,VAR110)<REF(CLOSE,VAR110+1) AND COUNT(CLOSE>REF(CLOSE,1) AND VOL<REF(VOL,1),VAR108)=VAR108;DRAWTEXT(VAR111,VAR15,VAR2STR(VAR108,0)),COLORGREEN,LINETHICK9;VAR112:=7;VAR113:=VAR112-1;VAR114:=VAR112+1;VAR115:=REF(CLOSE,VAR112)<REF(CLOSE,VAR114) AND REF(CLOSE,VAR114)<REF(CLOSE,VAR114+1) AND COUNT(CLOSE>REF(CLOSE,1) AND VOL<REF(VOL,1),VAR112)=VAR112;DRAWTEXT(VAR115,VAR15,VAR2STR(VAR112,0)),COLORGREEN,LINETHICK9;VAR116:=3;VAR117:=VAR116-1;VAR118:=VAR116+1;VAR119:=REF(CLOSE,VAR116)>REF(CLOSE,VAR118) OR REF(VOL,VAR116)>REF(VOL,VAR118) AND COUNT(CLOSE<REF(CLOSE,1) AND VOL<REF(VOL,1),VAR116)=VAR116;DRAWTEXT(VAR119,VAR15,VAR2STR(VAR116,0)),COLORGREEN,LINETHICK9;VAR120:=4;VAR121:=VAR120-1;VAR122:=VAR120+1;VAR123:=REF(CLOSE,VAR120)>REF(CLOSE,VAR122) OR REF(VOL,VAR120)>REF(VOL,VAR122) AND COUNT(CLOSE<=REF(CLOSE,1) AND VOL<REF(VOL,1),VAR120)=VAR120;DRAWTEXT(VAR123,VAR15,VAR2STR(VAR120,0)),COLORGREEN,LINETHICK9;VAR124:=5;VAR125:=VAR124-1;VAR126:=VAR124+1;VAR127:=REF(CLOSE,VAR124)>REF(CLOSE,VAR126) OR REF(VOL,VAR124)>REF(VOL,VAR126) AND COUNT(CLOSE<=REF(CLOSE,1) AND VOL<REF(VOL,1),VAR124)=VAR124;DRAWTEXT(VAR127,VAR15,VAR2STR(VAR124,0)),COLORGREEN,LINETHICK9;VAR128:=6;VAR129:=VAR128-1;VAR130:=VAR128+1;VAR131:=REF(CLOSE,VAR128)>REF(CLOSE,VAR130) OR REF(VOL,VAR128)>REF(VOL,VAR130) AND COUNT(CLOSE<=REF(CLOSE,1) AND VOL<REF(VOL,1),VAR128)=VAR128;DRAWTEXT(VAR131,VAR15,VAR2STR(VAR128,0)),COLORGREEN,LINETHICK9;VAR132:=7;VAR133:=VAR132-1;VAR134:=VAR132+1;VAR135:=REF(CLOSE,VAR132)>REF(CLOSE,VAR134) OR REF(VOL,VAR132)>REF(VOL,VAR134) AND COUNT(CLOSE<=REF(CLOSE,1) AND VOL<REF(VOL,1),VAR132)=VAR132;DRAWTEXT(VAR135,VAR15,VAR2STR(VAR132,0)),COLORGREEN,LINETHICK9;VAR136:=CURRBARSCOUNT=120;VAR137:=IF(VAR136,MA(VAR15,120),DRAWNULL);DRAWTEXT(VAR136,IF(VAR15>VAR137,VAR15,VAR137),VAR2STR(120,0)),COLORWHITE,LINETHICK9;VAR138:=VAR31>=REF(VAR15,1) AND NOT(VAR9);VAR139:=REFX(VAR15,1)<VAR31;VAR140:=REFX(VAR15,1)<VAR32;STICKLINE(VAR138,VAR31,VAR31,(-1),0),COLORCYAN;STICKLINE(VAR139,VAR31,VAR31,VAR49,VAR50),COLORWHITE;STICKLINE(VAR140,VAR32,VAR32,VAR49,VAR50),COLORWHITE;NOTEXT5:IF(VAR36,五,DRAWNULL),COLORWHITE;NOTEXT30:IF(VAR36,三十,DRAWNULL),COLORMAGENTA;NOTEXT120:IF(VAR35,均120,DRAWNULL),COLORLIBLUE;NOTEXT上量:IF(VAR35 AND VAR46,均120,DRAWNULL),COLORYELLOW;