资金趋势
{--【资金趋势】指标由【SUPL资金线】+【短线掘金】+【MACD】指标精准优化整合--}
{--------K线个数:最小 30 最大 240 默认 80 (默认值为主图显示K线个数)--------}
SHORT:=12;LONG:=26;MID:=9;
M_升:EMA(CLOSE,SHORT)-EMA(CLOSE,LONG),COLOR332099;
M_降:EMA(M_升,MID),COLOR205500;
柱偏离:(M_升-M_降)*2,COLORSTICK,COLOR0000FF;
MACD红绿趋势:DRAWBAND(M_升,RGB(153,32,51),M_降,RGB(0,85,32));
DIF高点:=IF(M_升>M_降,M_升,M_降);
DIF低点:=IF(M_升<M_降,M_升,M_降);
MACD高点:=IF(柱偏离>DIF高点,柱偏离,DIF高点);
MACD低点:=IF(柱偏离<DIF低点,柱偏离,DIF低点);
MACD高点定位:=IF(PERIOD=0,CONST(HHV(MACD高点,BARSSINCE(C))),CONST(HHV(MACD高点,K线个数)));
MACD低点定位:=IF(PERIOD=0,CONST(LLV(MACD低点,BARSSINCE(C))),CONST(LLV(MACD低点,K线个数)));
顶:=CONST(HHV(MAX(MACD高点定位,MACD低点定位),K线个数));
底:=CONST(LLV(MIN(MACD高点定位,MACD低点定位),K线个数));
{-【主力动向】,即原【SUPL】往事如风-QQ:105365158 经海量数据分析及精准校验--};
TMP:=LARGEINTRDVOL-LARGEOUTTRDVOL;
DDY动因:=IF(TRADENUM>0,(TRADEOUTNUM-TRADEINNUM)*100/TRADENUM,0);
涨跌动因:=IF(DDY动因>0 OR DDY动因<0 OR TMP>0 OR TMP<0,DDY动因,DRAWNULL),NODRAW;
SUPL资金线:=SUM((LARGEINTRDVOL-LARGEOUTTRDVOL)*10000/FINANCE(7),0);
主力资金线:=IF(CURRBARSCOUNT<=K线个数,IF(REF(SUPL资金线,1)=DRAWNULL,DRAWNULL,SUPL资金线),DRAWNULL);
资金线统计周期:=BARSCOUNT(主力资金线);
资金线HH:=CONST(HHV(主力资金线,资金线统计周期));
资金线LL:=CONST(LLV(主力资金线,资金线统计周期));
资金线:IF(涨跌动因=DRAWNULL,DRAWNULL,(主力资金线-LLV(资金线LL,资金线统计周期))/(HHV(资金线HH,资金线统计周期)-LLV(资金线LL,资金线统计周期))*(顶-底)+底),COLORFFFF00;
{资金净流}
增减【万】:IF(涨跌动因=DRAWNULL,DRAWNULL,IF(FINANCE(7)=DRAWNULL,DRAWNULL,(LARGEINTRDVOL-LARGEOUTTRDVOL)*AMO/V/10000)),COLORC08080,NODRAW;
⑤日:=IF(涨跌动因=DRAWNULL,DRAWNULL,IF(MA(资金线,5)=DRAWNULL,EMA(资金线,5),MA(资金线,5))),COLOR800080,NODRAW;
趋势:=IF(涨跌动因=DRAWNULL,DRAWNULL,IF(MA(资金线,10)=DRAWNULL,EMA(资金线,10),MA(资金线,10))),COLOR008080,NODRAW;
{-对【短线掘金】指标进行修改,并为MACD红绿柱配上不同的颜色,使更便于观察判断-}
量能:=MA((VOL-REF(VOL,1))/REF(VOL,1),10);
大盘趋势:=(CLOSE-MA(CLOSE,22))/MA(CLOSE,22);
个股趋势:=(CLOSE-MA(CLOSE,22))/MA(CLOSE,22);
股价趋势:=IF(HSL=DRAWNULL,大盘趋势,个股趋势);
原净买量A:=(股价趋势*(1+量能))-MA((股价趋势*(1+量能)),8),COLOR00DDFF;
原净买量:=IF(原净买量A=DRAWNULL,柱偏离,原净买量A);
动量:=IF((原净买量+柱偏离)<-柱偏离*1.1 AND 原净买量<0,柱偏离*0.1,IF((原净买量+柱偏离)>柱偏离*1.1 AND 原净买量>0,柱偏离*0.1,原净买量)),COLOR00B0B0;
上涨:=原净买量>0 AND 柱偏离>0;反弹:=原净买量>0 AND 柱偏离<0;
调整:=原净买量<0 AND 柱偏离>0;下跌:=原净买量<0 AND 柱偏离<0;
净买量流向A:=IF(上涨,动量+柱偏离,IF(反弹,柱偏离-动量,IF(调整,柱偏离-动量,动量+柱偏离)));
净量:=IF(净买量流向A=DRAWNULL,柱偏离,净买量流向A),COLOR00CCFF,NODRAW;
{MACD兰柱}
STICKLINE(柱偏离<0,0,柱偏离,2.3,0),COLOR884400;
STICKLINE(柱偏离<0,0,柱偏离,1.7,0),COLORAA6600;
STICKLINE(柱偏离<0,0,柱偏离,1.0,0),COLORCC8800;
STICKLINE(柱偏离<0,0,柱偏离,0.33,0),COLOREEAA00;
{MACD量价配合}
量价配合:=原净买量>0 AND 柱偏离>0;
STICKLINE(量价配合,0,净量,2.3,0),COLOR104A7A;
STICKLINE(量价配合,0,净量,1.7,0),COLOR106699;
STICKLINE(量价配合,0,净量,1.0,0),COLOR1088BB;
STICKLINE(量价配合,0,净量,0.33,0),COLOR10AADD;
{MACD量价背离}
量价背离:=原净买量<=0 AND 柱偏离>0;
STICKLINE(量价背离 OR 柱偏离<0,0,柱偏离,2.3,0),COLOR8A4A00;
STICKLINE(量价背离 OR 柱偏离<0,0,柱偏离,1.7,0),COLORAA6600;
STICKLINE(量价背离 OR 柱偏离<0,0,柱偏离,1.0,0),COLORCC8800;
STICKLINE(量价背离 OR 柱偏离<0,0,柱偏离,0.33,0),COLOREEAA00;
{MACD量价齐跌}
量价齐跌:=原净买量<=0 AND 柱偏离<0;
STICKLINE(量价齐跌,0,柱偏离,2.3,0),COLOR004400;
STICKLINE(量价齐跌,0,柱偏离,1.7,0),COLOR005A00;
STICKLINE(量价齐跌,0,柱偏离,1.0,0),COLOR007700;
STICKLINE(量价齐跌,0,柱偏离,0.33,0),COLOR009000;
{MACD持续上涨}
持续上涨:=原净买量>=0 AND 柱偏离>=0 AND M_升>0;
STICKLINE(持续上涨,0,柱偏离,2.3,0),COLOR660077;
STICKLINE(持续上涨,0,柱偏离,1.7,0),COLOR770088;
STICKLINE(持续上涨,0,柱偏离,1.0,0),COLOR880099;
STICKLINE(持续上涨,0,柱偏离,0.33,0),COLOR9900AA;
{MACD上涨趋势}
量价齐升:=原净买量>=0 AND 柱偏离>=0 AND M_升>0 AND 柱偏离>=M_降;
STICKLINE(量价齐升,0,柱偏离,2.3,0),COLOR201066;
STICKLINE(量价齐升,0,柱偏离,1.7,0),COLOR201088;
STICKLINE(量价齐升,0,柱偏离,1.0,0),COLOR2010AA;
STICKLINE(量价齐升,0,柱偏离,0.33,0)COLOR2010C5;
{零轴线}
STICKLINE(1,0,0,6,0),COLOR002040;
{DRAWICON(CROSS(⑤日,趋势) AND ⑤日>REF(⑤日,1),⑤日,13);
DRAWICON(CROSS(资金线,⑤日) AND CROSS(资金线,趋势),⑤日,13);
DRAWICON(CROSS(趋势,资金线),⑤日,14);
DRAWICON(CROSS(⑤日,资金线) AND CROSS(趋势,资金线),⑤日,14);}
{----对【MACD】指标趋势及【SUPL资金线】指标线形立体描边,以增强视觉效果----}
上升时DIF:=IF(PERIOD!=0 AND M_升>M_降,M_升,DRAWNULL),COLOR332099;
上升时DEA:=IF(PERIOD!=0 AND M_升>M_降,M_降,DRAWNULL),COLOR332099;
下降时DIF:=IF(PERIOD!=0 AND M_升<M_降,M_升,DRAWNULL),COLOR205500;
下降时DEA:=IF(PERIOD!=0 AND M_升<M_降,M_降,DRAWNULL),COLOR205500;
上升时DIF补画:DRAWBAND(上升时DIF,RGB(153,32,51),上升时DIF,RGB(153,32,51));
上升时DEA补画:DRAWBAND(上升时DEA,RGB(153,32,51),上升时DEA,RGB(153,32,51));
下降时DIF补画:DRAWBAND(下降时DIF,RGB(0,85,32),下降时DIF,RGB(0,85,32));
下降时DEA补画:DRAWBAND(下降时DEA,RGB(0,85,32),下降时DEA,RGB(0,85,32));
{-资金趋势指标,往事如风原创,QQ:105365158,决策信号存于如风服务器,破解无效!-}
短期:=100*(C-LLV(L,5))/(HHV(C,5)-LLV(L,5));
中期:=100*(C-LLV(L,10))/(HHV(C,10)-LLV(L,10));
中长期:=100*(C-LLV(L,20))/(HHV(C,20)-LLV(L,20));
长期:=100*(C-LLV(L,30))/(HHV(C,30)-LLV(L,30));
短线:=MA(C,3)>REF(MA(C,3),1) AND REF(MA(C,3),1)<REF(MA(C,3),2);
生命线:=MA(FORCAST(MA(C,1)/MA(REF(C,18),18)*100,20),6);
真伪:=短线 AND 长期>=80 AND 长期>中长期 AND 长期>中期 AND 长期>短期 AND 生命线>REF(生命线,1);
DRAWTEXT(真伪,M_降,11),COLOR0080FF;
A1:=BARSLAST(REF(CROSS(M_升,M_降),1));
底背离:=REF(CLOSE,A1+1)>CLOSE AND M_升>REF(M_升,A1+1) AND CROSS(M_升,M_降);
A2:=BARSLAST(REF(CROSS(M_降,M_升),1));
顶背离:=REF(CLOSE,A2+1)<CLOSE AND REF(M_升,A2+1)>M_升 AND CROSS(M_降,M_升);
低位金叉:=CROSS(M_升,M_降) AND M_升<-0.1;
JCCOUNT:=COUNT(CROSS(M_升,M_降),BARSLAST(M_降>=0));
二次金叉:=CROSS(M_升,M_降) AND M_降<0 AND COUNT(JCCOUNT=2,21)=1;
DRAWICON(低位金叉 AND 二次金叉 AND 底背离,M_降,1);
DRAWTEXT(顶背离,M_降,12),COLORFFFFFF;
DRAWTEXT(底背离,M_降,13),COLORFF0080;
DRAWTEXT(二次金叉,M_升,14),COLORYELLOW;
{资金线,强势区}
⑤日DIF分时互换:=IF(PERIOD=0,M_升,⑤日),COLOR332099;
趋势DEA分时互换:=IF(PERIOD=0,M_降,趋势),COLOR332099;
DRAWBAND(资金线,RGB(0,255,255),资金线,RGB(0,255,255));
DRAWBAND(⑤日DIF分时互换,RGB(102,16,102),⑤日DIF分时互换,RGB(128,128,0));
DRAWBAND(趋势DEA分时互换,RGB(128,128,0),趋势DEA分时互换,RGB(128,128,0));
{主力买卖点}
主力买:=(LARGEINTRDVOL)*10000/FINANCE(7);
主力买HH:=CONST(HHV(主力买,资金线统计周期));
主力买LL:=CONST(LLV(主力买,资金线统计周期));
主力买入:=(主力买-LLV(主力买LL,资金线统计周期))/(HHV(主力买HH,资金线统计周期)-LLV(主力买LL,资金线统计周期))*(顶-底)-底;
主力卖:=(LARGEOUTTRDVOL)*10000/FINANCE(7);
主力卖HH:=CONST(HHV(主力卖,资金线统计周期));
主力卖LL:=CONST(LLV(主力卖,资金线统计周期));
|