FZ实时看盘--飞狐分时指标 源码

2011-02-15 17:07:00来源:本站整理浏览:107

FZ实时看盘

DRAWGBK(CLOSE,COLORRGB(50,200,50),COLORRGB(100,50,50),1);

"FZKD标尺.明支#day" ,COLORRED;
"FZKD标尺.明阻#day" ,COLORgreen;

MC:=REF(CLOSE,1);
阻力位:=IF(CLOSE>200,CLOSE*1.01,CLOSE*1.07);
阻力位1:=IF(CLOSE<10,CLOSE*1.05,阻力位);
止损位:=IF(CLOSE>200,CLOSE*0.99,CLOSE*0.93);
止损位1:=IF(CLOSE<10,CLOSE*0.95,止损位);
阻力位A:=IF(MC>200,MC*1.01,MC*1.07);
阻力位2:=IF(MC<10,MC*1.05,阻力位A);
止损位B:=IF(MC>200,MC*0.99,MC*0.93);
止损位2:=IF(MC<10,MC*0.95,止损位B);

DRAWTEXTEX(BARSTATUS=1,0,0,0,STKLABEL+' '+STKNAME+'              '),ColorFFFF80;

DRAWTEXTEX(BARSTATUS=2 and v>ref(v,1) and ma(v,5)>ref(ma(v,5),1),0,0,15,'今日成交量大于昨日,且有继续增大趋势'+'           '),Color8285FF,;
DRAWTEXTEX(BARSTATUS=2 and v<ref(v,1) and ma(v,5)>ref(ma(v,5),1),0,0,15,'今日成交量小于昨日,但有放大迹象'+'          '),Color8285FF;
DRAWTEXTEX(BARSTATUS=2 and v>ref(v,1)and ma(v,5)<ref(ma(v,5),1),0,0,15,'今日成交量大于昨日, 但有缩小迹象'+'           '),Color8285FF;
DRAWTEXTEX(BARSTATUS=2 and v<ref(v,1)and ma(v,5)<ref(ma(v,5),1),0,0,15,'今日成交量小于昨日,且有缩小迹象'+'           '),Color8285FF;
DRAWTEXTEX(CLOSE,0,0,30,'[昨/今日 止损位 :'+NUMTOSTR(止损位B,2)+'/'+NUMTOSTR(止损位1,2)+'**]'),LINETHICK1,colorFF00;
DRAWTEXTEX(CLOSE,0,0,45,'[昨/今日 阻力位 :'+NUMTOSTR(阻力位2,2)+'/'+NUMTOSTR(阻力位1,2)+']'),LINETHICK1,colorFEBAF5;


zq:=DATATYPE;
r1:=OPENMINUTES(time);
zs:=ref(close,r1);
zsr:=DYNAINFO( 3);
j:=SUM(close*vol,SUMBARS(vol,FINANCE( 7)))/SUM(vol,SUMBARS(vol,FINANCE( 7)));
jj:=SUM(close*vol,0)/SUM(vol,0);
jj1:=SUM(close*vol,r1)/SUM(vol,r1);
jja:=if(zq=6,jj,if(zq=1,jj1,jj));
zsa:=if(zq=6,zsr,if(zq=1,zs,zsr));
cr:=if(zq=6,close>0,if(zq=1,r1>1,close>0));
POLYLINE(cr,zsa),COLORGRAY,POINTDOT;
dk:=(sma(close,2,1)-sma(close,6,1))*2.1;

