通达信与主力共生存 副图 源码
{价量线主线快线}
价量:3*SMA((CLOSE-LLV(LOW,27))/(HHV(HIGH,27)-LLV(LOW,27))*100,5,1)
-2*SMA(SMA((CLOSE-LLV(LOW,27))/(HHV(HIGH,27)-LLV(LOW,27))*100,5,1),3,1)
,COLOR00CCFF,NODRAW;
主线:(((价量-LLV(价量,27))/(HHV(价量,27)-LLV(价量,27)))*(4))*(25)
,COLORCYAN,NODRAW;
快线:(((价量-LLV(价量,9))/(HHV(价量,9)-LLV(价量,9)))*(4))*(25)
,COLOR55AAFF,NODRAW;
RSV:=(CLOSE-LLV(LOW,13))/(HHV(HIGH,13)-LLV(LOW,13))*100;
K1:=SMA(RSV,3,1);
D1:=SMA(K1,3,1);
KK:=INTPART(K1);
DD:=INTPART(D1);
TFXXS:=KK+DD;{变异KD风险系数}
TGLXS:=(TFXXS-REF(TFXXS,1));{变异KD乖离系数:资金流向}
{红}
STICKLINE(TGLXS>0 AND TGLXS>REF(TGLXS,1),100,TGLXS+100,2.5,0),COLOR0000AA;
STICKLINE(TGLXS>0 AND TGLXS>REF(TGLXS,1),100,TGLXS+100,1.5,0),COLOR0022CC;
STICKLINE(TGLXS>0 AND TGLXS>REF(TGLXS,1),100,TGLXS+100,0.5,0),COLOR0055FF;
{粉}
STICKLINE(TGLXS<0 AND TGLXS>REF(TGLXS,1),100,TGLXS+100,2.5,0),COLORAA00BB;
STICKLINE(TGLXS<0 AND TGLXS>REF(TGLXS,1),100,TGLXS+100,1.5,0),COLORCC22BB;
STICKLINE(TGLXS<0 AND TGLXS>REF(TGLXS,1),100,TGLXS+100,0.5,0),COLORFF55BB;
{黄}
STICKLINE(TGLXS>0 AND TGLXS<=REF(TGLXS,1),100,TGLXS+100,2.5,0),COLOR00AAFF;
STICKLINE(TGLXS>0 AND TGLXS<=REF(TGLXS,1),100,TGLXS+100,1.5,0),COLOR00CCFF;
STICKLINE(TGLXS>0 AND TGLXS<=REF(TGLXS,1),100,TGLXS+100,0.5,0),COLOR00FFFF;
{蓝}
STICKLINE(TGLXS<0 AND TGLXS<=REF(TGLXS,1),100,TGLXS+100,2.5,0),COLORFF7700;
STICKLINE(TGLXS<0 AND TGLXS<=REF(TGLXS,1),100,TGLXS+100,1.5,0),COLORFFAA22;
STICKLINE(TGLXS<0 AND TGLXS<=REF(TGLXS,1),100,TGLXS+100,0.5,0),COLORFFFF55;
STICKLINE(TGLXS=0 AND REF(TGLXS,1)>=0,100,TGLXS+100,8,0),COLORBROWN;
STICKLINE(TGLXS=0 AND REF(TGLXS,1)<0,100,TGLXS+100,8,0),COLORWHITE;
ZLCM:=EMA(WINNER(CLOSE)*70,3);{主力筹码估算}
SHCM:=EMA((WINNER(CLOSE*1.1)-WINNER(CLOSE*0.9))*80,3);{散户筹码估算}
ZSHTL:=SHCM/(ZLCM+SHCM)*100;{散户套牢筹码系数}
ZZLKP:=ZLCM/(ZLCM+SHCM)*100;{主力控盘筹码系数}
ZSHJJ:=EMA(ZSHTL,55);{散户警戒}
ZZLJJ:=EMA(ZZLKP,55);{主力警戒}
散兵坑:IF(ZZLKP<=10,ZZLKP,ZZLKP),COLORMAGENTA,NODRAW;
{散户套牢筹码}{股票指标网}
STICKLINE(C>0,ZSHTL,ZZLKP,2,0),COLOR808080;
{散户筹码警戒}
STICKLINE(ZSHJJ>REF(ZSHJJ,1),ZSHTL,ZSHJJ,2,0),COLORC0C0C0;
{主力控盘筹码}
{粉}
STICKLINE(ZZLKP>REF(ZZLKP,1) AND ZZLKP>20,ZZLKP,20,2.5,0 ),COLORAA00BB;
STICKLINE(ZZLKP>REF(ZZLKP,1) AND ZZLKP>20,ZZLKP,20,1.5,0 ),COLORCC22BB;
STICKLINE(ZZLKP>REF(ZZLKP,1) AND ZZLKP>20,ZZLKP,20,0.5,0 ),COLOREE44BB;
{蓝}
STICKLINE(ZZLKP<=REF(ZZLKP,1) AND ZZLKP>20,ZZLKP,20,2.5,0 ),COLORFF7700;
STICKLINE(ZZLKP<=REF(ZZLKP,1) AND ZZLK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AND ZZLJJ<50 AND ZZLKP>50
AND ZZLJJ>REF(ZZLJJ,1),ZZLKP,50,1.5,0 ),COLOR0022CC;
STICKLINE(ZZLKP>ZZLJJ AND ZZLJJ<50 AND ZZLKP>50
AND ZZLJJ>REF(ZZLJJ,1),ZZLKP,50,0.5 ,0 ),COLOR0055FF;
{铸顶风险区}
{绿}{股票指标网}
STICKLINE(ZZLKP>80,ZZLKP,ZZLKP-(ZZLKP-80)/2,2.5,0),COLOR00AA00;
STICKLINE(ZZLKP>80,ZZLKP,ZZLKP-(ZZLKP-80)/2,1.5,0),COLOR00CC00;
STICKLINE(ZZLKP>80,ZZLKP,ZZLKP-(ZZLKP-80)/2,0.5,0),COLOR00FF00;
{散兵坑}
STICKLINE(ZZLKP<=10,ZZLKP,0,5,0),COLORDD00DD;
100,COLORGREEN;
80,COLORGREEN;
{0,COLORGREEN;}
{主线快线}
价量,COLOR0CC0FF,LINETHICK2;
主线,COLOR00FFAA,LINETHICK2;
快线,LINESTICK,COLORFF68DD;
未来函数检测结果如下:
该公式包含未来函数:WINNER
解密、编写股票、期货策略请联系QQ或微信同号:88652583
相关股票指标公式
原理解析:
输出{价量线主线快线}
价量:3*SMA((收盘价-27日内最低价最低值)/(27日内最高价最高值-27日内最低价最低值)*100,5,1)
-2*SMA(SMA((收盘价-27日内最低价最低值)/(27日内最高价最高值-27日内最低价最低值)*100,5,1),3,1)
,COLOR00CCFF,NODRAW
输出主线:(((价量-27日内价量最低值)/(27日内价量最高值-27日内价量最低值))*(4))*(25)
,画青色,NODRAW
输出快线:(((价量-9日内价量最低值)/(9日内价量最高值-9日内价量最低值))*(4))*(25)
,COLOR55AAFF,NODRAW
RSV赋值:(收盘价-13日内最低价最低值)/(13日内最高价最高值-13日内最低价最低值)*100
RSV的3日[1日权重]移动平均
K1的3日[1日权重]移动平均
KK赋值:INTPART(K1)
DD赋值:INTPART(D1)
TFXXS赋值:KK+DD
{变异KD风险系数}
TGLXS赋值:(TFXXS-1日前的TFXXS)
输出{变异KD乖离系数:资金流向}
{红}
STICKLINE(TGLXS>0 AND TGLXS>1日前的TGLXS,100,TGLXS+100,2.5,0),COLOR0000AA
STICKLINE(TGLXS>0 AND TGLXS>1日前的TGLXS,100,TGLXS+100,1.5,0),COLOR0022CC
STICKLINE(TGLXS>0 AND TGLXS>1日前的TGLXS,100,TGLXS+100,0.5,0),COLOR0055FF
{粉}
STICKLINE(TGLXS<0 AND TGLXS>1日前的TGLXS,100,TGLXS+100,2.5,0),COLORAA00BB
STICKLINE(TGLXS<0 AND TGLXS>1日前的TGLXS,100,TGLXS+100,1.5,0),COLORCC22BB
STICKLINE(TGLXS<0 AND TGLXS>1日前的TGLXS,100,TGLXS+100,0.5,0),COLORFF55BB
{黄}
STICKLINE(TGLXS>0 AND TGLXS<=1日前的TGLXS,100,TGLXS+100,2.5,0),COLOR00AAFF
STICKLINE(TGLXS>0 AND TGLXS<=1日前的TGLXS,100,TGLXS+100,1.5,0),COLOR00CCFF
STICKLINE(TGLXS>0 AND TGLXS<=1日前的TGLXS,100,TGLXS+100,0.5,0),COLOR00FFFF
{蓝}
STICKLINE(TGLXS<0 AND TGLXS<=1日前的TGLXS,100,TGLXS+100,2.5,0),COLORFF7700
STICKLINE(TGLXS<0 AND TGLXS<=1日前的TGLXS,100,TGLXS+100,1.5,0),COLORFFAA22
STICKLINE(TGLXS<0 AND TGLXS<=1日前的TGLXS,100,TGLXS+100,0.5,0),COLORFFFF55
STICKLINE(TGLXS=0 AND 1日前的TGLXS>=0,100,TGLXS+100,8,0),COLORBROWN
STICKLINE(TGLXS=0 AND 1日前的TGLXS<0,100,TGLXS+100,8,0),画白色
ZLCM赋值:EMA(收盘价计算的获利盘比例*70,3)
{主力筹码估算}
SHCM赋值:EMA((收盘价*1.1计算的获利盘比例-WINNER(收盘价*0.9))*80,3)
{散户筹码估算}
ZSHTL赋值:SHCM/(ZLCM+SHCM)*100
{散户套牢筹码系数}
ZZLKP赋值:ZLCM/(ZLCM+SHCM)*100
{主力控盘筹码系数}
ZSHJJ赋值:ZSHTL的55日指数移动平均
{散户警戒}
ZZLJJ赋值:ZZLKP的55日指数移动平均
如果ZZLKP<=10返回ZZLKP否则返回ZZLKP
当满足条件C>0时,在ZSHTL和ZZLKP之间画柱状线
{散户筹码警戒}
STICKLINE(ZSHJJ>1日前的ZSHJJ,ZSHTL,ZSHJJ,2,0),COLORC0C0C0
{主力控盘筹码}
{粉}
STICKLINE(ZZLKP>1日前的ZZLKP AND ZZLKP>20,ZZLKP,20,2.5,0 ),COLORAA00BB
STICKLINE(ZZLKP>1日前的ZZLKP AND ZZLKP>20,ZZLKP,20,1.5,0 ),COLORCC22BB
STICKLINE(ZZLKP>1日前的ZZLKP AND ZZLKP>20,ZZLKP,20,0.5,0 ),COLOREE44BB
{蓝}
STICKLINE(ZZLKP<=1日前的ZZLKP AND ZZLKP>20,ZZLKP,20,2.5,0 ),COLORFF7700
STICKLINE(ZZLKP<=1日前的ZZLKP AND ZZLKP>20,ZZLKP,20,1.5,0 ),COLORFFAA22
STICKLINE(ZZLKP<=1日前的ZZLKP AND ZZLKP>20,ZZLKP,20,0.5 ,0 ),COLORFFFF55
{亮红}
STICKLINE(ZZLKP>1日前的ZZLKP AND ZZLKP<20,ZZLKP,0,2.5,0 ),COLOR131FFD
STICKLINE(ZZLKP>1日前的ZZLKP AND ZZLKP<20,ZZLKP,0,1.5,0 ),COLOR5050FF
STICKLINE(ZZLKP>1日前的ZZLKP AND ZZLKP<20,ZZLKP,0,0.5,0 ),COLOR7E7EFF
{深蓝}
STICKLINE(ZZLKP<=1日前的ZZLKP AND ZZLKP<20,ZZLKP,0,2.5,0 ),COLORAA0000
STICKLINE(ZZLKP<=1日前的ZZLKP AND ZZLKP<20,ZZLKP,0,1.5,0 ),COLORCC0000
STICKLINE(ZZLKP<=1日前的ZZLKP AND ZZLKP<20,ZZLKP,0,0.5 ,0 ),COLORFF0000
{主力筹码警戒}
{黄}
STICKLINE(ZZLJJ>1日前的ZZLJJ,ZZLKP,ZZLJJ,2.5,0 ),COLOR00AAFF
STICKLINE(ZZLJJ>1日前的ZZLJJ,ZZLKP,ZZLJJ,1.5,0 ),COLOR00CCFF
STICKLINE(ZZLJJ>1日前的ZZLJJ,ZZLKP,ZZLJJ,0.5,0 ),COLOR00FFFF
当满足条件ZZLKP>ZZLJJ AND ZZLJJ>50时,在ZZLKP和ZZLJJ之间画柱状线
当满足条件ZZLKP>ZZLJJ AND ZZLJJ>50时,在ZZLKP和ZZLJJ之间画柱状线
当满足条件ZZLKP>ZZLJJ AND ZZLJJ>50时,在ZZLKP和ZZLJJ之间画柱状线
{红}
STICKLINE(ZZLKP>ZZLJJ AND ZZLJJ<50 AND ZZLKP>50
AND ZZLJJ>1日前的ZZLJJ,ZZLKP,50,2.5,0 ),COLOR0000AA
STICKLINE(ZZLKP>ZZLJJ AND ZZLJJ<50 AND ZZLKP>50
AND ZZLJJ>1日前的ZZLJJ,ZZLKP,50,1.5,0 ),COLOR0022CC
STICKLINE(ZZLKP>ZZLJJ AND ZZLJJ<50 AND ZZLKP>50
AND ZZLJJ>1日前的ZZLJJ,ZZLKP,50,0.5 ,0 ),COLOR0055FF
{铸顶风险区}
{绿}{股票指标网}
STICKLINE(ZZLKP>80,ZZLKP,ZZLKP-(ZZLKP-80)/2,2.5,0),COLOR00AA00
STICKLINE(ZZLKP>80,ZZLKP,ZZLKP-(ZZLKP-80)/2,1.5,0),COLOR00CC00
STICKLINE(ZZLKP>80,ZZLKP,ZZLKP-(ZZLKP-80)/2,0.5,0),COLOR00FF00
当满足条件ZZLKP<=10时,在ZZLKP和0之间画柱状线
100,画绿色
80,画绿色
{0,画绿色
}
{主线快线}
价量,COLOR0CC0FF, 线宽为2
主线,COLOR00FFAA, 线宽为2
快线,LINESTICK,COLORFF68DD