飞狐一线决胜主图指标公式

[复制链接]
查看121 | 回复0 | 2021-8-21 12:43:36 | 显示全部楼层 |阅读模式

input:N(4,1,100),M(2,1,100);
AA:=(REF(h,N) = HHV(HIGH,((2 * N) + 1)));
AAA:=FILTER(AA,N);
BB:=BACKSET(AAA,(N + 1));
CC1:=FILTER(BB,N);
CC:=(CC1 OR ISLASTBAR);
AA2:=(REF(LOW,N) = LLV(LOW,((2 * N) + 1)));
AAA2:=FILTER(AA2,N);
BB2:=BACKSET(AAA2,(N + 1));
CC22:=FILTER(BB2,N);
CC2:=(CC22 AND NOT(CC1));
EA:=BACKSET(CC,(REF(BARSLAST(CC2),1) + 1));
EB:=(EA > REF(EA,1));
EE:=BACKSET(EB,2);
FF1:=(EE > REF(EE,1));
EE2:=BACKSET((FF1 AND (COUNT(CC,(REF(BARSLAST(CC2),1) + 2)) = 0)),(REF(BARSLAST(CC2),1) + 2));
FF2:=(EE2 > REF(EE2,1));
EE3:=BACKSET((FF2 AND (COUNT(CC,(REF(BARSLAST(CC2),1) + 2)) = 0)),(REF(BARSLAST(CC2),1) + 2));
FF3:=(EE3 > REF(EE3,1));
JS:=IF(CC,COUNT(CC2,(REF(BARSLAST(CC),1) + 1)),0);
G1:=IF(((JS = 1) AND CC),BARSLAST(FF1),0);
GA:=IF((CC AND (REF(LOW,BARSLAST(FF1)) >= REF(LOW,BARSLAST(FF2)))),BARSLAST(FF2),BARSLAST(FF1));
G2:=IF(((JS = 2) AND CC),GA,0);
G3:=IF(((JS >= 3) AND CC),IF((CC AND (REF(LOW,GA) >= REF(LOW,BARSLAST(FF3)))),BARSLAST(FF3),GA),0);
GG:=((G1 + G2) + G3);
JA:=BACKSET(CC,GG);
JB:=(JA > REF(JA,1));
JJ:=BACKSET(JB,2);
LD:=(JJ > REF(JJ,1));
LD1:=(LD OR ISLASTBAR);
HEA:=BACKSET(LD1,(REF(BARSLAST(CC),1) + 1));
HEB:=(HEA > REF(HEA,1));
HEE:=BACKSET(HEB,2);
HFF1:=(HEE > REF(HEE,1));
HEE2:=BACKSET((HFF1 AND (COUNT(LD1,(REF(BARSLAST(CC),1) + 2)) = 0)),(REF(BARSLAST(CC),1) + 2));
HFF2:=(HEE2 > REF(HEE2,1));
HEE3:=BACKSET((HFF2 AND (COUNT(LD1,(REF(BARSLAST(CC),1) + 2)) = 0)),(REF(BARSLAST(CC),1) + 2));
HFF3:=(HEE3 > REF(HEE3,1));
HJS:=IF(LD1,COUNT(CC1,(REF(BARSLAST(LD1),1) + 1)),0);
HG1:=IF(((HJS = 1) AND LD1),BARSLAST(HFF1),0);
HGA:=IF((LD1 AND (REF(HIGH,BARSLAST(HFF1)) <= REF(HIGH,BARSLAST(HFF2)))),BARSLAST(HFF2),BARSLAST(HFF1));
HG2:=IF(((HJS = 2) AND LD1),HGA,0);
HG3:=IF(((HJS >= 3) AND LD1),IF((LD1 AND (REF(HIGH,HGA) <= REF(HIGH,BARSLAST(HFF3)))),BARSLAST(HFF3),HGA),0);
HGG:=((HG1 + HG2) + HG3);
HJA:=BACKSET(LD1,HGG);
HJB:=(HJA > REF(HJA,1));
HJJ:=BACKSET(HJB,2);
HD:=(HJJ > REF(HJJ,1));
X1:=BACKSET(ISLASTBAR,(BARSLAST(LD) + 1));
X2:=(X1 > REF(X1,1));
Y1:=BACKSET(ISLASTBAR,(BARSLAST(HD) + 1));
Y2:=(Y1 > REF(Y1,1));
Z1:=IF((BARSLAST(X2) < BARSLAST(Y2)),X2,Y2);
Z2:=IF((BARSLAST(X2) < BARSLAST(Y2)),LOW,HIGH);
UU:=BACKSET(ISLASTBAR,(BARSLAST(LD) + 1));
VV:=(UU > REF(UU,1));
VV:=BACKSET(VV,(REF(BARSLAST(LD),1) + 2));
WW:=(VV > REF(VV,1));
XX:=BACKSET(ISLASTBAR,(BARSLAST(HD) + 1));
UU2:=(XX > REF(XX,1));
VV2:=BACKSET(UU2,(REF(BARSLAST(HD),1) + 2));
WW2:=(VV2 > REF(VV2,1));
前一低:REF(LOW,BARSLAST(VV)),POINTDOT,LINETHICK2,color99FF66;
前二低:REF(LOW,BARSLAST(WW)),POINTDOT,LINETHICK2,colorFF66FF;
前一高:REF(HIGH,BARSLAST(UU2)),POINTDOT,LINETHICK2,color99FF66;
前二高:REF(HIGH,BARSLAST(WW2)),POINTDOT,LINETHICK2,colorFF66FF;
DRAWNUMBER((SYSPARAM(2) = BARPOS),CLOSE,FINANCE(33),2),ALIGN5;
DRAWTEXT((SYSPARAM(2) = BARPOS),CLOSE,'-收益'),ALIGN5;
DRAWTEXT((BARPOS = SYSPARAM(2)),HIGH,('\n所属块:' + BLKNAME)),ALIGN4,colorFFFF;
STICKLINE((CLOSE < OPEN),HIGH,LOW,1,0),color8800;
STICKLINE((CLOSE < OPEN),HIGH,LOW,0,0),colorFF00;
STICKLINE((CLOSE < OPEN),CLOSE,OPEN,8,0),color8800;
STICKLINE((CLOSE < OPEN),CLOSE,OPEN,7,0),color9900;
STICKLINE((CLOSE < OPEN),CLOSE,OPEN,6,0),colorAA00;
STICKLINE((CLOSE < OPEN),CLOSE,OPEN,5,0),colorBB00;
STICKLINE((CLOSE < OPEN),CLOSE,OPEN,4,0),colorCC00;
STICKLINE((CLOSE < OPEN),CLOSE,OPEN,3,0),colorDD00;
STICKLINE((CLOSE < OPEN),CLOSE,OPEN,2,0),colorEE00;
STICKLINE((CLOSE < OPEN),CLOSE,OPEN,1,0),colorFF00;
STICKLINE((CLOSE >= OPEN),HIGH,LOW,1,0),colorFF;
STICKLINE((CLOSE >= OPEN),HIGH,LOW,0,0),colorEEFF;
STICKLINE((CLOSE >= OPEN),CLOSE,OPEN,8,0),colorFF;
STICKLINE((CLOSE >= OPEN),CLOSE,OPEN,7,0),color22FF;
STICKLINE((CLOSE >= OPEN),CLOSE,OPEN,6,0),color44FF;
STICKLINE((CLOSE >= OPEN),CLOSE,OPEN,5,0),color66FF;
STICKLINE((CLOSE >= OPEN),CLOSE,OPEN,4,0),color88FF;
STICKLINE((CLOSE >= OPEN),CLOSE,OPEN,3,0),colorAAFF;
STICKLINE((CLOSE >= OPEN),CLOSE,OPEN,2,0),colorCCFF;
STICKLINE((CLOSE >= OPEN),CLOSE,OPEN,1,0),colorEEFF;
XX2:=(((((2 * CLOSE) + OPEN) + HIGH) + LOW) / 5);
VAR11:=VOL;
VAR12:=(SUM((XX2 * VAR11),3) / SUM(VAR11,3));
M8:=VAR12;
主力:=LLV(M8,5);
XX2:=(((((2 * CLOSE) + OPEN) + HIGH) + LOW) / 5);
VAR11:=VOL;
散户:=(SUM((XX2 * VAR11),1) / SUM(VAR11,1));
M1:=(SUM((XX2 * VAR11),5) / SUM(VAR11,5));
M5:=(SUM((XX2 * VAR11),13) / SUM(VAR11,13));
VAR12:=(SUM((XX2 * VAR11),3) / SUM(VAR11,3));
M13:=(SUM((XX2 * VAR11),21) / SUM(VAR11,21));
M21:=散户;
Y:=M1;
M8:=VAR12;
U1:=M5;
U3:=((Y > M8) AND (M8 > U1));
XX1:=IF((U3 > 0),LLV(Y,5),HHV(M8,5));
C5:=IF((U3 > 0),LLV(M8,8),HHV(M8,5));
C8:=IF((U3 > 0),LLV(U1,13),HHV(M8,5));
主力:=LLV(M8,7);
DRAWTEXT((主力 = REF(主力,1)),主力,'┬'),LINETHICK5,colorCC33FF;
{C13:="AAA.FH";
YH:="AAA.FL";
NH:BARSLAST((HIGH = C13)),LINETHICK0;
NL:BARSLAST((LOW = YH)),LINETHICK0;
DRAWNUMBER((NH = 0),(HIGH * 1.08),YEAR,0),ALIGN2,colorFF;
DRAWTEXT((NH = 0),(HIGH * 1.08),'年最高价'),colorFF;
DRAWNUMBER((NH = 0),(HIGH * 1.04),C13,2),ALIGN1,colorFFFFFF;
ND:ABS((NH - NL)),LINETHICK0;
DRAWTEXT((NH = 0),(HIGH * 1.12),'涨幅%'),ALIGN2,colorFF;
DRAWNUMBER((NH = 0),(HIGH * 1.12),((100 * (C13 - REF(YH,ND))) / REF(YH,ND)),2),ALIGN1,colorFF;
DRAWTEXT((NL = 0),(LOW * 0.93),'跌幅%'),ALIGN2,colorFF00;
DRAWNUMBER((NL = 0),(LOW * 0.93),((100 * (YH - REF(C13,ND))) / REF(C13,ND)),2),ALIGN1,colorFF00;}
YL:=(((CLOSE + HIGH) + LOW) / 3);
VAR1:=MA(YL,4);
CB:=HHV(VAR1,18);
A1:=HHV(VAR1,41);
A3:=(HHV(HIGH,62) * 0.98);
B1:=LLV(VAR1,18);
MID:=(LLV(LOW,62) * 1.02);
UPPER:=MA(CLOSE,20);
LOWER:=(UPPER + (2 * STD(CLOSE,20)));
JC:=(UPPER - (2 * STD(CLOSE,20)));
AA:=(CROSS("KDJ.K","KDJ.D") AND ("KDJ.D" < 30));
HZ:=CROSS("MACD.DIFF"(10,6,3),"MACD.DEA"(10,6,3));
VAR2:=(2 * ("MACD.DIFF"(10,6,3) - "MACD.DEA"(10,6,3)));
DRAWICON((((HZ AND (VAR2 > 0)) AND (REF(VAR2,1) < 0)) AND AA),LOW,1),ALIGN5;
YL:=REF(CLOSE,1);
VAR3:=((SMA(MAX((CLOSE - YL),0),6,1) / SMA(ABS((CLOSE - YL)),6,1)) * 100);
DRAWTEXT(CROSS(80,VAR3),(HIGH * 1.01),'★见顶'),colorFF;
VAR4:=(REF(HIGH,1) * 1.1);
VAR5:=(HIGH * 1.1);
VAR6:=(((VAR5 * VOL) + (VAR4 * (CAPITAL - VOL))) / CAPITAL);
VAR7:=(REF(LOW,1) * 0.9);
VAR8:=(LOW * 0.9);
VAR9:=(((VAR8 * VOL) + (VAR7 * (CAPITAL - VOL))) / CAPITAL);
VARA:=EMA(VAR9,30);
VARB:=EMA(VAR6,30);
VARC:=(VARB - 2);
VARD:=IF((CLOSE <= VARA),VARC,VARB);
VAA:=(MA(CLOSE,80) - (MA(CLOSE,10) / 17));
ABB:=(((EMA(EMA(EMA(CLOSE,N),N),N) - REF(EMA(EMA(EMA(CLOSE,N),N),N),1)) / REF(EMA(EMA(EMA(CLOSE,N),N),N),1)) * 100);
叉:=MA(ABB,M);
出手:=CROSS(ABB,叉);
VAR18:=(((VARD - VARC) = 0) AND 出手);
DRAWICON((VAR18 > 0),(LOW * 0.99),1);
DRAWTEXT(FILTER((VAR18 > 0),4),(LOW * 0.99),'赢'),colorFFFF;
STICKLINE(FILTER((VAR18 > 0),4),HIGH,LOW,0.5,0),colorFFFF;
STICKLINE(FILTER((VAR18 > 0),4),OPEN,CLOSE,6,0),LINETHICK2,colorFFFF;
VAR28:=((EMA(CLOSE,3) - EMA(CLOSE,6)) - ((EMA(CLOSE,6) - EMA(CLOSE,12)) * (0 - 100)));
VAR38:=EMA(VAR28,3);
VAR48:=((EMA(CLOSE,3) - EMA(CLOSE,6)) - ((EMA(CLOSE,24) - EMA(CLOSE,36)) * (0 - 100)));
VAR58:=EMA(VAR48,9);
VAR36:=CROSS(VAR28,VAR38);
拐点:=CROSS(VAR38,VAR28);
STICKLINE(拐点,OPEN,CLOSE,1.5,0),colorFFFFFF;
STICKLINE(VAR36,OPEN,CLOSE,8,0),colorFF;
STICKLINE(VAR36,OPEN,(CLOSE - ((CLOSE - OPEN) * 0.33)),8,0),colorFFFF;
STICKLINE(VAR36,OPEN,(CLOSE - ((CLOSE - OPEN) * 0.66)),8,0),LINETHICK2,colorFF00FF;
拐点1:=MA(CLOSE,5);
GD1:=MA(CLOSE,5);
GD2:=(REF((COUNT((拐点1 <= REF(拐点1,1)),5) = 5),1) AND (拐点1 > REF(拐点1,1)));
YY:=(REF((COUNT((GD1 <= REF(GD1,1)),5) = 5),1) AND (GD1 > REF(GD1,1)));
DRAWICON(GD2,(LOW * 0.99),8);
DRAWICON(GD2,(LOW * 0.98),1);
V1:=((((MA(CLOSE,3) + MA(CLOSE,4)) + MA(CLOSE,5)) + MA(CLOSE,6)) / 4);
{www.gupang.com 股旁网_飞狐股票指标公式}
VV:((((MA(CLOSE,8) + MA(CLOSE,8)) + MA(CLOSE,8)) + MA(CLOSE,8)) / 4),colorFF0000;
VV:=((((MA(CLOSE,4) + MA(CLOSE,8)) + MA(CLOSE,16)) + MA(CLOSE,32)) / 4);
PARTLINE((VV > REF(VV,1)),VV),LINETHICK3,colorEE00EE;
UPPER:=MA(CLOSE,20);
LOWER:=(UPPER + (2 * STD(CLOSE,20)));
JC:=(UPPER - (2 * STD(CLOSE,20)));
K1:=(((CLOSE - JC) / (LOWER - JC)) * 100);
V3:=(K1 - EMA(K1,5));
V4:=(SUM(LLV(V3,4),4) / 4);
V5:=(EMA(V3,64) * 10);
KS:=EMA(((0.4 * V3) * (0 - 1)),3);
RKS:=(0 - ((1 * EMA(V3,39)) * 10));
MLS:=(V5 > 10);
开:=(V3 > KS);
高:=(RKS > 10);
低:=(((V5 <= 10) OR (V3 <= KS)) OR (RKS <= 10));
收:=(((CLOSE - SMA(CLOSE,13,1)) / SMA(CLOSE,13,1)) * (0 - 100));
VAR326:=REF(收,1);
VAR327:=((((VAR326 / 收) > 1.23) AND (VAR326 > 13)) AND ((CLOSE / REF(CLOSE,1)) > 1.03));
VAR185:=OPEN;
VAR186:=HIGH;
VAR187:=LOW;
VAR188:=CLOSE;
超跌:STICKLINE((收 > 13),VAR186,VAR187,0,1),LINETHICK2,colorFFFFFF;
反弹:STICKLINE((VAR327 = 1),VAR186,VAR187,0,1),LINETHICK2,colorFF00FF;
STICKLINE((收 > 13),VAR185,VAR188,8,1),LINETHICK2,colorFFFFFF;
STICKLINE((VAR327 = 1),VAR185,VAR188,8,1),LINETHICK2,colorFF00FF;
VAR193:=IF((((CLOSE AND (MA(VOL,5) / 240)) AND (CLOSE > (REF(CLOSE,1) * 1))) AND CLOSE),88,0);
VAR194:=IF(((((((CLOSE / REF(CLOSE,1)) > 1.05) AND (((VOL / CAPITAL) * 100) < 10)) AND (CLOSE < 17)) AND ((HIGH / CLOSE) < 1.01)) AND (VAR193 > 0)),91,0);
STICKLINE((VAR194 > 90),(LOW * 0.98),(LOW * 0.96),8,0),colorFF;
DRAWTEXT((VAR194 > 90),(LOW * 0.95),'底'),colorFF00;

202108211208.jpg

202108211208.jpg

 

回复

使用道具 举报

您需要登录后才可以回帖 登录 | 立即注册

本版积分规则