大智慧从成交明细到龙虎成交指标源码公式
成交明细:
BUY1:=IF(BUYVOL AND VOL>=1000,BUYVOL,0);
大单买:SUM(BUY1,0),LINETHICK0;
SEL1:=IF(SELLVOL AND VOL>=1000,SELLVOL,0);
大单卖:SUM(SEL1,0),LINETHICK0;
BUY2:=IF(BUYVOL AND VOL<1000 AND VOL>=500,BUYVOL,0);
中单买:SUM(BUY2,0),LINETHICK0;
SEL2:=IF(SELLVOL AND VOL<1000 AND VOL>=500,SELLVOL,0);
中单卖:SUM(SEL2,0),LINETHICK0;
BUY3:=IF(BUYVOL AND VOL<500,BUYVOL,0);
小单买:SUM(BUY3,0),LINETHICK0;
SEL3:=IF(SELLVOL AND VOL<500,SELLVOL,0);
小单卖:SUM(SEL3,0),LINETHICK0;
总买单:=大单买+中单买+小单买;
总卖单:=大单卖+中单卖+小单卖;
大单买笔数:COUNT(BUY1,0);
中单买笔数:COUNT(BUY2,0);
小单买笔数:COUNT(BUY3,0);
大单卖笔数:COUNT(SEL1,0);
中单卖笔数:COUNT(SEL2,0);
小单卖笔数:COUNT(SEL3,0);
龙虎成交:
大单买:"成交明细.大单买#tick";
中单买:"成交明细.中单买#tick";
小单买:"成交明细.小单买#tick";
大单卖:"成交明细.大单卖#tick";
中单卖:"成交明细.中单卖#tick";
小单卖:"成交明细.小单卖#tick";
总买单:大单买+中单买+小单买,linethick0;
总卖单:大单卖+中单卖+小单卖,linethick0;
总成交:=总买单+总卖单;
HTB:=总买单/总成交*300;
HTS:=总卖单/总成交*300;
大单买笔数:"成交明细.大单买笔数#tick";
中单买笔数:"成交明细.中单买笔数#tick";
小单买笔数:"成交明细.小单买笔数#tick";
大单卖笔数:"成交明细.大单卖笔数#tick";
中单卖笔数:"成交明细.中单卖笔数#tick";
小单卖笔数:"成交明细.小单卖笔数#tick";
DRAWTEXTABS(125,5,'主动买: '+总买单),COLORRED;
DRAWTEXTABS(255,5,'主动卖: '+总卖单),COLORGREEN;
DRAWTEXTABS(385,5,'买卖比: '+总买单/总卖单),COLORWHITE;
DRAWTEXTABS(15,45,'主动买单: '),COLORRED;
DRAWRECTABS(135,35,135+HTB,85,RGB(255,0,0)),COLORWHITE;
DRAWTEXTABS(15,65,'占总成交:'+总买单/总成交*100+'%'),COLORRED;
DRAWTEXTABS(155+HTB+HTS,45,'主动卖单: '),COLORGREEN;
DRAWRECTABS(135+HTB,35,135+HTB+HTS,85,RGB(0,255,0)),COLORWHITE;
DRAWTEXTABS(155+HTB+HTS,65,'占总成交:'+总卖单/总成交*100+'%'),COLORGREEN;
DRAWTEXTABS(15,95,'大单买: '+大单买笔数+'笔 '+大单买),COLORRED;
DRAWRECTABS(135,95,135+大单买/总买单*HTB,125,RGB(200,0,0)),COLORWHITE;
DRAWTEXTABS(15,115,'占总买单:'+大单买/总买单*100+'%'),COLORRED;
DRAWTEXTABS(220,105,'大单相减: '+INTPART(大单买-大单卖)),COLORWHITE;
DRAWTEXTABS(15,135,'中单买: '+中单买笔数+'笔 '+中单买),COLORRED;
DRAWRECTABS(135+大单买/总买单*HTB,135,135+大单买/总买单*HTB+中单买/总买单*HTB,165,RGB(200,0,0)),COLORWHITE;
DRAWTEXTABS(15,155,'占总买单:'+中单买/总买单*100+'%'),COLORRED;
DRAWTEXTABS(220,145,'中单相减: '+INTPART(中单买-中单卖)),COLORWHITE;
DRAWTEXTABS(15,175,'小单买: '+小单买笔数+'笔 '+小单买),COLORRED;
DRAWRECTABS(135+大单买/总买单*HTB+中单买/总买单*HTB,175,135+大单买/总买单*HTB+中单买/总买单*HTB+小单买/总买单*HTB,205,RGB(200,0,0)),COLORWHITE;
DRAWTEXTABS(15,195,'占总买单:'+小单买/总买单*100+'%'),COLORRED;
DRAWTEXTABS(220,185,'小单相减: '+INTPART(小单买-小单卖)),COLORWHITE;
DRAWTEXTABS(155+HTB+HTS,95,'大单卖: '+大单卖笔数+'笔 '+大单卖),COLORGREEN;
DRAWRECTABS(135+HTB+HTS,95,(135+HTB+HTS)-大单卖/总卖单*HTS,125,RGB(0,200,0)),COLORWHITE;
DRAWTEXTABS(155+HTB+HTS,115,'占总卖单:'+大单卖/总卖单*100+'%'),COLORGREEN;
DRAWTEXTABS(155+HTB+HTS,135,'中单卖: '+中单卖笔数+'笔 '+中单卖),COLORGREEN;
DRAWRECTABS((135+HTB+HTS)-大单卖/总卖单*HTS,135,(135+HTB+HTS)-大单卖/总卖单*HTS-中单卖/总卖单*HTS,165,RGB(0,200,0)),COLORWHITE;
DRAWTEXTABS(155+HTB+HTS,155,'占总卖单:'+中单卖/总卖单*100+'%'),COLORGREEN;
DRAWTEXTABS(155+HTB+HTS,175,'小单卖: '+小单卖笔数+'笔 '+小单卖),COLORGREEN;
DRAWRECTABS((135+HTB+HTS)-大单卖/总卖单*HTS-中单卖/总卖单*HTS,175,(135+HTB+HTS)-大单卖/总卖单*HTS-中单卖/总卖单*HTS-小单卖/总卖单*HTS,205,RGB(0,200,0)),COLORWHITE;
DRAWTEXTABS(155+HTB+HTS,195,'占总卖单:'+小单卖/总卖单*100+'%'),COLORGREEN;
|