以下是飞狐指标公式及公式源码
飞狐指标公式及选股公式源码:
拉升力:=(CLOSE-LLV(LOW,28))/(HHV(HIGH,30)-LLV(LOW,36))*0.6*CLOSE;
拉升力A:=SMA(拉升力,6.3,1);
波峰波谷:SMA(拉升力A,3,1),COLORFF00FF;
拉升力B:=3*拉升力A-2.1*波峰波谷;
空方:=3*波峰波谷-1*拉升力A;
做空:IF(空方 拉升力B,拉升力B,空方),LINETHICK1,COLOR00FF00;
做空周期:HHV(做空,21),COLORBLUE,LINETHICK1;
多头:IF(做空 =REF(做空,1),做空,DRAWNULL),COLORRED,LINETHICK2;
DRAWICON(做空 =REF(做空,1)ANDREF(做空,1) REF(做空,2),做空,23);
空头:IF(做空 REF(做空,1),做空,DRAWNULL),COLORGREEN,LINETHICK2;
{DRAWICON(做空 =REF(做空,1)ANDREF(做空,1) REF(做空,2),做空,19);}
:(CLOSE-MA(CLOSE,13))/MA(CLOSE,13)*20,LINETHICK0,COLORWHITE;
:(CLOSE-MA(CLOSE,4))/MA(CLOSE,4)*20,LINETHICK0,COLORYELLOW;
红柱:SMA(短线,3,1),LINETHICK0,COLOR0000FF;
蓝柱:SMA(中线,3,1),COLORSTICK,COLORFFFF00;
{红柱}
STICKLINE(红柱 REF(红柱,1)AND红柱 0,0,红柱,2,0),COLOR888800;
STICKLINE(红柱 REF(红柱,1)AND红柱 0,0,红柱,1.5,0),COLORAAAA00;
STICKLINE(红柱 REF(红柱,1)AND红柱 0,0,红柱,0.8,0),COLORDDDD00;
STICKLINE(红柱 REF(红柱,1)AND红柱 0,0,红柱,0.3,0),COLORFFFF00;
STICKLINE(红柱 REF(红柱,1)AND红柱 0,0,红柱,2,0),COLOR000088;
STICKLINE(红柱 REF(红柱,1)AND红柱 0,0,红柱,1.5,0),COLOR0000AA;
STICKLINE(红柱 REF(红柱,1)AND红柱 0,0,红柱,0.8,0),COLOR0000DD;
STICKLINE(红柱 REF(红柱,1)AND红柱 0,0,红柱,0.3,0),COLOR0000FF;
STICKLINE(蓝柱 REF(蓝柱,1)AND蓝柱 0,0,蓝柱,2,0),COLOR008800;
STICKLINE(蓝柱 REF(蓝柱,1)AND蓝柱 0,0,蓝柱,1,0),COLOR00AA00;
STICKLINE(蓝柱 REF(蓝柱,1)AND蓝柱 0,0,蓝柱,0.8,0),COLOR00DD00;
STICKLINE(蓝柱 REF(蓝柱,1)AND蓝柱 0,0,蓝柱,0.3,0),COLOR00FF00;
{蓝柱}
STICKLINE(红柱 REF(红柱,1)AND红柱 0,0,红柱,2,0),COLOR880088;
STICKLINE(红柱 REF(红柱,1)AND红柱 0,0,红柱,1.5,0),COLORAA00AA;
STICKLINE(红柱 REF(红柱,1)AND红柱 0,0,红柱,0.8,0),COLORDD00DD;
STICKLINE(红柱 REF(红柱,1)AND红柱 0,0,红柱,0.3,0),COLORFF00FF;
STICKLINE(红柱 REF(红柱,1)AND红柱 0,0,红柱,2,0),COLOR888800;
STICKLINE(红柱 REF(红柱,1)AND红柱 0,0,红柱,1.5,0),COLORAAAA00;
STICKLINE(红柱 REF(红柱,1)AND红柱 0,0,红柱,0.8,0),COLORDDDD00;
STICKLINE(红柱 REF(红柱,1)AND红柱 0,0,红柱,0.3,0),COLORFFFF00;
STICKLINE(蓝柱 REF(蓝柱,1)AND蓝柱 0,0,蓝柱,2,0),COLOR009999;
STICKLINE(蓝柱 REF(蓝柱,1)AND蓝柱 0,0,蓝柱,1.5,0),COLOR00BBBB;
STICKLINE(蓝柱 REF(蓝柱,1)AND蓝柱 0,0,蓝柱,0.8,0),COLOR00DDDD;
STICKLINE(蓝柱 REF(蓝柱,1)AND蓝柱 0,0,蓝柱,0.3,0),COLOR00FFFF;
VAR200:=(CLOSE-LLV(LOW,20))/(HHV(HIGH,20)-LLV(LOW,20))*100;
VAR300:=SMA(SMA(VAR200,3,1),3,1)/28.57;
VAR400:=EMA(VAR300,5);
操盘:=3*VAR300-2*VAR400;
A1:=CROSS(操盘,VAR300)ANDVAR300 2.1ANDC
STICKLINE(A1,5,0,4,0),COLOR770077;
STICKLINE(A1,5,0,3,0),COLOR990099;
STICKLINE(A1,5,0,2,0),COLORBB00BB;
STICKLINE(A1,5,0,1,0),COLORDD00DD;
STICKLINE(A1,5,0,0.3,0),COLORFF00FF;
DRAWTEXT(A1,5.2,'全仓'),COLORRED;
DRAWGBK(CLOSE 0,COLORRGB(1,340,226),COLORRGB(511,685,395),1);
VAR1N:=1131231;
U1:=IF(DATE =VAR1N,1,0);
STICKLINE(EMA((2*CLOSE+HIGH+LOW)/4,5) EMA((2*CLOSE+HIGH+LOW)/4,10),EMA((2*CLOSE+HIGH+LOW)/4,10),EMA((2*CLOSE+HIGH+LOW)/4,23),0,1),colorFF00FF;
STICKLINE(EMA((2*CLOSE+HIGH+LOW)/4,5) EMA((2*CLOSE+HIGH+LOW)/4,10),EMA((2*CLOSE+HIGH+LOW)/4,10),EMA((2*CLOSE+HIGH+LOW)/4,23),0,1),colorFFFF00;
DRAWTEXT(SYSPARAM(1)=BARPOS,CLOSE,''),ALIGN3,colorFFFF00;
STICKLINE(CLOSE MA(CLOSE,10),CLOSE,OPEN,9,0),colorAA;
STICKLINE(CLOSE MA(CLOSE,10),CLOSE,OPEN,8,0),color11BB;
STICKLINE(CLOSE MA(CLOSE,10),CLOSE,OPEN,7,0),color22CC;
STICKLINE(CLOSE MA(CLOSE,10),CLOSE,OPEN,6,0),color33DD;
STICKLINE(CLOSE MA(CLOSE,10),CLOSE,OPEN,5,0),color44EE;
STICKLINE(CLOSE MA(CLOSE,10),CLOSE,OPEN,4,0),color55FF;
STICKLINE(CLOSE MA(CLOSE,10),CLOSE,OPEN,3,0),color66FF;
STICKLINE(CLOSE MA(CLOSE,10),CLOSE,OPEN,2,0),color77FF;
STICKLINE(CLOSE MA(CLOSE,10),CLOSE,OPEN,1,0),color88FF;
STICKLINE(CLOSE MA(CLOSE,10),LOW,OPEN,0,1),colorFF;
STICKLINE(CLOSE MA(CLOSE,10),HIGH,CLOSE,0,1),colorFF;
STICKLINE(CLOSE =MA(CLOSE,10),CLOSE,OPEN,9,0),colorAA00;
STICKLINE(CLOSE =MA(CLOSE,10),CLOSE,OPEN,8,0),colorBB11;
STICKLINE(CLOSE =MA(CLOSE,10),CLOSE,OPEN,7,0),colorCC22;
STICKLINE(CLOSE =MA(CLOSE,10),CLOSE,OPEN,6,0),colorDD33;
STICKLINE(CLOSE =MA(CLOSE,10),CLOSE,OPEN,5,0),colorEE44;
STICKLINE(CLOSE =MA(CLOSE,10),CLOSE,OPEN,4,0),colorFF55;
STICKLINE(CLOSE =MA(CLOSE,10),CLOSE,OPEN,3,0),colorFF66;
STICKLINE(CLOSE =MA(CLOSE,10),CLOSE,OPEN,2,0),colorFF77;
STICKLINE(CLOSE =MA(CLOSE,10),CLOSE,OPEN,1,0),colorFF88;
STICKLINE(CLOSE =MA(CLOSE,10),HIGH,LOW,0,0),colorFF00;
ATR:=MA(TR,13);
VAR1:=REF(CLOSE,1)-REF(ATR,1);
临界线:HHV(VAR1,7)*U1,LINETHICK2,Color000040;
PARTLINE((EMA((2*CLOSE+HIGH+LOW)/4,5) REF(EMA((2*CLOSE+HIGH+LOW)/4,5),1))*U1,EMA((2*CLOSE+HIGH+LOW)/4,5)),colorFF;
PARTLINE((EMA((2*CLOSE+HIGH+LOW)/4,5) REF(EMA((2*CLOSE+HIGH+LOW)/4,5),1))*U1,EMA((2*CLOSE+HIGH+LOW)/4,5)),colorFF00;
PARTLINE((EMA((2*CLOSE+HIGH+LOW)/4,10) REF(EMA((2*CLOSE+HIGH+LOW)/4,10),1))*U1,EMA((2*CLOSE+HIGH+LOW)/4,10)),LINETHICK3,color4080FF;
PARTLINE((EMA((2*CLOSE+HIGH+LOW)/4,10) REF(EMA((2*CLOSE+HIGH+LOW)/4,10),1))*U1,EMA((2*CLOSE+HIGH+LOW)/4,10)),LINETHICK2,colorFF00;
PARTLINE(EMA((LOW+CLOSE+OPEN)/3,23) REF(EMA((LOW+CLOSE+OPEN)/3,23),1),REF(EMA((LOW+CLOSE+OPEN)/3,23),1)),LINETHICK3,colorFF;
PARTLINE(EMA((LOW+CLOSE+OPEN)/3,23) REF(EMA((LOW+CLOSE+OPEN)/3,23),1),REF(EMA((LOW+CLOSE+OPEN)/3,23),1)),LINETHICK3,colorFF00;
PARTLINE(EMA((LOW+CLOSE+OPEN)/3,23) REF(EMA((LOW+CLOSE+OPEN)/3,23),1),REF(EMA((LOW+CLOSE+OPEN)/3,23),1)),LINETHICK3,colorFF;
VAR1:=REF(CLOSE,1);
VAR2:=MA(CLOSE,5);
VAR3:=(SMA(MAX(CLOSE-VAR1,0),6,1))/(SMA(ABS(CLOSE-VAR1),6,1))*100;
VAR4:=(SMA(MAX(CLOSE-VAR1,0),12,1))/(SMA(ABS(CLOSE-VAR1),12,1))*100;
VAR5:=(SMA(MAX(CLOSE-VAR1,0),24,1))/(SMA(ABS(CLOSE-VAR1),24,1))*100;
VAR6:=IF(CROSS(VAR3,VAR5),LOW,REF(LOW,BARSLAST(CROSS(VAR3,VAR5))));
VAR7:=IF(CROSS(VAR5,VAR3),HIGH,REF(HIGH,BARSLAST(CROSS(VAR5,VAR3))));
VAR8:=IF(CLOSE =MA(CLOSE,20),80,50);
VAR9:=IF(CLOSE =MA(CLOSE,20),50,20);
VARA:=IF(VAR3 VAR8ANDREF(VAR3,1) =VAR8,HHV(REF(HIGH,1),(BARSLAST(VAR3 =VAR8ANDREF(VAR3,1) VAR8))-1),REF(HHV(REF(HIGH,1),(BARSLAST(VAR3 =VAR8ANDREF(VAR3,1) VAR8))-1),BARSLAST(VAR3 VAR8ANDREF(VAR3,1))));
VARB:=IF(HIGH VARA,LOW,REF(LOW,BARSLAST(HIGH VARA)));
VARC:=IF(HIGH VARA,VAR3,REF(VAR3,BARSLAST(HIGH VARA)));
VARD:=IF(HIGH VARBANDVAR3 VARCANDVAR3 VAR5,HIGH,REF(HIGH,BARSLAST(HIGH VARBANDVAR3 VARCANDVAR3 VAR5)));
VARE:=IF(VAR3 VAR9ANDREF(VAR3,1) =VAR9,LLV(REF(LOW,1),(BARSLAST(VAR3 =VAR9ANDREF(VAR3,1) VAR9))-1),REF(LLV(REF(LOW,1),(BARSLAST(VAR3 =VAR9ANDREF(VAR3,1) VAR9))-1),BARSLAST(VAR3 VAR9ANDREF(VAR3,1))));
VARF:=IF(LOW VARE,HIGH,REF(HIGH,BARSLAST(LOW VARE)));
VAR10:=IF(LOW VARE,VAR3,REF(VAR3,BARSLAST(LOW VARE)));
VAR11:=IF(LOW VARFANDVAR3 VAR10ANDVAR3 VAR5,LOW,REF(LOW,BARSLAST(LOW VARFANDVAR3 VAR10ANDVAR3 VAR5)));
压力线:VAR11*U1,LINETHICK2,colorFF00FF;
临界点:VARD*U1,LINETHICK3,colorFF0000;
MA6:=MA(CLOSE,5);
MA18:=MA(CLOSE,21);
MA55:=MA(CLOSE,34);
MA125:=MA(CLOSE,125);
MA250:=MA(CLOSE,250);
DIFF:=EMA(CLOSE,12)-EMA(CLOSE,26);
DEA:=EMA(DIFF,9);
MACD:=2*(DIFF-DEA);
加码价:=((CLOSE-REF(MA18,1))/18+MA18)*1.004;
加码条件:=CROSS(CLOSE,加码价)AND加码价 REF(加码价,1);
黄K出现股价站上临界点加码:IF(加码条件,LOW,HIGH)*U1,POINTDOT,colorFFFF;
STICKLINE(加码条件ANDMACD 0.1,HIGH,LOW,0,1),LINETHICK2,colorFFFF;
STICKLINE(加码条件ANDMACD 0.1,OPEN,CLOSE,4,1),LINETHICK2,colorFFFF;
选股源码:
{临界点加码}
MA18:=MA(CLOSE,21);
加码价:=((CLOSE-REF(MA18,1))/18+MA18)*1.004;
加码条件:=CROSS(CLOSE,加码价)AND加码价 REF(加码价,1);
临界加码:=IF(加码条件,8,0);
临界加码
T:=HHVBARS(H,120);
HT:=BArslAst(T=0ANDC
LT:=BARSLAST(L=LLV(L,HT+1));
ZF:=(C-REF(C,HT+1))/REF(C,HT+1)*100;
DT:=BARSLAST(ZF=LLV(ZF,HT+1));
LT1:=BARSLAST(LT=0ANDDT=0ANDZF -10);
ZFA:=REF(ZF,LT1);
XZF:=REFX(ZF,BARSNEXT(LT1=0));
ZF2:=(C-REF(C,LT1+1))/REF(C,LT1+1)*100;
A:=ZF2/Abs(REF(ZF,LT1));
HT1:=BARSLAST(H=HHV(H,LT1+1)ANDC OANDRANGE(A,2,2.5));
EXT2:DRAWLINE(HT1=0,H,REF(HT1=0,1),REF(H,HT1),1),COLORYELLOW,DOTLINE;
EXT1:DRAWLINE(HT=0ANDXZF -10,H,LT1=0,REF(H,HT),1),COLORRED,DOTLINE;
ST:=BARSLAST(crOSS(EXT2!=DRAWNULL,0.5));
XT:=BARSLAST(CROSS(EXT1!=DRAWNULL,0.5));
GL:=(C/EXT2-1)*100;
BL:=(EXT2/EXT1-1)*100;
TJ:=BL 10ANDXT STANDC OANDBL 22.8ANDGL
TJ1:=EVERY(maX(C,O) EXT1,ST+1);
TJ2:=EVERY(C EXT2,ST);
XG:=CROSS(C,EXT2)ANDEXT1!=DRAWNULLANDTJANDTJ1ANDREF(TJ2,1);
STICKLINE(XG,C,O,3,0),COLOR0099CC;
STICKLINE(XG,H,L,0,0),COLOR0099CC;
DRAWICON(XG,L*0.95,1);
{
选股公式:
T:=HHVBARS(H,120);
HT:=BARSLAST(T=0ANDC
LT:=BARSLAST(L=LLV(L,HT+1));
ZF:=(C-REF(C,HT+1))/REF(C,HT+1)*100;
DT:=BARSLAST(ZF=LLV(ZF,HT+1));
LT1:=BARSLAST(LT=0ANDDT=0ANDZF -10);
ZFA:=REF(ZF,LT1);
XZF:=REFX(ZF,BARSNEXT(LT1=0));
ZF2:=(C-REF(C,LT1+1))/REF(C,LT1+1)*100;
A:=ZF2/ABS(REF(ZF,LT1));
HT1:=BARSLAST(H=HHV(H,LT1+1)ANDC OANDRANGE(A,2,2.5));
EXT2:=DRAWLINE(HT1=0,H,REF(HT1=0,1),REF(H,HT1),1);
EXT1:=DRAWLINE(HT=0ANDXZF -10,H,LT1=0,REF(H,HT),1);
ST:=BARSLAST(CROSS(EXT2!=DRAWNULL,0.5));
XT:=BARSLAST(CROSS(EXT1!=DRAWNULL,0.5));
GL:=(C/EXT2-1)*100;
BL:=(EXT2/EXT1-1)*100;
TJ:=BL 10ANDXT STANDC OANDBL 22.8ANDGL
TJ1:=EVERY(MAX(C,O) EXT1,ST+1);
TJ2:=EVERY(C EXT2,ST);
XG:CROSS(C,EXT2)ANDEXT1!=DRAWNULLANDTJANDTJ1ANDREF(TJ2,1);
}
飞狐指标公式及选股公式截图