s2:=sma(c,2,1);
s6:=sma(c,6,1);
dk:=2*(s2-s6);
STICKLINE(dk>0,DYNAINFO( 3),DYNAINFO( 3)+dk,0,1),COLORRED;
STICKLINE(dk<0,DYNAINFO( 3),DYNAINFO( 3)+dk,0,1),COLORCYAN;
if DATATYPE>=0 then exit;
rc:=DYNAINFO(3);
q:=DATACOUNT;
hh:=DYNAINFO(5);
LL:=DYNAINFO(6);
f:=max(hh-rc,rc-LL);
ff:=f/rc*100;
q1h:=if(ff<1,0.9898*rc,rc-f*1.02);
q1l:=if(ff<1,0.9798*rc,rc-2*f*1.016);
//FILLRGN(1,q1h,q1l),colorblack;
R:=INDEXC;
Rh:=hhv(r,0);
RL:=llv(r,0);
Rb:=(q1h-q1l)/(RH[q]-RL[q]);
Ry:=(q1h+q1l-rb*(RH[q]+RL[q]))/2;
//r*rb+ry,COLORFF00FF;
//(求和(r*INDEXV,r)/求和(INDEXV,r))*rb+ry,COLOR00FF00;
流通:=finance(7)/10000;
qj1:=FINANCE( 7)/800;
qj2:=FINANCE( 7)/1000;
qj3:=FINANCE( 7)/1500;
qj4:=FINANCE( 7)/2000;
qj5:=FINANCE( 7)/4000;
qj6:=FINANCE( 7)/6000;
qj7:=FINANCE( 7)/8000;
qj8:=FINANCE( 7)/10000;
qj9:=ESTDATA(8)/13000;
XS:=if(finance(7)<1,qj9,if(流通<1,qj1,if(流通>=1 AND 流通<5,qj2,if(流通>=5 AND 流通<10,qj3,if(流通>=10 AND 流通<20,qj4,if(流通>=20 AND 流通<40,qj5,if(流通>=40 AND 流通<60,qj6,if(流通>=60 AND 流通<=100,qj7,if(流通>=100,qj8,0)))))))));
XS1:=XS*1.618;
主动买入:=求和(BUYVOL,0);
主动卖出:=求和(SELLVOL,0);
特单买:=if(BUYVOL>XS1,BUYVOL,0);
特单卖:=if(SELLVOL>XS1,SELLVOL,0);
大单买:=if(BUYVOL>XS and BUYVOL<=XS1,BUYVOL,0);
大单卖:=if(SELLVOL>XS and SELLVOL<=XS1,SELLVOL,0);
小单买:=if(BUYVOL<=XS,BUYVOL,0);
小单卖:=if(SELLVOL<=XS,SELLVOL,0);
特单买入:=SUM(特单买,0);
特单卖出:=SUM(特单卖,0);
大单买入:=SUM(大单买,0);
大单卖出:=SUM(大单卖,0);
小单买入:=SUM(小单买,0);
小单卖出:=SUM(小单卖,0);
大单差:=(特单买入+大单买入)-(特单卖出+大单卖出);

