通达信【断量天量】主图源码分享
GSPT1:=SUM((WINNER(C)*100),30)/30*0.1;
GSPT2:=SUM((WINNER(C)*100),20)/20*0.4;GSPT3:=SUM((WINNER(C)*100),10)/10*0.3;GSPT4:=SUM((WINNER(C)*100),5)/5*0.1;GSPT5:=SUM((WINNER(C)*100),3)/3*0.1;GSPTZ:=GSPT1+GSPT2+GSPT3+GSPT4+GSPT5;赚钱效应:IF(GSPTZ>38,GSPTZ,GSPTZ*1.3),NODRAW;活跃度:IF(SUMBARS(VOL,CAPITAL)<100,100-SUMBARS(VOL,CAPITAL),1),NODRAW;获利筹码:IF(WINNER(CLOSE),WINNER(CLOSE)*100,0),NODRAW;
DRAWKLINE(H,O,L,C);Z1:=STRCAT(HYBLOCK,' ');Z2:=STRCAT(Z1,DYBLOCK);Z3:=STRCAT(Z2,' ');DRAWTEXT_FIX(ISLASTBAR,0,0,0,STRCAT(Z3,GNBLOCK)),COLORYELLOW;
{断量}MV5:=MA(V,5);破5:=CROSS(MV5,V);断量:DRAWLINE(破5 AND CURRBARSCOUNT<9,C,REF(破5,1),REF(C,1),1),COLORWHITE;DRAWTEXT(CURRBARSCOUNT=1,断量,STRCAT((''),CON2STR(断量,1))),COLORWHITE;
{量王}总量:=AMOUNT,VOLSTICK;量比:=V/REF(MA(V,5),1),COLORBROWN,NODRAW;几倍:=1.9;倍量量王:= 总量 >=REF(总量,1)*几倍 AND (IF(C<O,C>REF(C,1),1)),COLORYELLOW,NODRAW;天量:总量=HHV(总量,120), COLORRED;量王:=天量&&倍量量王&&量比>2&&(BARSCOUNT(C)+1)>120,COLORGREEN;STICKLINE(量王,C,O,0.1,0),COLORGREEN;DRAWLINE(量王,H,REF(量王,1),REF(H,1),1),COLOR0066BB,LINETHICK1;DRAWLINE(量王,L,REF(量王,1),REF(L,1),1),COLORGREEN;
{庄家成本}AL0:=SUMBARS(V,CAPITAL*1);AL1:=SUM(COST(10),AL0)/AL0;AL2:=SUM(COST(20),AL0)/AL0;AL3:=SUM(COST(30),AL0)/AL0;AL4:=SUM(COST(40),AL0)/AL0;AL5:=SUM(COST(50),AL0)/AL0;庄家成本2:=(5*AL1+4*AL2+3*AL3+2*AL4+AL5)/15,COLOR0080FF,DOTLINE;庄家成本1:REFDATE(庄家成本2,DATE),COLORLIRED,DOTLINE;DRAWTEXT(CURRBARSCOUNT=50,庄家成本1,STRCAT('庄本:',CON2STR(庄家成本1,2))),COLORLIRED;
{止损价}CCC:=IF(CURRBARSCOUNT<18,CONST(REF(C,1)),DRAWNULL);止损:0.977*CCC,LINETHICK1,COLORLIGRAY;DRAWTEXT(CURRBARSCOUNT=15,止损,STRCAT('止损: ',STRCAT(CON2STR(止损,2),' '))),LINETHICK1,COLORLIGRAY;STICKLINE(H>1.097*REF(C,1)&&C<1.097*REF(C,1)&&C>O,C,O,2,0)COLORMAGENTA;STICKLINE(C>1.097*REF(C,1)&&C>O,CLOSE-(CLOSE-OPEN)/3,CLOSE,2,0)COLORRED;STICKLINE(H>1.197*REF(C,1)&&C>O,C,O,1.18,0)COLORYELLOW;STICKLINE(C<0.907*REF(C,1),CLOSE+(OPEN-CLOSE)/3,CLOSE,2,0),COLORBLUE;
未来函数检测结果如下:
该公式包含未来函数:WINNER
该公式包含未来函数:COST
该公式包含未来函数:CAPITAL
解密、定制、编写股票指标请联系QQ或微信同号:88652583
相关股票指标公式
原理解析:
GSPT1赋值:SUM((C计算的获利盘比例*100),30)/30*0.1
GSPT2赋值:SUM((C计算的获利盘比例*100),20)/20*0.4
GSPT3赋值:SUM((C计算的获利盘比例*100),10)/10*0.3
GSPT4赋值:SUM((C计算的获利盘比例*100),5)/5*0.1
GSPT5赋值:SUM((C计算的获利盘比例*100),3)/3*0.1
GSPTZ赋值:GSPT1+GSPT2+GSPT3+GSPT4+GSPT5
如果GSPTZ>38返回GSPTZ否则返回GSPTZ*1.3
输出活跃度:IF(成交量累加至当前流通股本的天数<100,100-成交量累加至当前流通股本的天数,1),NODRAW
输出获利筹码:IF(收盘价计算的获利盘比例,收盘价计算的获利盘比例*100,0),NODRAW
DRAWKLINE(H,O,L,C)
Z1赋值:STRCAT(HYBLOCK,' ')
Z2赋值:STRCAT(Z1,DYBLOCK)
Z3赋值:STRCAT(Z2,' ')
DRAWTEXT_FIX(ISLASTBAR,0,0,0,STRCAT(Z3,GNBLOCK)),画黄色
{断量}MV5赋值:V的5日简单移动平均
破5赋值:MV5上穿V
输出断量:DRAWLINE(破5 AND 到最后交易的周期<9,C,1日前的破5,1日前的C,1),画白色
DRAWTEXT( 到最后交易的周期=1,断量,STRCAT((''),CON2STR(断量,1))),画白色
{量王}总量赋值:成交额,成交量STICK
量比赋值:V/REF(V的5日简单移动平均,1),COLORBROWN,NODRAW
几倍赋值:1.9
倍量量王赋值: 总量 >=1日前的总量*几倍 AND (IF(C1日前的C,1)),画黄色,NODRAW
输出天量:总量=120日内总量最高值, 画红色
量王赋值:天量&&倍量量王&&量比>2&&(C的有效数据周期数+1)>120,画绿色
当满足条件量王时,在C和O之间画柱状线
DRAWLINE(量王,H,1日前的量王,1日前的H,1),COLOR0066BB,LINETHICK1
DRAWLINE(量王,L,1日前的量王,1日前的L,1),画绿色
{庄家成本}AL0赋值:V累加至当前流通股本*1的天数
AL1赋值:SUM(获利盘为10%的成本分布,AL0)/AL0
AL2赋值:SUM(获利盘为20%的成本分布,AL0)/AL0
AL3赋值:SUM(获利盘为30%的成本分布,AL0)/AL0
AL4赋值:SUM(获利盘为40%的成本分布,AL0)/AL0
AL5赋值:SUM(获利盘为50%的成本分布,AL0)/AL0
庄家成本2赋值:(5*AL1+4*AL2+3*AL3+2*AL4+AL5)/15,COLOR0080FF,DOTLINE
输出庄家成本1:REFDATE(庄家成本2,DATE),COLORLIRED,DOTLINE
DRAWTEXT( 到最后交易的周期=50,庄家成本1,STRCAT('庄本:',CON2STR(庄家成本1,2))),COLORLIRED
{止损价}CCC赋值:IF( 到最后交易的周期<18,CONST(1日前的C),DRAWNULL)
输出止损:0.977*CCC,LINETHICK1,COLORLIGRAY
DRAWTEXT( 到最后交易的周期=15,止损,STRCAT('输出止损: ',STRCAT(CON2STR(止损,2),' '))),LINETHICK1,COLORLIGRAY
STICKLINE(H>1.097*1日前的C&&C<1.097*1日前的C&&C>O,C,O,2,0)画洋红色
STICKLINE(C>1.097*1日前的C&&C>O,收盘价-(收盘价-开盘价)/3,收盘价,2,0)画红色
STICKLINE(H>1.197*1日前的C&&C>O,C,O,1.18,0)画黄色
STICKLINE(C<0.907*1日前的C,收盘价+(开盘价-收盘价)/3,收盘价,2,0), 画蓝色