飛狐股票公式之五里布林
{N:1,100,5}{時(shí)間:71068,1,80000}
input:n(5),時(shí)間(71068,1,80000);
{DRAWBKBMP(C>=MA(C,5),'sun');
DRAWBKBMP(C<=MA(C,5),'4786');
DRAWBKBMP(C>=MA(C,20),'sun2');
DRAWBKBMP(C<=MA(C,20),'moon');
DRAWBKBMP(C>=MA(C,250),'sun01');}
SAT:=IF((AMOUNT/C)/(HHV(AMOUNT,20)/HHV(C,20))*100>100,100,(AMOUNT/C)/(HHV(AMOUNT,20)/HHV(C,20))*100);
AA10:MA(CLOSE,3),COLOR0000FF;
AA12:MA(CLOSE,5),COLOR0000FF;
BB10:=((ATAN((AA10 - REF(AA10,1))) * 3.1416) * 10);
BB12:=((ATAN((AA12 - REF(AA12,1))) * 3.1416) * 10);
MA13:=MA(CLOSE,13);
fillrgn(AA10>aa12,aa10,aa12),coloryellow;
fillrgn(aa10<AA12,aa10,aa12),colorgreen;
趨勢:EMA(((SLOPE(CLOSE,21) * 20) + CLOSE),42),POINTDOT,COLORFF00FF,LINETHICK4;
STICKLINE(CLOSE> REF(CLOSE,1) ,HIGH,LOW,0,1 ),COLORRED;
STICKLINE(CLOSE> REF(CLOSE,1) ,OPEN,CLOSE,7.8,0 ),COLOR000077;
STICKLINE(CLOSE> REF(CLOSE,1) ,OPEN,CLOSE,5.7,0 ),COLOR000099;
STICKLINE(CLOSE> REF(CLOSE,1) ,OPEN,CLOSE,4.1,0 ),COLOR0000AA;
STICKLINE(CLOSE> REF(CLOSE,1) ,OPEN,CLOSE,2.5,0 ),COLOR0000BB;
STICKLINE(CLOSE> REF(CLOSE,1) ,OPEN,CLOSE,1.9,0 ),COLOR0000DD;
STICKLINE(CLOSE> REF(CLOSE,1) ,OPEN,CLOSE,0.8,0 ),COLOR0000FF;
STICKLINE(CLOSE= REF(CLOSE,1) ,HIGH,LOW,0,1 ),COLORWHITE;
STICKLINE(CLOSE= REF(CLOSE,1) ,OPEN,CLOSE,7.8,0 ),COLOR777777;
STICKLINE(CLOSE= REF(CLOSE,1) ,OPEN,CLOSE,5.7,0 ),COLOR999999;
STICKLINE(CLOSE= REF(CLOSE,1) ,OPEN,CLOSE,4.1,0 ),COLORAAAAAA;
STICKLINE(CLOSE= REF(CLOSE,1) ,OPEN,CLOSE,2.5,0 ),COLORBBBBBB;
STICKLINE(CLOSE= REF(CLOSE,1) ,OPEN,CLOSE,1.9,0 ),COLORDDDDDD;
STICKLINE(CLOSE= REF(CLOSE,1) ,OPEN,CLOSE,0.8,0 ),COLORFFFFFF;
STICKLINE(CLOSE< REF(CLOSE,1) ,HIGH,LOW,0,1 ),COLORCYAN;
STICKLINE(CLOSE< REF(CLOSE,1) ,OPEN,CLOSE,7.8,0 ),COLOR990000;
STICKLINE(CLOSE< REF(CLOSE,1) ,OPEN,CLOSE,5.7,0 ),COLORCC0000;
STICKLINE(CLOSE< REF(CLOSE,1) ,OPEN,CLOSE,4.1,0 ),COLORFF4400;
STICKLINE(CLOSE< REF(CLOSE,1) ,OPEN,CLOSE,2.5,0 ),COLORFF8800;
STICKLINE(CLOSE< REF(CLOSE,1) ,OPEN,CLOSE,1.9,0 ),COLORFFCC00;
STICKLINE(CLOSE< REF(CLOSE,1) ,OPEN,CLOSE,0.8,0 ),COLORCYAN;
X1:=(C+L+H)/3;BB13:=ATAN(EMA(X1,13)-REF(EMA(X1,13),1))*3.1416*10;
EMA8:=EMA(C,8);DRAWTEXT(FILTER(BB13>1 AND EMA(X1,13)>REF(EMA(X1,8),1),10),
EMA8,'∠45上升'),COLORWHITE;
壓力:MA(REF(HHV(C,30),1),2),COLOR00FF00;
支撐:MA(REF(LLV(C,30),1),2),COLOR0000FF;
AA1:=AMOUNT/V;BB1:=L<AA1*0.9;
CC1:=(C-REF(C,1))/REF(C,1)*100>1.2;DD1:=L<MA(C,5)*0.921;EE1:=V<MA(V,5)*1.5;
FF1:=BB1 AND CC1 AND DD1 AND EE1;DRAWTEXT(FF1,(LOW* 0.99),'鼠'),COLOR4080FF;
A51:=3*SMA((C-LLV(L,55))/(HHV(H,55)-LLV(L,55))*100,5,1)-2*SMA((C-LLV(L,55))/(HHV(H,55)-LLV(L,55))*100,5,1);
黑馬線:=EMA(A51,5);A54:=((C-LLV(L,21))/(HHV(H,21)-LLV(L,21)))*100;
趨勢線:=(MA(3*SMA(A54,6,1)-2*SMA(SMA(A54,5,1),5,1),2));
DRAWTEXT(CROSS(趨勢線,0)AND 黑馬線<40,(HIGH* 0.97),'▲大馬'),COLORYELLOW;
LC:=REF(CLOSE,1);RSI:=((SMA(MAX((CLOSE - LC),0),3,1) / SMA(ABS((CLOSE - LC)),3,1)) * 100);
FF:=EMA(CLOSE,3);MA15:=EMA(CLOSE,21);
STICKLINE(CROSS(88,RSI),O,C,2.9,0),COLOR113311;
STICKLINE(CROSS(FF,MA15),O,C,2.9,0),COLOR00FFFF;
VAR2:=LLV(LOW,27);VAR3:=HHV(HIGH,34);VAR4:=EMA((CLOSE-VAR2)/(VAR3-VAR2)*4,4)*25;
注意買:=IF((VAR4<10),80,100);RSV:=(C-LLV(L,9))/(HHV(H,9)-LLV(L,9))*100;
K:=SMA(RSV,3,1);D:=SMA(K,3,1);J:=3*K-2*D;超跌:=IF(J<0,10,0);BDDD:=LLV(J,2)=LLV(J,8);
買入:=IF(CROSS(J,REF(J+0.01,1)) AND BDDD AND J<20,30,0);
DRAWTEXT(買入 AND 注意買=100 AND 超跌=0,LOW,'B'),COLOR8000FF;
MTM:=C-REF(C,1);DX:=100*EMA(EMA(MTM,6),6)/EMA(EMA(ABS(MTM),6),6);
買:=IF(LLV(DX,2)=LLV(DX,7) AND COUNT(DX<0,2) AND CROSS(DX,MA(DX,2)),1,0);
DRAWTEXT(FILTER(買=1,5),LOW-0.03,'拉'),COLOR0000FF;
GET:ZIG(3,N),COLORYELLOW;
PL5:=ZIG(3,5);
EN1:=ZIG(3,5)>REF(ZIG(3,5),1) AND REF(ZIG(3,5),1)<=REF(ZIG(3,5),2) AND REF(ZIG(3,5),2)<=REF(ZIG(3,5),3);
EX1:=ZIG(3,5)<REF(ZIG(3,5),1) AND REF(ZIG(3,5),1)>=REF(ZIG(3,5),2) AND REF(ZIG(3,5),2)>=REF(ZIG(3,5),3);
PL10:=ZIG(3,10);
EN2:=ZIG(3,10)>REF(ZIG(3,10),1) AND REF(ZIG(3,10),1)<=REF(ZIG(3,10),2) AND REF(ZIG(3,10),2)<=REF(ZIG(3,10),3);
EX2:=ZIG(3,10)<REF(ZIG(3,10),1) AND REF(ZIG(3,10),1)>=REF(ZIG(3,10),2) AND REF(ZIG(3,10),2)>=REF(ZIG(3,10),3);
PL20:=ZIG(3,20);
EN3:=ZIG(3,20)>REF(ZIG(3,20),1) AND REF(ZIG(3,20),1)<=REF(ZIG(3,20),2) AND REF(ZIG(3,20),2)<=REF(ZIG(3,20),3);
EX3:=ZIG(3,20)<REF(ZIG(3,20),1) AND REF(ZIG(3,20),1)>=REF(ZIG(3,20),2) AND REF(ZIG(3,20),2)>=REF(ZIG(3,20),3);
PL40:=ZIG(3,40);
走強(qiáng)1:=BARSLAST(PL5<REF(PL5,1));
走弱1:=BARSLAST(PL5>REF(PL5,1));
走強(qiáng)2:=BARSLAST(PL10<REF(PL10,1));
走弱2:=BARSLAST(PL10>REF(PL10,1));
走強(qiáng)3:=BARSLAST(PL20<REF(PL20,1));
走弱3:=BARSLAST(PL20>REF(PL20,1));
ZTJZ5:=IF(PL10>REF(PL10,1),COUNT(EN1,走強(qiáng)2),0);
ZTJD5:=IF(PL10>REF(PL10,1),COUNT(EX1,走強(qiáng)2),0);
DTJZ5:=IF(PL10<REF(PL10,1),COUNT(EN1,走弱2),0);
DTJD5:=IF(PL10<REF(PL10,1),COUNT(EX1,走弱2),0);
ZTJZ10:=IF(PL20>REF(PL20,1),COUNT(EN2,走強(qiáng)3),0);
ZTJD10:=IF(PL20>REF(PL20,1),COUNT(EX2,走強(qiáng)3),0);
DTJZ10:=IF(PL20<REF(PL20,1),COUNT(EN2,走弱3),0);
DTJD10:=IF(PL20<REF(PL20,1),COUNT(EX2,走弱3),0);
DRAWTEXT(EN1 AND DTJZ5=1,L*0.95,'(A)'),COLORFFFF00;
DRAWTEXT(EX1 AND DTJD5=2,H*1.02,'(B)'),COLORFF00FF;
DRAWTEXT(EN2 AND ZTJZ5=1,L*0.95,'(C)'),COLOR0000FF;
DRAWTEXT(EX1 AND PL10>REF(PL10,1) AND ZTJD5=1,H*1.02,'⑴'),COLOR0000FF;
DRAWTEXT(EN1 AND PL10>REF(PL10,1) AND ZTJZ5=2,L*0.98,'⑵'),COLOR0000FF;
DRAWTEXT(EX1 AND PL10>REF(PL10,1) AND ZTJZ5=2,H*1.02,'⑶'),COLOR0000FF;
DRAWTEXT(EN1 AND PL10>REF(PL10,1) AND ZTJZ5=3,L*0.98,'⑷'),COLOR0000FF;
DRAWTEXT(EX2 AND PL20>REF(PL20,1) AND ZTJD10=1,H*1.02,'⑸'),COLOR0000FF;
DRAWTEXT(EN2 AND DTJZ10=1,L*0.93,'Ⅰ'),COLORFF00FF;
DRAWTEXT(EX2 AND DTJD10=2,H*1.01,'Ⅱ'),COLORFFFF00;
DRAWTEXT(EN3 AND ZTJZ10=1,L*0.93,'Ⅲ'),COLOR0000FF;
DRAWTEXT(EX2 AND PL20>REF(PL20,1) AND ZTJD10=1,H*1.06,'①'),LINETHICK3,COLOR00FFFF;
DRAWTEXT(EN2 AND PL20>REF(PL20,1) AND ZTJZ10=2,L*0.94,'②'),LINETHICK3,COLOR00FFFF;
DRAWTEXT(EX2 AND PL20>REF(PL20,1) AND ZTJD10=2 OR (ZTJD10=0 OR ZTJD10=2) AND EX2,H*1.06,'③'),LINETHICK3,COLOR00FFFF;
DRAWTEXT(EN2 AND PL20>REF(PL20,1) AND ZTJZ10=3,L*0.94,'④'),LINETHICK3,COLOR00FFFF;
HH:=HIGH; LL:=LOW; OO:=OPEN; CC:=CLOSE;
<%
vh=ffl.vardata("hh")
vl=ffl.vardata("ll")
vo=ffl.vardata("oo")
vc=ffl.vardata("cc")
last=ubound(vh)
if last<101 then
b=last+1
else
b=0
for i=last-101 to last-51
vh(i)=vh(i+51)
vl(i)=vl(i+51)
vo(i)=vo(i+51)
vc(i)=vc(i+51)
next
a=(vh(last-51)+vl(last-51))/2
j=1
for i=last-49 to last
j=j+2
vh(i)=2*a-vl(i-j)
vl(i)=2*a-vh(i-j)
vo(i)=2*a-vc(i-j)
vc(i)=2*a-vo(i-j)
next
end if
ffl.vardata("hh")=vh
ffl.vardata("ll")=vl
ffl.vardata("oo")=vo
ffl.vardata("cc")=vc
ffl.varstartindex("hh")=b
ffl.varstartindex("ll")=b
ffl.varstartindex("oo")=b
ffl.varstartindex("cc")=b
%>
A:=BACKSET(ISLASTBAR,50);
STICKLINE(A AND CC>=OO,OO,CC,6,0),COLOR990099,SHIFT50;
STICKLINE(A AND CC>=OO,OO,CC,4,0),COLORbb00bb,SHIFT50;
STICKLINE(A AND CC>=OO,OO,CC,2,0),COLORdd00dd,SHIFT50;
STICKLINE(A AND CC>=OO,OO,CC,1,0),COLORff00ff,SHIFT50;
STICKLINE(A AND CC>=OO,LL,OO,0.1,1),COLORMAGENTA,SHIFT50;
STICKLINE(A AND CC>=OO,CC,HH,0.1,1),COLORMAGENTA,SHIFT50;
STICKLINE(A AND CC<OO,OO,CC,6,0),COLOR009900,SHIFT50;
STICKLINE(A AND CC<OO,OO,CC,4,0),COLOR00bb00,SHIFT50;
STICKLINE(A AND CC<OO,OO,CC,2,0),COLOR00dd00,SHIFT50;
STICKLINE(A AND CC<OO,OO,CC,1,0),COLOR00ff00,SHIFT50;
STICKLINE(A AND CC<OO,LL,HH,0.1,0),COLORGREEN,SHIFT50;
VERTLINE(ISLASTBAR),COLORYELLOW,POINTDOT;
BBI:="BBI";
中:=(MA(C,3)+MA(C,6)+MA(C,12)+MA(C,24))/4,COLORFF00FF,LINETHICK2;
上:=BBI+3*STD(BBI,10),COLOR00FF00;
下:=BBI-3*STD(BBI,10),COLOR0000FF;
安全:=MA(C,30),CIRCLEDOT,COLORFF00FF;
TJ1:=下*1.05>中 AND 中*1.05>上 AND 中>=REF(中,1) AND REF(中,1)>=REF(中,2);
TJ2:=LLV(REF(VOL,1),60);
VAR91:=REF(V,1)+REF(V,2)+REF(V,3)+REF(V,4)+REF(V,5);
VAR92:=VAR91/5;
LB:=V/VAR92;
TJ8:=C>LLV(LOW,120)*1.38;
VAR2:=(HIGH - LOW);
VAR3:=ABS((OPEN - CLOSE));
VAR4:=(HIGH - IF((CLOSE > OPEN),CLOSE,OPEN));
VAR5:=(IF((CLOSE > OPEN),OPEN,CLOSE) - LOW);
VAR6:=((VAR3 / VAR2) * VOL);
VAR7:=((VAR4 / VAR2) * VOL);
VAR8:=((VAR5 / VAR2) * VOL);
GG:=(VAR6 >= VAR7) AND (VAR6 >= VAR8) AND (CLOSE > OPEN);
TJ3:=LB>2 OR VOL/REF(VOL,1)>2 AND GG;
WLT1:=EMA(C,3);
WLT2:=EMA(C,5);
WLT3:=EMA(WLT2,5);
QQ:= C<上;
MM:=WLT1<REF(WLT1,1);
DD:=QQ AND MM;
TJ6:=COUNT(DD,7)=1;
TJ7:=C<LLV(LOW,250)*2.1;
XG:=TJ1 AND TJ7 AND TJ3;
DRAWICON(XG,LOW*0.96,6);
DRAWICON(TJ6 AND MM AND TJ8 AND 上>中*1.1,HIGH*1.01,5);
時(shí)間A:=1000000+時(shí)間;
時(shí)間B:=DATE;
d1:=DATE=時(shí)間A;
d2:=DATE=時(shí)間B;
tj1:=BARSLAST(d1);tj2:=BARSLAST(d2);hh:=HHV(HIGH,tj1);ll:=LLV(LOW,tj1);
hh1:=HHV(VOL,tj1);ll1:=LLV(VOL,tj1);zh:=REF(hh,tj2);zl:=REF(ll,tj2);
zh1:=REF(hh1,tj2);zl1:=REF(ll1,tj2);sj1:=NUMTOSTR(時(shí)間A,0);sj2:=NUMTOSTR(時(shí)間B,0);
zw:=BARSLAST(HIGH=hh);jw:=BARSLAST(LOW=ll);zw1:=BARSLAST(VOL=hh1);jw1:=BARSLAST(VOL=ll1);
qz:=(zh-zl)/zl*100*SGN(jw-zw);qz1:=IF(CAPITAL<1,SUM(INDEXV/ESTDATA(8)*100,tj1),SUM(VOL/CAPITAL*100,tj1));
xs:=NUMTOSTR(REF(DATE,zw),0);xx:=NUMTOSTR(REF(DATE,jw),0);
xs1:=NUMTOSTR(REF(DATE,zw1),0);xx1:=NUMTOSTR(REF(DATE,jw1),0);
A1:=COST(0.33);A2:=COST(5);A3:=COST(15);A4:=COST(55);A5:=COST(97);
成本90%:=COST(90);成本70%:=COST(70);成本30%:=COST(30);成本10%:=COST(10);
獲利:=WINNER(CLOSE)*100;套牢:=100-WINNER(CLOSE)*100;
DRAWTEXTEX(CLOSE,1,350,0,'90成本:'+NUMTOSTR(成本90%,2)),Color00DD00;
DRAWTEXTEX(CLOSE,1,350,60,'70成本:'+NUMTOSTR(成本70%,2)),Color00DDFF;
DRAWTEXTEX(CLOSE,1,200,0,'30成本:'+NUMTOSTR(成本30%,2)),Color00DD00;
DRAWTEXTEX(CLOSE,1,200,60,'10成本:'+NUMTOSTR(成本10%,2)),Color00DDFF;
DRAWTEXTEX(CLOSE,1,700,120,'底出擊:'+NUMTOSTR(A1,2)),ColorDDDDDD;DRAWTEXTEX(CLOSE,1,540,0,'建倉:'+NUMTOSTR(A2,2)),Color00DDFF;
DRAWTEXTEX(CLOSE,1,700,0,'快刀:'+NUMTOSTR(A3,2)),Colorff00FF;DRAWTEXTEX(CLOSE,1,860,0,'升浪:'+NUMTOSTR(A4,2)),Color0000FF;
DRAWTEXTEX(CLOSE,1,860,60,'預(yù)測:'+NUMTOSTR(A5,2)),ColorffFF00;DRAWTEXTEX(CLOSE,1,540,60,'獲利:'+NUMTOSTR(獲利,2)),ColorFF00FF;
DRAWTEXTEX(CLOSE,1,700,60,'套牢:'+NUMTOSTR(套牢,2)),Color00DD00;
(南方財(cái)富網(wǎng)SOUTHMONEY.COM)