VARA:=if(BUYVOL<=ref(ASKVOL(1),1)+ref(ASKVOL(2),1)+ref(ASKVOL(3),1) AND close>=ref(ASKPRICE(3),1),BUYVOL,0);
上扫单:=求和(INTPART(if(VARA>XS AND VARA<XS1,BUYVOL,0)),0);
VARB:=if(SELLVOL<=ref(BIDVOL(1),1)+ref(BIDVOL(2),1)+ref(BIDVOL(3),1) AND close<=ref(BIDPRICE(3),1),SELLVOL,0);
下扫单:=求和(INTPART(if(VARB>XS AND VARA<XS1,SELLVOL,0)),0);
总:=(特单买入+特单卖出+大单买入+大单卖出+小单买入+小单卖出+上扫单+下扫单);
DRAWTEXTEX(DYNAINFO(7),1,20,830,'■ 大单买: '+NUMTOSTR(特单买入,0)),LINETHICK2,colorFF;
DRAWTEXTEX(DYNAINFO(7),1,260,830,'占:'+NUMTOSTR(floor(特单买入/总*100),0)+' %'),LINETHICK2,colorFF;
DRAWTEXTEX(DYNAINFO(7),1,20,860,'■ 大单卖: '+NUMTOSTR(特单卖出,0)),LINETHICK2,colorFF00;
DRAWTEXTEX(DYNAINFO(7),1,260,860,'占:'+NUMTOSTR(floor(特单卖出/总*100),0)+' %'),LINETHICK2,colorFF00;
DRAWTEXTEX(DYNAINFO(7),1,20,890,'■ 中单买: '+NUMTOSTR(大单买入,0)),LINETHICK2,colorFF;
DRAWTEXTEX(DYNAINFO(7),1,260,890,'占:'+NUMTOSTR(floor(大单买入/总*100),0)+' %'),LINETHICK2,colorFF;
DRAWTEXTEX(DYNAINFO(7),1,20,920,'■ 中单卖: '+NUMTOSTR(大单卖出,0)),LINETHICK2,colorFF00;
DRAWTEXTEX(DYNAINFO(7),1,260,920,'占:'+NUMTOSTR(floor(大单卖出/总*100),0)+' %'),LINETHICK2,colorFF00;
DRAWTEXTEX(DYNAINFO(7),1,20,950,'■ 小单买: '+NUMTOSTR(小单买入,0)),LINETHICK2,colorFF00FF;
DRAWTEXTEX(DYNAINFO(7),1,260,950,'占:'+NUMTOSTR(floor(小单买入/总*100),0)+' %'),LINETHICK2,colorFF00FF;
DRAWTEXTEX(DYNAINFO(7),1,20,980,'■ 小单卖: '+NUMTOSTR(小单卖出,0)),LINETHICK2,colorFFFF00;
DRAWTEXTEX(DYNAINFO(7),1,260,980,'占:'+NUMTOSTR(floor(小单卖出/总*100),0)+' %'),LINETHICK2,colorFFFF00;
DRAWTEXTEX(DYNAINFO(7),1,400,830,'■ 上扫单: '+NUMTOSTR(上扫单,0)),LINETHICK2,colorFF;
DRAWTEXTEX(DYNAINFO(7),1,640,830,'占:'+NUMTOSTR(floor(上扫单/总*100),0)+' %'),LINETHICK2,colorFFFF00;
DRAWTEXTEX(DYNAINFO(7),1,400,860,'■ 下扫单: '+NUMTOSTR(下扫单,0)),LINETHICK2,colorFFFF00;
DRAWTEXTEX(DYNAINFO(7),1,640,860,'占:'+NUMTOSTR(floor(下扫单/总*100),0)+' %'),LINETHICK2,colorFFFF00;
DRAWTEXTEX(DYNAINFO(7),1,400,890,'■ 大单差: '+NUMTOSTR(大单差,0)),LINETHICK2,colorFF00;
DRAWTEXTEX(DYNAINFO(7),1,640,890,'占:'+NUMTOSTR(大单差/(大单买入+大单卖出)*100,0)+' %'),LINETHICK2,colorFF00;
DRAWTEXTEX(DYNAINFO(7),1,400,920,'■ 多空差: '+NUMTOSTR((主动买入-主动卖出),0)),LINETHICK2,colorFFFF;
DRAWTEXTEX(DYNAINFO(7),1,640,920,'占:'+NUMTOSTR((主动买入-主动卖出)/总*100,0)+' %'),LINETHICK2,colorFFFF;


A:=REF(HHV(high,240),1);
AA:=A[DATACOUNT];
B:=REF(LLV(low,240),1);
BB:=B[DATACOUNT];
ZJ1:=(((HIGH + LOW) + (2 * CLOSE)) / 4);
ZJ2:=(((ZJ1 - EMA(ZJ1,21)) / STD(ZJ1,21)) * 100);
ZJ3:=EMA(ZJ2,5);
ZJ4:=EMA(ZJ3,2);
ZJ5:=EMA(ZJ4,2);
ZJ6:=(((3 * ZJ4) - (2 * ZJ5)) / 2);
IF((ZJ6 > 90),(AA * 0.998),AA),LINETHICK2,colorDD66AA;
IF((ZJ6 < (0 - 95)),(BB * 1.002),BB),LINETHICK2,colorDD66AA;

if datatype>0 then exit; //仅分笔周期及实时图运行本公式
k:="kdj.k#min60";
d:="kdj.d#min60";
a1:=ref(cross(k,d),2) and k>d;//前2分钟里60分种k.d金叉,现k大于d!
b1:ref(cross(d,k),2) and d>k;
if(a1 ,l*0.998,0),colorred,linethick4,CROSSDOT;
if(b1 ,l*1.002,0),colorgreen,linethick4,CROSSDOT;

