飞狐趋势跟踪分时指标
源码
N:=403;
DRAWTEXTEX(CLOSE,1,20,30,STKLABEL),LINETHICK6,colorFFFF00;
DRAWTEXTEX(CLOSE,1,140,30,STKNAME),LINETHICK6,colorFFFF;
DRAWTEXTEX(CLOSE,1,20,450,'------------------------------------------------------------------------------------'),LINETHICK1,colorEEEEEE;
A:=BUYVOL*CLOSE/100;
BZ:=SUM(A,0);
B:=CLOSE*SELLVOL/100;
SZ:=SUM(B,0);
Z:=BZ+SZ;
CZ:=BZ-SZ;
XB5:=IF(A<=5,A,0);
B5:=SUM(XB5,0);
XS5:=IF(B<=5,B,0);
S5:=SUM(XS5,0);
XB10:=IF(A<=10 AND A>=5,A,0);
B10:=SUM(XB10,0);
XS10:=IF(B<=10 AND B>=5,B,0);
S10:=SUM(XS10,0);
XB30:=IF(A<=30 AND A>=10,A,0);
B30:=SUM(XB30,0);
XS30:=IF(B<=30 AND B>=10,B,0);
S30:=SUM(XS30,0);
XB50:=IF(A<=50 AND A>=30,A,0);
B50:=SUM(XB50,0);
XS50:=IF(B<=50 AND B>=30,B,0);
S50:=SUM(XS50,0);
XB70:=IF(A<=70 AND A>=50,A,0);
B70:=SUM(XB70,0);
XS70:=IF(B<=70 AND B>=50,B,0);
S70:=SUM(XS70,0);
XB100:=IF(A<=100 AND A>=70,A,0);
B100:=SUM(XB100,0);
XS100:=IF(B<=100 AND B>=70,B,0);
S100:=SUM(XS100,0);
XB150:=IF(A>=100,A,0);
B150:=SUM(XB150,0);
XS150:=IF(B>=100,B,0);
S150:=SUM(XS150,0);
J5:=B5-S5;
J10:=B10-S10;
J30:=B30-S30;
J50:=B50-S50;
J70:=B70-S70;
J100:=B100-S100;
J150:=B150-S150;
DRAWTEXTEX(BARSTATUS=2 AND Z,1,320,45,'■总成金额(万元):'+NUMTOSTR(Z,2)),LINETHICK4,colorCCFFCC;
DRAWTEXTEX(BARSTATUS=2 AND BZ,1,30,500,'■■■■■买入:'+NUMTOSTR(BZ,2)),LINETHICK1,colorFF;
DRAWTEXTEX(BARSTATUS=2 AND SZ,1,250,500,'■■■■■卖出:'+NUMTOSTR(SZ,2)),LINETHICK1,colorFF00;
DRAWTEXTEX(BARSTATUS=2 AND B5,1,30,560,'5 万大单买入:'+NUMTOSTR(B5,2)),LINETHICK1,colorFF;
DRAWTEXTEX(BARSTATUS=2 AND S5,1,250,560,'5 万大单卖出:'+NUMTOSTR(S5,2)),LINETHICK1,colorFF00;
DRAWTEXTEX(BARSTATUS=2 AND B10,1,30,620,'10 万大单买入:'+NUMTOSTR(B10,2)),LINETHICK1,colorFF;
DRAWTEXTEX(BARSTATUS=2 AND S10,1,250,620,'10 万大单卖出:'+NUMTOSTR(S10,2)),LINETHICK1,colorFF00;
DRAWTEXTEX(BARSTATUS=2 AND B30,1,30,680,'30 万大单买入:'+NUMTOSTR(B30,2)),LINETHICK1,colorFF;
DRAWTEXTEX(BARSTATUS=2 AND S30,1,250,680,'30 万大单卖出:'+NUMTOSTR(S30,2)),LINETHICK1,colorFF00;
DRAWTEXTEX(BARSTATUS=2 AND B50,1,30,740,'50 万大单买入:'+NUMTOSTR(B50,2)),LINETHICK1,colorFF;
DRAWTEXTEX(BARSTATUS=2 AND S50,1,250,740,'50 万大单卖出:'+NUMTOSTR(S50,2)),LINETHICK1,colorFF00;
DRAWTEXTEX(BARSTATUS=2 AND B70,1,30,800,'70 万大单买入:'+NUMTOSTR(B70,2)),LINETHICK1,colorFF;
DRAWTEXTEX(BARSTATUS=2 AND S70,1,250,800,'70 万大单卖出:'+NUMTOSTR(S70,2)),LINETHICK1,colorFF00;
DRAWTEXTEX(BARSTATUS=2 AND B100,1,30,860,'100 万大单买入:'+NUMTOSTR(B100,2)),LINETHICK1,colorFF;
DRAWTEXTEX(BARSTATUS=2 AND S100,1,250,860,'100 万大单卖出:'+NUMTOSTR(S100,2)),LINETHICK1,colorFF00;
DRAWTEXTEX(BARSTATUS=2 AND B150,1,30,920,'150 万大单买入:'+NUMTOSTR(B150,2)),LINETHICK1,colorFF;
DRAWTEXTEX(BARSTATUS=2 AND S150,1,250,920,'150 万大单卖出:'+NUMTOSTR(S150,2)),LINETHICK1,colorFF00;
DRAWTEXTEX(BARSTATUS=2 AND CZ,1,500,500,'■■■■总净买入:'+NUMTOSTR(CZ,2)),LINETHICK1,colorCCFF00;
DRAWTEXTEX(BARSTATUS=2 AND J5,1,500,560,'5万大单净买入'+NUMTOSTR(J5,2)),LINETHICK1,colorCCFF00;
DRAWTEXTEX(BARSTATUS=2 AND J10,1,500,620,'10万大单净买入'+NUMTOSTR(J10,2)),LINETHICK1,colorCCFF00;
DRAWTEXTEX(BARSTATUS=2 AND J30,1,500,680,'30万大单净买入'+NUMTOSTR(J30,2)),LINETHICK1,colorCCFF00;
DRAWTEXTEX(BARSTATUS=2 AND J50,1,500,740,'50万大单净买入'+NUMTOSTR(J50,2)),LINETHICK1,colorCCFF00;
DRAWTEXTEX(BARSTATUS=2 AND J70,1,500,800,'70万大单净买入'+NUMTOSTR(J70,2)),LINETHICK1,colorCCFF00;
DRAWTEXTEX(BARSTATUS=2 AND J100,1,500,860,'100万大单净买入'+NUMTOSTR(J100,2)),LINETHICK1,colorCCFF00;
DRAWTEXTEX(BARSTATUS=2 AND J150,1,500,920,'150万大单净买入'+NUMTOSTR(J150,2)),LINETHICK1,colorCCFF00;
DD:=INTPART(LN(FINANCE(7)/(N*10))*ATAN(FINANCE(7))*100);
主动买入:=SUM(BUYVOL,0);
主动卖出:=SUM(SELLVOL,0);
大单买:=IF(BUYVOL>=DD,BUYVOL,0);
大单卖:=IF(SELLVOL>DD,SELLVOL,0);
大单买入:=SUM(大单买,0);
大单卖出:=SUM(大单卖,0);
小单买入:=主动买入-大单买入;
小单卖出:=主动卖出-大单卖出;
大买金:=SUM((IF(BUYVOL>=DD,BUYVOL,0))*CLOSE,0);
大单买均价:=大买金/大单买入;
大卖金:=SUM((IF(SELLVOL>DD,SELLVOL,0))*CLOSE,0);
大单卖均价:=大卖金/大单卖出;
成交笔数:=(SUM(IF(BUYVOL>0,1,0),0))+(SUM(IF(SELLVOL>0,1,0),0));
大单净量:=大单买入-大单卖出;
DRAWTEXTEX(CLOSE,1,30,420,'■ 大单净量:'+NUMTOSTR(大单净量,2)),LINETHICK2,colorFFFF;
DRAWTEXTEX(CLOSE,1,300,420,' 占'+NUMTOSTR(FLOOR(大单净量/(主动买入+主动卖出)*100),2)+' %'),LINETHICK2,colorFFFF;
DRAWTEXTEX(CLOSE,1,30,100,'■ 大单买入: '+NUMTOSTR(大单买入,2)),LINETHICK2,color8000FF;
DRAWTEXTEX(CLOSE,1,300,100,' 占'+NUMTOSTR(FLOOR(大单买入/(主动买入+主动卖出)*100),2)+'%'),LINETHICK2,color8000FF;
DRAWTEXTEX(CLOSE,1,500,100,'大单买均价:
DRAWTEXTEX(CLOSE,1,30,260,'■ 大单卖出: '+NUMTOSTR(大单卖出,2)),LINETHICK2,colorFF00;
DRAWTEXTEX(CLOSE,1,300,260,' 占'+NUMTOSTR(FLOOR(大单卖出/(主动买入+主动卖出)*100),2)+' %'),LINETHICK2,colorFF00;
DRAWTEXTEX(CLOSE,1,500,180,'大单卖均价:
DRAWTEXTEX(CLOSE,1,30,180,'■ 小单买入: '+NUMTOSTR(小单买入,2)),LINETHICK2,color2F73FF;
DRAWTEXTEX(CLOSE,1,300,180,' 占'+NUMTOSTR(FLOOR(小单买入/(主动买入+主动卖出)*100),2)+' %'),LINETHICK2,color2F73FF;
DRAWTEXTEX(CLOSE,1,30,340,'■ 小单卖出: '+NUMTOSTR(小单卖出,2)),LINETHICK2,colorB4B043;
DRAWTEXTEX(CLOSE,1,300,340,' 占'+NUMTOSTR(FLOOR(小单卖出/(主动买入+主动卖出)*100),2)+' %'),LINETHICK2,colorA8A800;
DRAWTEXTEX(CLOSE,1,500,260,'总成交笔数:
DRAWTEXTEX(CLOSE,1,500,340,'每笔成交手:
DRAWTEXTEX(CLOSE,1,500,420,'■大单标准:
EXPLAIN(1=1,'◆代码:'+STKLABEL+' '+STKNAME),color4080FF;
EXPLAIN(1,'------------------------------------'),colorCCFF00;
EXPLAIN(1,'总成金额(万元):'+NUMTOSTR(Z,2)),colorFFFF;
EXPLAIN(1,'买入:'+NUMTOSTR(BZ,2)+'
EXPLAIN(1,'分
EXPLAIN(1,'
EXPLAIN(1,' 10万大单 '+NUMTOSTR(B10,2)+'
EXPLAIN(1,' 30万大单 '+NUMTOSTR(B30,2)+'
EXPLAIN(1,' 50万大单 '+NUMTOSTR(B50,2)+'
EXPLAIN(1,' 70万大单 '+NUMTOSTR(B70,2)+'
EXPLAIN(1,'100万大单 '+NUMTOSTR(B100,2)+'
EXPLAIN(1,'150万大单 '+NUMTOSTR(B150,2)+'
EXPLAIN(1,'■■■■总净买入:'+NUMTOSTR(CZ,2)),LINETHICK1,colorCCFF00;
EXPLAIN(1,'--------------龙虎盯盘---------------'),colorCCFF00;
EXPLAIN(1,'■ 大单净量:
EXPLAIN(1,'■ 大单买入:
EXPLAIN(1,'■ 大单卖出:
EXPLAIN(1,'■ 小单买入:
EXPLAIN(1,'■ 小单卖出:
EXPLAIN(1,'------------------------------------'),colorCCFF00;
EXPLAIN(1,'大单买均价: '+NUMTOSTR(大单买均价,2)+'
EXPLAIN(1,'总成交笔数: '+NUMTOSTR(成交笔数,0)+'