BU:=BARSLAST((CLOSE = HHV(CLOSE,150)));
SE:=BARSLAST((CLOSE = LLV(CLOSE,150)));
KK1:=SE;
KK2:=BU;
LM1:=SE;
LM2:=BU;
OK:=((KK1 > KK2) AND (LM1 > LM2));
OK1:=((KK1 > KK2) AND (LM1 < LM2));
NOK:=((KK2 > KK1) AND (LM2 > LM1));
NOK1:=((KK2 > KK1) AND (LM2 < LM1));

DRAWICON(CROSS(KK1,KK2),low,5);
DRAWICON(CROSS(KK2,KK1),low,6);

k1:=hhv(high,0);
k2:=llv(low,0);
k3:=BARSLAST(OPENMINUTES(time)<=240);
t1:=BARSLAST(OPENMINUTES(time)<=60);

DRAWICON(OPENMINUTES(time)>60 and cross(close,ref(k1,t1)+0.001),ref(k1,t1),8);//指示图标


BU:=BARSLAST(CLOSE=HHV(CLOSE,2000));
SE:=BARSLAST(CLOSE=LLV(CLOSE,2000));
KK1:=SE;
KK2:=BU;
LM1:=SE;
LM2:=BU;
OK:=KK1>KK2
AND LM1>LM2;
OK1:=KK1>KK2 AND LM1<LM2;
NOK:=KK2>KK1 AND
LM2>LM1;
NOK1:=KK2>KK1 AND
LM2<LM1;
DRAWICON(CROSS(KK1,KK2),OPEN,4);
DRAWTEXT(CROSS(KK1,KK2),OPEN,' 抓'),colorred;

T:=OPENMINUTES(TIME);
CLOSE=DYNAINFO(7);
总量:=SUM(VOL,T);
总额:=SUM(AMOUNT,T);
均价:=总额/(总量*100);
次数:=COUNT(CLOSE>均价,T);
占比:=次数/T*100;
分时强势:DRAWICON(CROSS(CLOSE,均价)
AND CLOSE>均价 AND 占比>80 AND
T>5,CLOSE,4);
DRAWTEXT(CROSS(CLOSE,均价) AND CLOSE>均价 AND 占比>80
AND
T>5,CLOSE,' 涨价'),colorFFFF;

ZF:=(EMA(SUM(((CLOSE - REF(CLOSE,1)) / REF(CLOSE,1)),3),49) * 10)+EMA(C,20);
plpl1:=(EMA(MA(((CLOSE - REF(CLOSE,1)) / REF(CLOSE,1)),3),13) * 10000),LINETHICK0,colorFFFFFF;

ZFF:=(EMA(SUM(((CLOSE - REF(CLOSE,1)) / REF(CLOSE,1)),3),49) * 10000);
plpl:=EMA(ZFF,34),LINETHICK0,color00FFFF;
cd1:=MA(ZFF,3);
ce1:=MA(cd1,3);
cf1:=MA(ce1,3);


cd:MA(ZF,3),color66DDFF;
ce:MA(cd,3),color666666;
cf:MA(ce,3),color888888;
cg:MA(cf,3),color9900FF;
ch:MA(cg,3),color7700FF;
ci:MA(ch,3),color0000FF;
cj1: IF(cd < REF(cd,1),cd,cd),color555555;
cj2: IF(ce < REF(ce,1),ce,cd),color555555;
cj3: IF(cf < REF(cf,1),cf,cd),color555555;
cj4: IF(cg < REF(cg,1),cg,cd),color555555;
cj5: IF(ch < REF(ch,1),ch,cd),color555555;
cj6: IF(ci < REF(ci,1),ci,cd),color555555;
close,LINETHICK2,COLORblack;
HS:=VOL/SUM(VOL,BARSCOUNT(C));
FBMAX:dma(c,hs),LINEDASHDOT,LINETHICK2,COLORMAGENTA;


昨收:=DYNAINFO(3);
HH:=DYNAINFO(5);
LL:=DYNAINFO(6);
FK:=MAX(HH-昨收,昨收-LL);
ZS:=昨收-FK*1.01;
Q1:=昨收-FK*1.012;
Q2:=昨收-2*FK*1.012;
Q3:=昨收-3*FK*1.01;


FILLRGN(1,昨收-2*FK*1.015,昨收-3*FK*1.01),color1B4756;

r:="rsi.rsi1";
rh:=hhv(r,0);
rL:=LLv(r,0);
rb:=1.015*max(DYNAINFO(5)-DYNAINFO(3),DYNAINFO(3)-DYNAINFO(6))/(rh-rL);
ry:=(2*DYNAINFO(3)-3.035*max(DYNAINFO(5)-DYNAINFO(3),DYNAINFO(3)-DYNAINFO(6))-rb*(rh+rL))/2;
r*rb[datacount]+ry[datacount],color320058;


RSV:=((CLOSE-LLV(LOW,240))/(HHV(HIGH,240)-LLV(LOW,240))*200-100)/2;
K:=SMA(SMA(RSV,18,1),3,1);
D:=MA(EMA(K,18),3);
J:=3*K-2*D;
空头:=-3*K-2*D;
DIFF:=EMA(CLOSE,240)-EMA(CLOSE,240)*100;
DEA:=EMA(DIFF,18);
多头MACD:=(-3*(DIFF-DEA))*2;
ZD:=HHV(多头MACD,0);
ZX:=LLV(多头MACD,0);
CZ:=(Q2-Q3)/6;

FDM:=MAX(ABS(ZD),ABS(ZX))*1.5;
RB:=(Q2+Q3)/2+2*(Q2-Q3)/3/FDM*多头MACD;
STICKLINE(多头MACD>0,RB,(Q2+Q3)/2,2,1),LINETHICK2,color320058;
STICKLINE(多头MACD<0,RB,(Q2+Q3)/2,2,1),LINETHICK2,color009933;
短买:IF(CROSS(K,D) AND K>0,(Q2+Q3)/2+(Q2-Q3)/4,(Q2+Q3)/2),LINETHICK2,colorFF00FF;
突击:IF(CROSS(多头MACD,空头) AND 多头MACD>0,(Q2+Q3)/2+(Q2-Q3)/4,(Q2+Q3)/2),LINETHICK2,colorFFFF;
DRAWICON(CROSS(K,D) AND K>0,RB,1),ALIGN1;
DRAWTEXT(CROSS(K,D) AND K>0,(Q2+Q3)/2+(Q2-Q3)/3,'短买'),colorFF0000;
DRAWTEXT(CROSS(多头MACD,空头) AND 多头MACD>0,(Q2+Q3)/2+(Q2-Q3)/3,'突击'),colorFFFF00;


RSVa:=((((HHV(HIGH,10) - CLOSE) / (HHV(HIGH,10) - LLV(LOW,10)))*2) - 1.25);
散户:SMA(RSVa,5,1);
RSVb:=((((CLOSE - LLV(LOW,10)) / (HHV(HIGH,10) - LLV(LOW,10)))*2) - 1.05);
主力:SMA(RSVb,5,1);


kh:=HHV(MAX(散户,主力),0);
kL:=LLV(MIN(主力,散户),0);
kb:=1.017*MAX(DYNAINFO(5)-DYNAINFO(3),DYNAINFO(3)-DYNAINFO(6))/(kh-kL);
ky:=(2*DYNAINFO(3)-5.067*MAX(DYNAINFO(5)-DYNAINFO(3),DYNAINFO(3)-DYNAINFO(6))-kb*(kh+kL))/2;
主力*kb[DATACOUNT]+ky[DATACOUNT],colorred;
散户*kb[DATACOUNT]+ky[DATACOUNT],colorgreen;

股票公式栏目导航

精品指标推荐

最新热门

本类随机推荐

相关公式