准确率100的技术指标文华财经指标公式期货软件macd与股价背离选股
期货最好用的指标公式文华财经指标公式多空操盘抄底逃顶
N:=5;M:=13;上:EMA(C,3),COLORBLUE,LINETHICK1;中:EMA(C,6),COLORWHITE,LINETHICK1;下:EMA(中,6),COLOR00FF00,LINETHICK1;IF(上>中AND 上>REF(上,1), 上,NULL),LINETHICK2,COLORRED;IF(中>下AND 中>REF(中,1), 中,NULL),LINETHICK2,COLORRED;//DRAWBAND(上,RGB(255,255,0),中,RGB(256,200,0));FILLRGN(上>=中,上,中,RGB(255,255,0));FILLRGN(上<中,上,中,RGB(256,200,0));CAPITAL:=GETPRICE1('流通股本');QQ:= C<中;MM:=上>REF(上,1) AND REF(上,1)<REF(上,2) ;超买:MA(C,10)*IF(CAPITAL=0,1.04,1.1),POINTDOT,COLORGREEN,LINETHICK2;超卖:MA(C,10)*IF(CAPITAL=0,0.95,0.9),POINTDOT,COLORRED,LINETHICK2;获利盘%:WINNER(CLOSE)*100,NODRAW,COLORWHITE;趋势线:EMA(((SLOPE(CLOSE,21) * 20) + CLOSE),42),POINTDOT,COLORFF00FF,LINETHICK4; V1:=ABS((2*CLOSE+HIGH+LOW)/4-MA(CLOSE,20))/MA(CLOSE,20);V2:=(1-7/100)*(DMA(CLOSE,V1));V3:=(1+7/100)*(DMA(CLOSE,V1));V5:=MA((LOW+HIGH+CLOSE)/3,5);MA1:=MA(CLOSE,5);MA2:=ATAN((MA1/REF(MA1,1)-1)*100)*180/3.1416;MA3:=IF(MA2>0,MA2,MA2);MA5:=MA(CLOSE,N),COLOR888899;MA13:=MA(CLOSE,M),COLORFF00F0,LINETHICK2;VAR1:=CLOSE=HHV(C,4) AND (REF(C,1)>=REF(C,2) OR REF(C,1)>=REF(C,3))OR REF(C,1)=HHV(C,4) AND CLOSE>=REF(C,2) OR REF(C,2)=HHV(C,4) ANDREF(C,3)=LLV(C,4) AND C>=REF(C,1) OR REF(C,3)=HHV(C,4) ANDC>=REF(C,1) AND C>=REF(C,2);//{收盘价=4日内收盘价的最高值AND 昨收>=2日前的收盘价}VAR2:=CLOSE=HHV(C,4) AND REF(C,1)=LLV(C,4);//{收盘价=4日内收盘价的最高值AND 昨收=4日内收盘价的最低值}VAR3:=CLOSE=LLV(C,4) AND (REF(C,1)<REF(C,2) OR REF(C,1)<REF(C,3)) ORREF(C,1)=LLV(C,4) AND C<REF(C,2) OR REF(C,2)=LLV(C,4) ANDREF(C,1)=HHV(C,4) AND C<REF(C,1) OR REF(C,3)=LLV(C,4) ANDC<REF(C,1) AND C<REF(C,2);//{收盘价=4日内收盘价的最低值AND (昨收<2日前的收盘价}VAR4:=REF(C,1)=LLV(C,4) AND C>=REF(C,2) OR REF(C,2)=LLV(C,4) ANDREF(C,1)<=REF(C,3) AND REF(C,2)<REF(C,4) AND C>=REF(C,1);//{昨收=4日内收盘价的最低值AND 收盘价>=2日前的收盘价}VAR5:=REF(C,1)=HHV(C,4) AND C<REF(C,2) OR (REF(C,2)=HHV(C,4) ANDREF(C,1)>REF(C,3) OR REF(C,3)=HHV(C,4) AND REF(C,1)>REF(C,2)) ANDREF(C,2)>=REF(C,4) AND C<REF(C,1);//{昨收=4日内收盘价的最高值AND 收盘价<2日前的收盘价}VAR6:=V5>REF(V5,1) AND REF(V5,1)<REF(V5,2);//{今日V5向上形成拐点}VAR7:=LOW<HHV(V5,13) AND HIGH>HHV(V5,13) AND CLOSE>REF(C,1) AND CLOSE>OPEN; VAR8:=VAR7 AND COUNT(VAR6,2);VAR9:=100*EMA(EMA(C-REF(C,1),6),6)/EMA(EMA(ABS(C-REF(C,1)),6),6);VAR10:=EMA(MA(C,13),13);VAR11:=FILTER((LLV(VAR9,2)=LLV(VAR9,7) AND COUNT(VAR9<0,2) ANDCROSS(VAR9,MA(VAR9,2)))=1,5);VAR12:=FILTER((HHV(VAR9,2)=HHV(VAR9,7) AND COUNT(VAR9>50,2) ANDCROSS(MA(VAR9,2),VAR9))=1,1);VAR13:=SMA(EMA((C-REF(C,1))/REF(C,1),5)*100,3,1)*10;VAR14:=FILTER(((CROSS(VAR13,0) OR CROSS(C,VAR10)) AND VAR11)=1,3);VAR15:=MA(C,18)>=REF(MA(C,18),3) AND CROSS(C,MA(C,18));VAR16:=VAR8 AND NOT(REF(VAR8,1));RSV:=(CLOSE-LLV(LOW,9))/(HHV(HIGH,9)-LLV(LOW,9))*100;K:=SMA(RSV,3,1);D:=SMA(K,3,1);J:=3*K-2*D;金叉:=CROSS(J,D);死叉:=CROSS(D,J);买1:=(VAR14 OR VAR15) AND VAR11;买2:=(VAR14 OR VAR15) AND VAR4;买3:=(VAR14 OR VAR15) AND VAR2;买4:=(VAR2 AND VAR11) OR (VAR4 AND VAR11);买5:=(金叉AND VAR4) OR (金叉AND VAR2) OR (金叉AND VAR11);//{涨停}STICKLINE(CLOSE>REF(CLOSE,1)*1.0985 AND CLOSE=HIGH,CLOSE,OPEN,4,-1),COLOR00FFFF; //{跌停}STICKLINE(CLOSE<REF(CLOSE,1)*0.9015 AND CLOSE=LOW,CLOSE,OPEN,4,-1),COLORGREEN; //{蓝}STICKLINE(OPEN>=CLOSE,CLOSE,OPEN,3.3,0),COLORFF6600;STICKLINE(OPEN>=CLOSE,CLOSE,OPEN,2.4,0),COLORFF8800;STICKLINE(OPEN>=CLOSE,CLOSE,OPEN,1.3,0),COLORFFAA00;STICKLINE(OPEN>=CLOSE,CLOSE,OPEN,0.6,0),COLORFFCC00;//{红}STICKLINE(CLOSE>OPEN,CLOSE,OPEN,3.3,0),COLOR000066;STICKLINE(CLOSE>OPEN,CLOSE,OPEN,2.4,0),COLOR000099;STICKLINE(CLOSE>OPEN,CLOSE,OPEN,1.3,0),COLOR0000DD;STICKLINE(CLOSE>OPEN,CLOSE,OPEN,0.5,0),COLORCC66FF;//{绿}STICKLINE(VAR3,OPEN,(OPEN+CLOSE)/2,3.3,0),COLOR009900;STICKLINE(VAR3,OPEN,(OPEN+CLOSE)/2,2.4,0),COLOR00BB00;STICKLINE(VAR3,OPEN,(OPEN+CLOSE)/2,1.3,0),COLOR00DD00;STICKLINE(VAR3,OPEN,(OPEN+CLOSE)/2,0.5,0),COLOR00FF00;//{灰}STICKLINE(VAR4 AND MM,OPEN,(OPEN+CLOSE)/2,3.3,0),COLOR999999;STICKLINE(VAR4 AND MM,OPEN,(OPEN+CLOSE)/2,2.2,0),COLORBBBBBB;STICKLINE(VAR4 AND MM,OPEN,(OPEN+CLOSE)/2,1.3,0),COLORDDDDDD;STICKLINE(VAR4 AND MM,OPEN,(OPEN+CLOSE)/2,0.5,0),COLORFFFFFF;STICKLINE(金叉,OPEN,CLOSE,0.5,0),COLORYELLOW;STICKLINE(死叉,OPEN,CLOSE,0.5,0),COLOR000066;DRAWICON(VAR16,LOW-0.02,1);DRAWICON(买1 OR 买2 OR 买3 OR 买4 OR 买5 AND MM,LOW-0.05,1); DRAWICON(死叉OR CROSS(50,VAR9) AND QQ AND K>50,HIGH+0.01,2);X1:=(C+L+H)/3;BB5:=ATAN(EMA(X1,7)-REF(EMA(X1,7),1))*3.1416*10;EMA3:=EMA(C,3);DRAWTEXT(FILTER(BB5>1 AND EMA(X1,7)>REF(EMA(X1,7),1),10),LOW*0.99,'★∠45'),COLORFFFFFF;VAR81:=1;VAR82:=((((2*CLOSE)+HIGH)+LOW) / 4);低金叉进:=20,COLORYELLOW,LINETHICK2;高死叉出:=90,COLORGREEN,LINETHICK3;VAR84:=LLV(LOW,5);VAR85:=HHV(HIGH,4);C1:=(EMA((((VAR82-VAR84)/(VAR85-VAR84))*100),4)*VAR81),COLORFF00FF,LINETHICK2;C2:=(EMA(((0.667*REF(C1,1))+(0.333*C1)),2)*VAR81),COLORFFFFFF,LINETHICK2;条件:=CROSS(C1,C2) AND C1<40;条件0:=CROSS(C2,C1) AND C1>90;TJ1:=CROSS(C1,C2);TJ2:=CROSS(C2,C1);TJ3:=CROSS(C1,C2) AND REF(C1,1)<20;TJ4:=CROSS(C2,C1) AND REF(C1,1)>80;DRAWTEXT(条件0,H*1.02,'S'),COLORBLUE;DRAWTEXT(TJ3 AND MM,L*0.98,'底'),COLORFF00FF;DRAWTEXT(TJ4 AND QQ,H*1.02,' 逃跑'),COLORGREEN;DRAWTEXT(TJ4,H*1.02,'逃'),COLORGREEN;水平面:=EMA(CLOSE,89),COLOR3399FF;AAA:=(3*C+H+L+O)/6;短趋:=(8*AAA+7*REF(AAA,1)+6*REF(AAA,2)+5*REF(AAA,3)+4*REF(AAA,4)+3*REF(AAA,5)+2*REF(A AA,6)+REF(AAA,8))/36;中趋:=(LLV(短趋,2)+LLV(短趋,4)+LLV(短趋,6))/3;TTJ1:=VOL=HHV(VOL,10) AND VOL>2*REF(VOL,1) AND CLOSE>短趋;立桩量:=FILTER(TTJ1,5);TTJ2:=IF(BARSLAST(立桩量)=1 AND CLOSE>REF(HIGH,1),1,IF(BARSLAST(立桩量)=2 AND CLOSE>REF(HIGH,2),1,IF(BARSLAST(立桩量)=3 AND CLOSE>REF(HIGH,3),1,0)));突破:=TTJ2=1;TTJ3:=IF(BARSLAST(立桩量)=1 AND CLOSE>REF(LOW,1),1,IF(BARSLAST(立桩量)=2 AND CLOSE>REF(LOW,2),1,IF(BARSLAST(立桩量)=3 AND CLOSE>REF(LOW,3),1,0)));三天法则:=TTJ3=1;成立:=三天法则AND 突破;条件成立:=FILTER(成立,3);DRAWTEXT(条件成立,L*0.93,'立桩量'),COLOR00FFFF;VAR90:=((((HHV((((EMA(CLOSE,12)-EMA(CLOSE,26))-(EMA((EMA(CLOSE,12)-EMA(CLOSE,26)),9)))*2),4)<0) AND ((((EMA(CLOSE,12)-EMA(CLOSE,26))-(EMA((EMA(CLOSE,12)-EMA(CLOSE,26)),9)))*2)>REF((((EMA(CLOSE,12)-EMA(CLOSE,26))-(EMA((EMA(CLOSE,12)-EMA(CLOSE,26)),9)))*2),1)))AND (REF((((EMA(CLOSE,12)-EMA(CLOSE,26))-(EMA((EMA(CLOSE,12)-EMA(CLOSE,26)),9)))*2),1)<REF((((EMA(CLOSE,12)-EMA(CLOSE,26))-(EMA((EMA(CLOSE,12)-EMA(CLOSE,26)),9)))*2),2))) AND (REF((((EMA(CLOSE,12)-EMA(CLOSE,26))-(EMA((EMA(CLOSE,12)-EMA(CLOSE,26)),9)))*2),2)<REF((((EMA(CLOSE,12)-EMA(CLOSE,26))-(EMA((EMA(CLOSE,12)-EMA(CLOSE,26)),9)))*2),3))); DRAWTEXT(VAR90 AND MM,L*0.98,'买'),COLORRED;DRAWTEXT(VAR90,L*0.98,'←短买'),COLORRED;DRAWTEXT(CROSS(MA(C,3),MA(C,9)) AND C>=REF(C,1) AND C>O,L*0.98,'追'),COLORMAGENTA; DIFF := EMA(CLOSE,12) - EMA(CLOSE,26);DEA := EMA(DIFF,9);MACD:=2*(DIFF-DEA),COLORSTICK;LC := REF(CLOSE,1);RSI1:=SMA(MAX(CLOSE-LC,0),7,1)/SMA(ABS(CLOSE-LC),7,1)*100;RSI2:=SMA(MAX(CLOSE-LC,0),14,1)/SMA(ABS(CLOSE-LC),14,1)*100;DRAWTEXT(REF(C,BARSLAST(REF(CROSS(DIFF,DEA),1))+1)>C ANDREF(DIFF,BARSLAST(REF(CROSS(DIFF,DEA),1))+1)<DIFF AND CROSS(DIFF,DEA)>0,L-0.02,'★M'),COLORFF00FF;//{MACD底背离}DRAWTEXT(REF(C,BARSLAST(REF(CROSS(K,D),1))+1)>C ANDREF(K,BARSLAST(REF(CROSS(K,D),1))+1)<K ANDCROSS(K,D),L-0.10,'◎K'),COLORFF00FF;//{KDJ底背离}DRAWTEXT(REF(C,BARSLAST(REF(CROSS(RSI1,RSI2),1))+1)>C ANDREF(RSI1,BARSLAST(REF(CROSS(RSI1,RSI2),1))+1)<RSI1 AND CROSS(RSI1,RSI2)>0,L-0.18,'◆R'),COLORFF00FF;//{RSI底背离};DRAWTEXT(REF(C,BARSLAST(REF(CROSS(DEA,DIFF),1))+1)<CAND REF(DIFF,BARSLAST(REF(CROSS(DEA,DIFF),1))+1)>DIFF AND CROSS(DEA,DIFF)>0,H+0.16,'★M'),COLORGREEN;//{MACD顶背离};DRAWTEXT(REF(C,BARSLAST(REF(CROSS(D,K),1))+1)<CAND REF(K,BARSLAST(REF(CROSS(D,K),1))+1)>K AND CROSS(D,K)>0,H+0.08,'◎K'),COLORGREEN;//{KDJ顶背离}DRAWTEXT(REF(C,BARSLAST(REF(CROSS(RSI2,RSI1),1))+1)<C ANDREF(RSI1,BARSLAST(REF(CROSS(RSI2,RSI1),1))+1)>RSI1 AND CROSS(RSI2,RSI1)>0,H+0.04,'◆R'),COLORGREEN;//{RSI顶背离};AA05:=MA(C,5);AA30:=MA(C,30);MA05:=MA(C,5);MA10:=MA(C,13);MA30:=MA(C,34);BB05:=ATAN((MA05/REF(MA05,1)-1)*100)*180/3.1416;BB10:=ATAN((MA10/REF(MA10,1)-1)*100)*180/3.1416;BB30:=ATAN((MA30/REF(MA30,1)-1)*100)*180/3.1416;速度5:=SMA(EMA((MA05-REF(MA05,1))/REF(MA05,1),3)*100,3,1);加速度5:=EMA((速度5-REF(速度5,1)),3);五日乖离率:=(C-AA05)/AA05*100;三拾日乖离率:=(C-MA30)/MA30*100;MR:=COUNT(CROSS(五日乖离率,0),3)>=1 AND 三拾日乖离率>REF(三拾日乖离率,1) AND AA05>REF(AA05,1) AND (C/REF(C,1)-1)*100>5 AND REF(C,1)<AA30;买入:=FILTER(MR,10);DRAWTEXT(买入,LOW*0.98,'←买入'),COLORRED;加仓:=FILTER(COUNT(CROSS(BB05,30),5)>=1 AND MA05>REF(MA05,1) AND 三拾日乖离率>REF(三拾日乖离率,1) AND MA10>REF(MA10,1) AND 加速度5>REF(加速度5,1) AND 速度5>REF(速度5,1),10);DRAWTEXT(加仓,LOW*0.98,'←加仓'),COLORRED;。
准确率100的技术指标文华财经指标公式期货软件无未来函数逃顶抄底指标
二分位:(H+L)/2 ,LINETHICK3,COLORYELLOW,POINTDOT;MID1 : MA(CLOSE,18),POINTDOT,LINETHICK3,COLORWHITE;UPPER1: MID1 + 2*STD(CLOSE,14),LINETHICK2,COLORYELLOW;LOWER1: MID1 - 2*STD(CLOSE,14),LINETHICK2,COLORYELLOW;VAR1:=UPPER1;FF1:=VAR1>REF(VAR1,1);PARTLINE(FF1,VAR1,RGB(255,0,0)),LINETHICK4;PARTLINE(FF1=0,VAR1,RGB(0,255,0)),LINETHICK4;VAR2:=LOWER1;FF2:=VAR2>REF(VAR2,1);PARTLINE(FF2,VAR2,RGB(255,0,0)),LINETHICK4;PARTLINE(FF2=0,VAR2,RGB(0,255,0)),LINETHICK4;VAR3:=MA(CLOSE,18);FF3:=VAR3>REF(VAR3,1);PARTLINE(FF3,VAR3,RGB(255,0,0)),LINETHICK4;PARTLINE(FF3=0,VAR3,RGB(3,3,255)),LINETHICK4;VAR4:=MA(CLOSE,4);FF4:=VAR4>REF(VAR4,1);PARTLINE(FF4,VAR4,RGB(235,1,1)),LINETHICK3;PARTLINE(FF4=0,VAR4,RGB(3,3,255)),LINETHICK3;RSV:=(CLOSE-LLV(LOW,10))/(HHV(HIGH,10)-LLV(LOW,10))*100;K:=SMA(RSV,5,1);D:=SMA(K,5,1);J:=3*K-2*D;X:=REF(J,1)<10 AND H>REF(H,1) AND C>REF(C,1) AND C>REF(O,1) AND L>REF(L,1); STICKLINE1(X,L ,L,20,0),COLOR008888;STICKLINE1(X,L ,H,0,0),COLORFF00FF;STICKLINE1(X,C ,O,5,0),COLORFF00FF;WR:-100*(HHV(HIGH,14)-CLOSE)/(HHV(HIGH,14)-LLV(LOW,14));DRAWICON(FILTER(CROSS(WR,(0 - 81)),10),L,4);//威廉买点↑↓DRAWICON(FILTER(CROSS((0 -19),WR),10),H,5);//威廉卖点DRAWTEXT(FILTER(CROSS(WR,(0 - 81)),21),L,'威廉买'),ALIGN0,COLORRED;//威廉买点DRAWTEXT(FILTER(CROSS(0 -19,WR),21),H,'威廉卖'),ALIGN2,COLORGREEN;//威廉卖点AA:=CLOSE > REF(CLOSE, 1) AND REF(CLOSE, 1) > REF(CLOSE, 2) AND REF(CLOSE, 1) < REF(CLOSE, 3) AND IF(REF(CLOSE, 3) < REF(CLOSE, 4), 1, IF(REF(CLOSE, 4) < REF(CLOSE, 5),REF(CLOSE, 1) < REF(CLOSE, 4) OR ( REF(CLOSE, 2) < REF(CLOSE, 4) AND REF(CLOSE, 3) >= REF(CLOSE, 5) ),IF(REF(CLOSE, 5) < REF(CLOSE, 6), 1,REF(CLOSE, 6) < REF(CLOSE, 7))));BB:=CLOSE < REF(CLOSE, 1) AND REF(CLOSE, 1) < REF(CLOSE, 2) AND REF(CLOSE, 1) > REF(CLOSE, 3) AND IF(REF(CLOSE, 3) > REF(CLOSE, 4), 1, IF(REF(CLOSE, 4) > REF(CLOSE, 5),REF(CLOSE, 1) > REF(CLOSE, 4) OR ( REF(CLOSE, 2) > REF(CLOSE, 4) AND REF(CLOSE, 3) <= REF(CLOSE, 5) ),IF(REF(CLOSE, 5) > REF(CLOSE, 6), 1,REF(CLOSE, 6) > REF(CLOSE, 7))));DRAWTEXT(AA AND CLOSE>REF(OPEN,2),LOW,'三平底'),COLORFF00FF;DRAWTEXT(BB AND CLOSE<REF(CLOSE,2),HIGH,'三平顶'),COLORRED;S下:=HHV(MA(HIGH,2),2),COLORGREEN,LINETHICK1;S上:=LLV(MA(HIGH,2),1),COLORRED,LINETHICK1;SPPP:=-(S上-S下)/REF(C,1)*100;SPTEM1:=(MIN(O,C)-L)/(H-L)*100;SPTEM2:=(H-MAX(O,C))/(H-L)*100;SPTEM3:=(C-O)/(H-L)*100;SKJ1:=(SPTEM3>49 AND SPTEM1>0.3*SPTEM2) OR SPTEM3>80;SKJ2:=(SPTEM3<=49 AND SPTEM3>20 AND SPTEM1>SPTEM2);SKJ3:=(SPTEM3<=20 AND SPTEM3>-20 AND SPTEM1>1.2*SPTEM2);SKJ4:=(SPTEM3<-20 AND SPTEM3>-40 AND SPTEM1>2*SPTEM2);SKJ:=(SKJ1 OR SKJ2 OR SKJ3 OR SKJ4) AND (SPPP>2 OR REF(SPPP,1)>2 );短买:=IF(SUM(SPPP>0,5)=5 AND SUM(SKJ>0,5)=0,5*(SKJ1 OR SKJ2 OR SKJ3 OR SKJ4),5*SKJ),COLORRED;DRAWTEXT(短买,L,'↖短买'),COLORWHITE;。
文华期货指标期货macd参数最佳设置文华财经指标公式源码
//公式1高:=HHV(H,75);低:=LLV(L,75);H3:=高-(高-低)*0.5;DRAWNUMBER(ISLASTBAR,H3,C,2,COLORYELLOW),ALIGN0,FONTSIZE50;Z1:ZIGZAG(C,2,1),COLORGREEN;Z2:ZIGZAG(C,5,1),COLORMAGENTA;DRAWCOLORLINE(Z1>REF(Z1,1),Z1,COLORRED,COLORGREEN);DRAWCOLORLINE(Z2>REF(Z2,1),Z2,COLORRED,COLORGREEN),LINETHICK3;VAR1:=SUM(MAX(MAX(HIGH-LOW,ABS(HIGH-REF(CLOSE,1))),ABS(LOW-REF(CLOSE,1))),25); VAR2:=HIGH-REF(HIGH,1);VAR3:=REF(LOW,1)-LOW;VAR4:=SUM(IF(VAR2>0 AND VAR2>VAR3,VAR2,0),25);VAR5:=SUM(IF(VAR3>0 AND VAR3>VAR2,VAR3,0),25);VAR6:=VAR4*100/VAR1;VAR7:=VAR5*100/VAR1;VAR8:=MA(ABS(VAR7-VAR6)/(VAR7+VAR6)*100,15);VAR9:=(VAR8+REF(VAR8,15))/2;A:=(VAR7>VAR6 AND VAR7>25 AND VAR6<25);B:=ZIGZAG(C,10/5,1)*100,COLORWHITE;G:=MA(B,2),COLORYELLOW;D:=CROSS(B,G)*1000,COLORRED;W:=CROSS(G,B)*1000,COLORBLUE;INDEXC:="999001$C";E:=REF(INDEXC,1);F:=SMA(MAX(INDEXC-E,0),3,1)/SMA(ABS(INDEXC-E),3,1);VAR10:=F AND F<8;VAR11:=(CLOSE-LLV(LOW,9))/(HHV(HIGH,9)-LLV(LOW,9))*100;VAR12:=SMA(VAR11,3,1);VAR13:=SMA(VAR12,3,1);VAR14:=VAR13 AND VAR13<20;MM:=A AND D AND VAR10 AND VAR14 ;X22:=ZIGZAG(C,1,1);X33:=REF(ZIGZAG(C,1,1),1);PARTLINE(X22>=X33,X22,COLORRED),LINETHICK2;PARTLINE(X22<X33,X22,RGB(0,249,63)),LINETHICK2;高1:=HHV(H,75);低1:=LLV(L,75);H31:=高1-(高1-低1)*0.5;DRAWNUMBER(ISLASTBAR,H31,C,2,COLORYELLOW),ALIGN0,FONTSIZE50;Z11:ZIGZAG(C,2,1),COLORGREEN;Z21:ZIGZAG(C,5,1),COLORMAGENTA;DRAWCOLORLINE(Z11>REF(Z11,1),Z11,COLORRED,COLORGREEN);DRAWCOLORLINE(Z21>REF(Z21,1),Z21,COLORRED,COLORGREEN),LINETHICK3;//公式2ZK1:=(REFX1(MA(REFX1(MA(H,375),375/2),375),375/2)-REFX1(MA(REFX1(MA(L,375),375/2),375),3 75/2))*1+REFX1(MA(REFX1(MA(H,375),375/2),375),375/2),DOT,COLORBLUE;ZD1:=REFX1(MA(REFX1(MA(L,375),375/2),375),375/2)-(REFX1(MA(REFX1(MA(H,375),375/2),375),3 75/2)-REFX1(MA(REFX1(MA(L,375),375/2),375),375/2))*1,LINETHICK2,COLORRED;ZD2:=EMA(ZD1,25),LINETHICK2;VAR23:=100*REFX1(MA(REFX1(MA(C-REF(C,1),6),6/2),6),6/2)/REFX1(MA(REFX1(MA(ABS(C-REF(C, 1)),6),25/2),6),6/2);回调买:=LLV(VAR23,2)=LLV(VAR23,7) AND COUNT(VAR23<0,2) AND CROSS(VAR23,MA(VAR23,2));XG:=ZD1>HIGH AND 回调买AND L<=ZD1;JJ:=(HIGH+LOW+CLOSE)/3;QJ0:=VOL/IF(HIGH=LOW,4,HIGH-LOW);CAPITAL:=GETPRICE1('流通股本');QJ1:=IF(CAPITAL=0,QJ0*(JJ-MIN(CLOSE,OPEN)),QJ0*IF(HIGH=LOW,1,(MIN(OPEN,CLOSE)-LOW))); QJ2:=IF(CAPITAL=0,QJ0*(MIN(OPEN,CLOSE)-LOW),QJ0*IF(HIGH=LOW,1,(JJ-MIN(CLOSE,OPEN))));QJ3:=IF(CAPITAL=0,QJ0*(HIGH-MAX(OPEN,CLOSE)),QJ0*IF(HIGH=LOW,1,(HIGH-MAX(OPEN,CLOSE ))));QJ4:=IF(CAPITAL=0,QJ0*(MAX(CLOSE,OPEN)-JJ),QJ0*IF(HIGH=LOW,1,(MAX(CLOSE,OPEN)-JJ))); DDX:=((QJ1+QJ2)-(QJ3+QJ4))/IF(CAPITAL=0,10000,10000),COLOR00AAAA;V2:=SMA(IF(C>=REF(C,1),DDX,-DDX/100),2,1);FROMOPEN:=IF(HOUR<12,60*(HOUR-9)-30+MINUTE,120+60*(HOUR-13)+MINUTE);V5:=SMA(V2*120/FROMOPEN*5,2,1);V10:=SMA(V5,5,1);V20:=SMA(V10,5,1);CURRBARSCOUNT:=REFX1(BARPOS,9999)-BARPOS+1;DY:=CURRBARSCOUNT=1 AND C<REF(C,1);DY2:=REF(V2,1)-DY;XG2:=C>O AND DY2<0.02 AND MA(C,5)>MA(C,60) AND C/REF(C,1)>=1.02 AND H<ZK1; VERTLINE1(CROSS(ZD1,ZD2)),COLORRED;VERTLINE1(CROSSDOWN(ZD1,ZD2)),COLORGREEN;//FILLRGN1(ZD1>ZD2,0,100),COLORRED;//FILLRGN1(ZD1<ZD2,0,100),COLORGREEN;M1:=4;M2:=6;M3:=9;M4:=13;M5:=18;M6:=24;PB1:=(EMA(CLOSE,M1)+MA(CLOSE,M1*2)+MA(CLOSE,M1*4))/3,COLORYELLOW,LINETHICK3;PB2:=(EMA(CLOSE,M2)+MA(CLOSE,M2*2)+MA(CLOSE,M2*4))/3,COLORYELLOW,LINETHICK3;PB3:=(EMA(CLOSE,M3)+MA(CLOSE,M3*2)+MA(CLOSE,M3*4))/3,COLORYELLOW,LINETHICK3;PB4:=(EMA(CLOSE,M4)+MA(CLOSE,M4*2)+MA(CLOSE,M4*4))/3,COLORYELLOW,LINETHICK3;PB5:=(EMA(CLOSE,M5)+MA(CLOSE,M5*2)+MA(CLOSE,M5*4))/3,COLORYELLOW,LINETHICK3;PB6:=(EMA(CLOSE,M6)+MA(CLOSE,M6*2)+MA(CLOSE,M6*4))/3,COLORYELLOW,LINETHICK3; //定义6条瀑布线T1:=PB1>PB2&&PB2>PB3&&PB3>PB4&&PB4>PB5&&PB5>PB6;T2:=PB1<PB2&&PB2<PB3&&PB3<PB4&&PB4<PB5&&PB5<PB6;AA:=CROSS(ISUP&&O>MAX1(PB1,PB2,PB3,PB4,PB5,PB6),0.5);BB:=CROSS(ISDOWN&&O<MIN1(PB1,PB2,PB3,PB4,PB5,PB6),0.5);VERTLINE(CROSS(COUNT(AA,BARSLAST(BB)+1)=1,0.5)&&ZD1>ZD2,COLORRED),FONTSIZE35; VERTLINE(CROSS(COUNT(BB,BARSLAST(AA)+1)=1,0.5)&&ZD1<ZD2,COLORGREEN),FONTSIZE35,VA LIGN0;PLAYSOUND(CROSS(COUNT(AA,BARSLAST(BB)+1)=1,0.5),'A');PLAYSOUND(CROSS(COUNT(BB,BARSLAST(AA)+1)=1,0.5),'B');。
期货最好用的指标公式文华财经指标公式 精准抄底逃顶
VAR1:=(CLOSE+HIGH+LOW+OPEN)/4;CAPITAL:=GETPRICE1('流通股本');VAR2:=SUMBARS(VOL,CAPITAL);VAR3:=HHV(VAR1,VAR2);VAR4:=LLV(VAR1,VAR2);VAR5:=(2*VAR1-VAR4-REF(VAR4,1))/(VAR3-VAR4);VAR6:=(VAR1-VAR4)/(VAR3-VAR4);VAR7:=IF(VAR1<=VAR4,VAR5*60,VAR6*60);VAR8:=600*(EMA(CLOSE,3)-EMA(LOW,30))/EMA(LOW,30);VAR9:=EMA(VAR8,7);VARA:=(WINNER(120*CLOSE/100)-WINNER(100*CLOSE/100))*100;VARB:=(-100)*(WINNER(120*CLOSE/100)-WINNER(100*CLOSE/100))+5;波段买入:= IF(VARA+VARB<7 AND CROSS(VAR8,VAR9) AND VAR9<-18 AND VAR9<VARB,60,50),COLORYELLOW;//DRAWICON(波段买入=60,70,1),COLORRED;VARC:=HHV(HIGH,9)-LLV(LOW,9);VARD:=HHV(HIGH,9)-CLOSE;VARE:=CLOSE-LLV(LOW,9);VARF:=VARD/VARC*100-70;VAR10:=(CLOSE-LLV(LOW,60))/(HHV(HIGH,60)-LLV(LOW,60))*100;VAR11:=(2*CLOSE+HIGH+LOW)/4;VAR12:=SMA(VARE/VARC*100,3,1);VAR13:=LLV(LOW,34);VAR14:=SMA(VAR12,3,1)-SMA(VARF,9,1);VAR15:=IF(VAR14>100,VAR14-100,0);VAR16:=HHV(HIGH,34);VAR17:=EMA((VAR11-VAR13)/(VAR16-VAR13)*100,8);巫修全制:= VAR17,COLORYELLOW ;VAR18:=EMA(VAR17,5);//STICKLINE1(VAR17>0 AND VAR17-VAR18>=0,79,80,6,0),COLORRED ;//STICKLINE1(VAR17>0 AND VAR17-VAR18<0,79,80,6,1),COLOR00FF00 ;//STICKLINE1(VAR17>0 AND VAR17-VAR18>=0,19,20,6,0),COLORRED;//STICKLINE1(VAR17>0 AND VAR17-VAR18<0,19,20,6,1),COLOR00FF00 ;STICKLINE1(VAR17-VAR18>0,VAR17,VAR18,8,1),COLORRED ;STICKLINE1(VAR17-VAR18<0,VAR17,VAR18,8,1),COLOR00FF00 ;VAR22:=REF(LOW,1);VAR23:=SMA(ABS(LOW-VAR22),3,1)/SMA(MAX(LOW-VAR22,0),3,1)*100;VAR24:=EMA(IF(CLOSE*1.3,VAR23*10,VAR23/10),3);VAR25:=LLV(LOW,30);VAR26:=HHV(VAR24,30);VAR27:=IF(MA(CLOSE,58),1,0);VAR28:=EMA(IF(LOW<=VAR25,(VAR24+VAR26*2)/2,0),3)/618*VAR27;VAR29:=IF(VAR28>100,100,VAR28);STICKLINE1(VAR29>-150,0,VAR29,3,0),COLORFF00FF;底部吸筹指标:= (CLOSE-MA(CLOSE,40))/MA(CLOSE,40)*100, COLOR00FF00;STICKLINE1(CROSS(底部吸筹指标,-24),100,0,6,0),COLORFFFFFF;先知:= (CLOSE-MA(CLOSE,5))/MA(CLOSE,5)*100,COLORFF00FF;可能放量拉升:= IF(CROSS(底部吸筹指标,-24),1,0),COLORFFFFFF;VARK1:=(CLOSE-LLV(LOW,27))/(HHV(HIGH,27)-LLV(LOW,27))*100;VARK2:=REVERSE(VARK1);VARK3:=SMA(VARK1,3,1);波段王:=SMA(VARK3,3,1),COLORRED,LINETHICK2;波段鬼:=SMA(波段王,2.5,1),COLORYELLOW,LINETHICK2;趋势线:= 3*SMA((CLOSE-LLV(LOW,27))/(HHV(HIGH,27)-LLV(LOW,27))*100,5,1)-2*SMA(SMA((CLOSE-LLV(LO W,27))/(HHV(HIGH,27)-LLV(LOW,27))*100,5,1),3,1),COLORFF6666,LINETHICK2;卖:=IF((CROSS(波段鬼,波段王) OR CROSS(波段鬼,趋势线) OR CROSS(波段王,趋势线) ) AND 波段鬼>65,90,0),STICK,COLORFFFF00 ,LINETHICK3;RSV9:=(CLOSE-LLV(LOW,9))/(HHV(HIGH,9)-LLV(LOW,9))*100;K1:=SMA(RSV9,3,1);DK1:=K1-REF(K1,1),COLORSTICK;出手就赢:=IF(DK1>7 AND REF(DK1,1)<0 AND (DK1-REF(DK1,1))>9,50,0),STICK,COLORYELLOW;//DRAWICON(出手就赢>0,50 ,1);买点准备:=IF(趋势线<=10,0,10), COLORFF9933,LINETHICK3;STICKLINE1(CROSS(趋势线,10),0,73,6,0),COLOR3366FF;DRAWTEXT(IF(CROSS(趋势线,10),100,0),68,'抄底'),COLORWHITE ;//DRAWTEXT(IF(CROSS(10,趋势线),1,0), 10,'$备钱'),COLOR33FFCC;//{目前位置:对当前股票所处的技术位置进行评价,可对是否介入作出辅助判断} RSV:=(CLOSE-LLV(LOW,9))/(HHV(HIGH,9)-LLV(LOW,9))*100;K:=SMA(RSV,3,1);D:=SMA(K,3,1);J:=3*K-2*D;DRAWTEXT(REF(J,1)<0 AND J>0,50,'考虑'),COLORRED ;//STICKLINE1(REF(J,1)<0 AND J>0,60,0,2,0),COLOR0000FF;目前位置:=K;技术低位:20;技术中位:50,POINTDOT;技术高位:80;AAA:=(3*C+H+L+O)/6;VAR1X:=(8*AAA+7*REF(AAA,1)+6*REF(AAA,2)+5*REF(AAA,3)+4*REF(AAA,4)+3*REF(AAA,5)+2*RE F(AAA,6)+REF(AAA,8))/36,LINETHICK2,COLORRED;VAR2X:=(HHV(VAR1X,2)+HHV(VAR1X,4)+HHV(VAR1X,8))/3;VAR3X:=(LLV(VAR1X,2)+LLV(VAR1X,4)+LLV(VAR1X,8))/3;VAR4X:=(HHV(VAR2X,2)+HHV(VAR2X,4)+HHV(VAR2X,8))/3;VAR5X:=(LLV(VAR3X,2)+LLV(VAR3X,4)+LLV(VAR3X,8))/3,COLORRED;VAR6X:=(LLV(VAR1X,2)+LLV(VAR1X,4)+LLV(VAR1X,8))/3;DRAWICON(REF(VAR5X,1)=REF(VAR1X,1) AND VAR5X<VAR1X,VAR17,'ICO1'),COLORRED; DRAWICON(REF(VAR4X,1)=REF(VAR1X,1) AND VAR4X>VAR1X,VAR17,'ICO2'),COLORGREEN;。
文华财经软件指标源码公式源码期货macd参数最佳设置公式源码
/* TS:=130;N:=99;M:=3;MT:=3;M1:=5;M2:=7;M3:=21;M4:=12;M5:=50;DA1:=IF(TS>TOTALBARSCOUNT,TOTALBARSCOUNT,TS);DA:=IF(CURRBARSCOUNT>DA1,0,DA1);HI:=REFDATE(HHV(H,DA),DATE);LO:=REFDATE(LLV(L,DA),DATE);C1:=IF(CURRBARSCOUNT<=DA,C,DRAWNULL);GZ:=EXP(LN(HI/LO)/10);LH1:=SUM(IF(C1>=(HI/GZ),V,0),DA);LH2:=SUM(IF(C1>=(HI/POW(GZ,2)) AND C1<(HI/GZ),V,0),DA);LH3:=SUM(IF(C1>=(HI/POW(GZ,3)) AND C1<(HI/POW(GZ,2)),V,0),DA); LH4:=SUM(IF(C1>=(HI/POW(GZ,4)) AND C1<(HI/POW(GZ,3)),V,0),DA); LH5:=SUM(IF(C1>=(HI/POW(GZ,5)) AND C1<(HI/POW(GZ,4)),V,0),DA); LH6:=SUM(IF(C1>=(HI/POW(GZ,6)) AND C1<(HI/POW(GZ,5)),V,0),DA); LH7:=SUM(IF(C1>=(HI/POW(GZ,7)) AND C1<(HI/POW(GZ,6)),V,0),DA); LH8:=SUM(IF(C1>=(HI/POW(GZ,8)) AND C1<(HI/POW(GZ,7)),V,0),DA);LH9:=SUM(IF(C1>=(LO*GZ) AND C1<LO*POW(GZ,2),V,0),DA);LH10:=SUM(IF(C1>=LO AND C1<LO*GZ,V,0),DA);L1:=REFDATE(HHV(LH1,DA),DATE),LINETHICK0;L2:=REFDATE(HHV(LH2,DA),DATE),LINETHICK0;L3:=REFDATE(HHV(LH3,DA),DATE),LINETHICK0;L4:=REFDATE(HHV(LH4,DA),DATE);L5:=REFDATE(HHV(LH5,DA),DATE);L6:=REFDATE(HHV(LH6,DA),DATE);L7:=REFDATE(HHV(LH7,DA),DATE);L8:=REFDATE(HHV(LH8,DA),DATE);L9:=REFDATE(HHV(LH9,DA),DATE);L10:=REFDATE(HHV(LH10,DA),DATE);SS:=(L1+L2+L3+L4+L5+L6+L7+L8+L9+L10);STICKLINE(CEILING(DA*L1/SS)*3>=CURRBARSCOUNT,HI*N/100,(HI/GZ),1, 1),COLOR454545,LINETHICK1;STICKLINE(CEILING(DA*L2/SS)*3>=CURRBARSCOUNT,HI/POW(GZ,1)*N/10 0,HI/POW(GZ,2),1,1),COLOR454545,LINETHICK1;STICKLINE(CEILING(DA*L3/SS)*3>=CURRBARSCOUNT,HI/POW(GZ,2)*N/10 0,HI/POW(GZ,3),1,1),COLOR454545,LINETHICK1;STICKLINE(CEILING(DA*L4/SS)*3>=CURRBARSCOUNT,HI/POW(GZ,3)*N/10 0,HI/POW(GZ,4),1,1),COLOR454545,LINETHICK1;STICKLINE(CEILING(DA*L5/SS)*3>=CURRBARSCOUNT,HI/POW(GZ,4)*N/10 0,HI/POW(GZ,5),1,1),COLOR454545,LINETHICK1;STICKLINE(CEILING(DA*L6/SS)*3>=CURRBARSCOUNT,HI/POW(GZ,5)*N/10 0,HI/POW(GZ,6),1,1),COLOR454545,LINETHICK1;STICKLINE(CEILING(DA*L7/SS)*3>=CURRBARSCOUNT,HI/POW(GZ,6)*N/10 0,HI/POW(GZ,7),1,1),COLOR454545,LINETHICK1;STICKLINE(CEILING(DA*L8/SS)*3>=CURRBARSCOUNT,LO*POW(GZ,2),LO*P OW(GZ,3)*N/100,1,1),COLOR454545,LINETHICK1;STICKLINE(CEILING(DA*L9/SS)*3>=CURRBARSCOUNT,LO*POW(GZ,1),LO*P OW(GZ,2)*N/100,1,1),COLOR454545,LINETHICK1;STICKLINE(CEILING(DA*L10/SS)*3>=CURRBARSCOUNT,LO,LO*POW(GZ,1)* N/100,1,1),COLOR454545,LINETHICK1;DRAWKLINE(H,O,L,C);JJ:=(CLOSE+HIGH+LOW)/3;DRAWBAND(MA(C,2),RGB(108,0,1),MA(C,7),RGB(28,134,238));TT:=IF(ISLASTBAR,240/FROMOPEN,1);NN:=120;HH:=HHV(V*TT,NN);LL:=LLV(V,NN);最高:=CONST(HH);最低:=CONST(LL);最高2:=CONST(HHV(H,NN));最低2:=CONST(LLV(L,NN));PP:=IF((最高2*0.9-(最高2-最低2)*0.5)>CONST(LLV(L,20)),0.9,IF((最高2*0.9-(最高2-最低2)*0.5)>CONST(LLV(L,50)),0.7,0.6)),NODRAW;RCC1:=最高2*0.9-(最高2-最低2)*PP;最低3:=MIN(RCC1,最低2);AA:=最低3;MA20:MA(C,20),COLORRED,LINETHICK1;MA55:MA(C,55),COLORRED,CIRCLEDOT;IF(MA20<REF(MA20,1),MA20,DRAWNULL),COLOR00FF00,LINETHICK1;IF(MA55<REF(MA55,1),MA55,DRAWNULL),COLOR408000,CIRCLEDOT; BB:MA(MA(CLOSE,3),1),LINETHICK1,COLORFFFF00;IF(BB>=REF(BB,1),BB,DRAWNULL),COLOR0000FF,LINETHICK1; STICKLINE(BB>=REF(BB,1),AA-0.000*AA,AA-0.050*AA,3,0),COLOR000074; STICKLINE(BB<REF(BB,1),AA-0.010*AA,AA-0.040*AA,3,1),COLORFFFF00;今日保护价:(REF(C,2)+REF(C,1)+O)/3 ,COLOR4080FF,NODRAW;三日最低:=EMA((REF(L,4)+REF(L,3)+REF(L,2))/3,3);三日最高:=EMA((REF(H,4)+REF(H,3)+REF(H,2))/3,3),COLORWHITE;S:=CROSS(CROSS(三日最高,C),0.6);B:=CROSS(CROSS(C,三日最低),0.5);DRAWICON(B,LOW*0.99,34);DRAWICON(S,H*1.00,35);STICKLINE(C>=O,C,O,3.4,0),COLOR0000AA;STICKLINE(C>=O,C,O,3.0,0),COLOR0000BB ;STICKLINE(C>=O,C,O,2.4,0),COLOR0000CC;STICKLINE(C>=O,C,O,2.0,0),COLOR0000DD ;STICKLINE(C>=O,C,O,1.6,0),COLOR0000EE;STICKLINE(C>=O,C,O,1.2,0),COLOR0000FF;STICKLINE(C>=O,C,O,0.6,0),COLOR0000FF;STICKLINE(C>=O,H,L,0,0),COLORRED;STICKLINE(C<=O,C,O,3.4,0),COLORAAAA00;STICKLINE(C<=O,C,O,3.0,0),COLORBBBB00;STICKLINE(C<=O,C,O,2.4,0),COLORCCCC00;STICKLINE(C<=O,C,O,2.0,0),COLORDDDD00;STICKLINE(C<=O,C,O,1.6,0),COLOREEEE00;STICKLINE(C<=O,C,O,1.2,0),COLORFFFF00;STICKLINE(C<=O,C,O,0.6,0),COLORFFFF00;STICKLINE(C<=O,H,L,0,0),COLORFFFF00;V1:=ABS((2*CLOSE+HIGH+LOW)/4-MA(CLOSE,20))/MA(CLOSE,20);V2:=(1-7/100)*(DMA(CLOSE,V1));V3:=(1+7/100)*(DMA(CLOSE,V1));V5:=MA((LOW+HIGH+CLOSE)/3,5);EMA13:=EMA(C,13),COLORWHITE;EMA21:=EMA(C,21),COLORYELLOW;EMA34:=EMA(C,34),COLORFF00FF;EMA60:=MA(C,60),COLORFFCC66;VAR2:=(2*CLOSE+HIGH+LOW)/4;VAR3:=IF(YEAR>=2099 AND MONTH>2,0,1);VAR4:=LLV(LOW,5); VAR5:=HHV(HIGH,4);散户:=EMA((VAR2-VAR4)/(VAR5-VAR4)*100,4)*VAR3;庄家:=EMA(0.667*REF(散户,1)+0.333*散户,2)*VAR3;DRAWICON(CROSS(散户,庄家) AND 散户<30,L-0.05,1);DRAWICON(CROSS(庄家,散户) AND 散户>70,H+0.05,2);VAR9:=CLOSE-REF(CLOSE,5);VARA:=EMA(EMA(VAR9,5),5)/EMA(EMA(ABS(VAR9),5),5);VARC:=EMA(EMA(VAR9,20),20)/EMA(EMA(ABS(VAR9),20),20);卖出:=IF(VARA>0 AND CROSS(VARC,VARA),90,100);DRAWICON(卖出<0,H+0.05,2); 买线:=EMA(CLOSE,2);卖线:=EMA(SLOPE(CLOSE,21)*20+CLOSE,42);B1:IF(CROSS(买线,卖线),L-0.02,DRAWNULL),CROSSDOT,LINETHICK3,COLORMAGENTA;S1:IF(CROSS(80,RSI)*30,H+0.02,DRAWNULL),CROSSDOT,LINETHICK3,COLO RYELLOW;VC:=((CLOSE-MA(CLOSE,6))/MA(CLOSE,6)*100+(CLOSE-MA(CLOSE,24))/MA( CLOSE,24)*100+(CLOSE-MA (CLOSE,32))/MA(CLOSE,32)*100)/3;S2:=IF(VC>20 AND FILTER(VC<REF(VC,1),5),H+0.02,DRAWNULL),CIRCLEDOT,LINETHICK3,COLORGREEN; A0:=(L+H+C*2)/4;A1:EMA(A0,14)NODRAW,COLORFFFFFF,LINETHICK1;A2:=EMA(A0,25)COLORLIBLUE,LINETHICK2;A1X:=(A1-REF(A1,1))/REF(A1,1)*100,NODRAW;A2X:=(A2-REF(A2,1))/REF(A2,1)*100,NODRAW;看多:IF(A1X>=0 ANDBARSLAST(CROSS(A1X,0))>0,REF((C+O)/2,BARSLAST(CROSS(A1X,0))),DRA WNULL)DOTLINE,COLOR00FFFF{,LINETHICK2};看空:IF(A1X<0 ANDBARSLAST(CROSS(0,A1X))>0,REF((C+O)/2,BARSLAST(CROSS(0,A1X))),DRA WNULL)DOTLINE,COLORCYAN,{LINETHICK2};STICKLINE(CROSS(A1X,0),H,L,0,0 ),COLOR9933FF;STICKLINE(CROSS(A1X,0),C,O,3,0 ),COLOR0000CC;STICKLINE(CROSS(A1X,0),C,O,1,0 ),COLOR0033FF;STICKLINE(CROSS(0,A1X),L,H,0,0 ),COLOR66CC33;N1:=10;T1:=CONST(HHVBARS(V,10)),COLOR0000FF,LINETHICK1;量能平台:IF(CURRBARSCOUNT<=N1+15,CONST(IF(T1=0,C,REF(C,T1))),DRAWNULL ),COLORFF1A8C,LINETHICK1;新量能点:IF(CURRBARSCOUNT=T1+1,量能平台,DRAWNULL),CIRCLEDOT,COLORFFFFFF,LINETHICK9;DRAWTEXT(ISLASTBAR,量能平台,' 量能平台'),COLOR00F0F0;HV:=HHV(V,5)=V OR V/REF(V,1)>=5;FT:=BARSLAST(HV);量能平台1:=IF(HV,C,REF(C,FT));DRAWTEXT(量能平台1>REF(量能平台1,1)AND C<REF(C,1),L,'*带量跌'),COLORGREEN;DRAWTEXT(量能平台1<REF(量能平台1,1) AND C>REF(C,1),L,'*缩量涨'),COLORYELLOW;DRAWTEXT(量能平台1>REF(量能平台1,1) AND C>REF(C,1) AND C>MA(C,13) AND C=HHV(C,20) AND C/REF(C,1)>1.05,L,'*突破量'),COLORFFFFFF; DRAWRECTREL(0,500,147,999.4,IF(120,RGB(10,0,0),0));超B:=L2_AMO(0,2)/10000.0;大B:=L2_AMO(1,2)/10000.0;中B:=L2_AMO(2,2)/10000.0;小B:=L2_AMO(3,2)/10000.0;超S:=L2_AMO(0,3)/10000.0;大S:=L2_AMO(1,3)/10000.0;中S:=L2_AMO(2,3)/10000.0;小S:=L2_AMO(3,3)/10000.0;TESTSKIP(NOT(超B OR 大B OR 中B OR 小B OR 超S OR 大S OR 中S OR 小S)!=0);大宗进:=(超B)+(大B),NODRAW;大宗出:=(超S)+(大S),NODRAW;非大宗进:=(中B)+(小B),NODRAW;非大宗出:=(中S)+(小S),NODRAW;大宗进限制:=IF((超B+大B)=0,0,大宗进);大宗出限制:=IF((超S+大S)=0,0,大宗出);非大宗进限制:=IF(中B+小B=0,0,非大宗进);非大宗出限制:=IF(中S+小S=0,0,非大宗出);主力净流入:=(超B+大B)-(超S+大S),COLORRED,NODRAW;散户净流入:=(中B+小B)-(中S+小S),COLORRED,NODRAW;净流入:=(超B+大B+中B+小B)-(超S+大S+中S+小S),COLORRED,NODRAW; 大单流入:=(超B+大B)/(超B+大B+超S+大S)*100,NODRAW;大单流入限制:=IF((超B+大B+超S+大S)=0,0,大单流入);大单流出比:=(超S+大S)/(超B+大B+超S+大S)*100,NODRAW;大单流出限制:=IF((超B+大B+超S+大S)=0,0,大单流出比);总流入比:=(超B+大B+中B+小B)/(超B+大B+中B+小B+超S+大S+中S+小S)*100,NODRAW;总流出比:=(超S+大S+中S+小S)/(超B+大B+中B+小B+超S+大S+中S+小S)*100,NODRAW;成交总量:=(超B+大B+中B+小B+超S+大S+中S+小S),NODRAW;机构参与度:=(超B+超S+大B+大S)/成交总量*100,COLORYELLOW,NODRAW; 大单强度:=(超B+大B-超S-大S)/成交总量*100,COLORYELLOW,NODRAW;大单强度限制:=IF(大单强度=0,-100,大单强度);大单强度比:=IF(大单强度>=0,(大单强度限制+100)/2,100-ABS((大单强度限制-100)/2)),NODRAW;超单强度:=(超B-超S)/(超B+超S)*100,COLORYELLOW,NODRAW;超单强度限制:=IF(超单强度=0,-100,超单强度);超单强度比:=IF(超单强度>0,(超单强度限制+100)/2,IF(超单强度<0,100-ABS((超单强度限制-100)/2),0)),NODRAW;DAZHIV:=CONST(MAX(ABS(大宗进),MAX(ABS(大宗出),MAX(ABS(非大宗进),ABS(非大宗出))))),NODRAW;DRAWRECTREL(0,CONST(930-(ABS(大宗进)*250/DAZHIV)),35,950,IF(CONST(大宗进>0),RGB(255,0,0),RGB(23,125,255)));DRAWRECTREL(37,CONST(930-(ABS(大宗出)*250/DAZHIV)),72,950,IF(CONST(大宗出>0),RGB(23,125,255),RGB(255,0,0)));DRAWRECTREL(75,CONST(930-(ABS(非大宗进)*250/DAZHIV)),110,950,IF(CONST(非大宗进>0),RGB(255,0,0),RGB(23,125,255)));DRAWRECTREL(112,CONST(930-(ABS(非大宗出)*250/DAZHIV)),147,950,IF(CONST(非大宗出>0),RGB(23,125,255),RGB(255,0,0)));DRAWRECTREL(150,CONST(940-(ABS(净流入)*250/DAZHIV))-20,190,950,IF(CONST(净流入>0),RGB(200,0,0),RGB(0,125,50)));DRAWTEXT_FIX(CURRBARSCOUNT=1,0.0001,0.9,0,STRCAT('',CON2STR(大宗进/1,0))),COLORYELLOW;DRAWTEXT_FIX(CURRBARSCOUNT=1,0.036,0.9,0,STRCAT('',CON2STR(大宗出/1,0))),COLORYELLOW;DRAWTEXT_FIX(CURRBARSCOUNT=1,0.074,0.9,0,STRCAT('',CON2STR(非大宗进/1,0))),COLORYELLOW;DRAWTEXT_FIX(CURRBARSCOUNT=1,0.111,0.9,0,STRCAT('',CON2STR(非大宗出/1,0))),COLORYELLOW;DRAWTEXT_FIX(CURRBARSCOUNT=1,0.150,0.9,0,STRCAT('',CON2STR(净流入/1,0))),COLORYELLOW;DRAWTEXT_FIX(1,0.000,0.99,0,STRCAT(STRCAT('主力 ',CON2STR(主力净流入,0)),'万')),COLORMAGENTA;DRAWTEXT_FIX(1,0.078,0.99,0,STRCAT(STRCAT('散户 ',CON2STR(散户净流入,0)),'万')),COLORCYAN;DRAWTEXT_FIX(CURRBARSCOUNT=1,0.145,0.99,0,'净流入:(万)'),COLORYELLOW;主力买力度:=LARGEINTRDVOL*1000/VOL;主力卖力度:=LARGEOUTTRDVOL*1000/VOL;AAD:=CONST(MAX(ABS(主力买力度),ABS(主力卖力度)))*4,NODRAW; DRAWRECTREL(0,515,CONST(ABS(主力买力度)*560/AAD),568,IF(CONST(主力买力度)>0,RGB(255,0,0),RGB(0,50,0)));DRAWRECTREL(0,570,CONST(ABS(主力卖力度)*560/AAD),623,IF(CONST(主力卖力度)>0,RGB(0,50,0),RGB(255,0,0)));DRAWTEXT_FIX(1,0,0.524,0,STRCAT('主买力度:',CON2STR(主力买力度,0))),COLORYELLOW;DRAWTEXT_FIX(1,0,0.576,0,STRCAT('主卖力度:',CON2STR(主力卖力度,0))),COLORYELLOW;*/DIFIF1:=EMA(CLOSE,12) - EMA(CLOSE,26);DEAEA1:=EMA(DIFIF1,9);MACD1:=2*(DIFIF1-DEAEA1);MACD2:=EMA(MACD1,3);RSV:=(CLOSE-LLV(LOW,9))/(HHV(HIGH,9)-LLV(LOW,9))*100;K:=SMA(RSV,3,1);D:=SMA(K,3,1);J:=3*K-2*D;DIF : =EMA(CLOSE,12) - EMA(CLOSE,26);//短周期与长周期的收盘价的指数平滑移动平均值做差。
准确率100的技术指标文华财经指标公式期货软件螺纹铁矿恒指买卖点
N:=10;底部:1,NODRAW,COLORMAGENTA;顶部:100,NODRAW,COLORCYAN;顶部警戒:90,COLOR008000;强弱分界:50,COLOR00BFBF;底部警戒:10,COLORRED;DRAWTEXT(ISLASTBAR,强弱分界,'强弱分界'),COLORYELLOW; DRAWTEXT(ISLASTBAR,顶部警戒,'顶部警戒'),COLORGREEN; DRAWTEXT(ISLASTBAR,底部警戒,'底部警戒'),COLORRED;DRAWTEXT(ISLASTBAR,顶部,'顶部'),COLORCYAN;DRAWTEXT(ISLASTBAR,底部,'底部'),COLORMAGENTA;V11:=3*SMA((C-LLV(L,N))/(HHV(H,N)-LLV(L,N))*100,5,1)-2*SMA(SMA((C-LLV(L,N))/(HHV(H,N)-LLV (L,N))*100,5,1),3,1);趋势线:EMA(V11,3),LINETHICK2,COLORMAGENTA;筹码:=((COST(90)+COST(70)+COST(50)+COST(30)+COST(10))/5);V12:=(趋势线-REF(趋势线,1))/REF(趋势线,1)*100;STICKLINE(趋势线<8,趋势线,10,5,0),COLOR00E3E3;DRAWTEXT(BARSLASTCOUNT(趋势线<8)=1 AND 筹码>1,13,'主力吸筹'),COLOR00E3E3;STICKLINE(趋势线>92,趋势线,90,5,0),COLOR008000;DRAWTEXT(BARSLASTCOUNT(趋势线>92)=1 AND 筹码>1,84,'主力出货'),COLORGREEN;VAR18:=(HIGH+LOW+CLOSE)/(3);VAR19:=(VAR18-MA(VAR18,14))/((0.015)*(AVEDEV(VAR18,14)));VAR1A:=(VAR18-MA(VAR18,70))/((0.015)*(AVEDEV(VAR18,70)));VAR1B:=IF((VAR19>=150) AND (VAR19<200) AND (VAR1A>=150) AND (VAR1A<200),(-10),0);VAR1C:=IF((VAR19<=(-150)) AND (VAR19>(-200)) AND (VAR1A<=(-150)) AND (VAR1A>(-200)),10,0);买:CROSS(趋势线,10),COLORRED,NODRAW;卖:CROSS(90,趋势线),COLORGREEN,NODRAW;DRAWTEXT(CROSS(趋势线,10),趋势线,'★买'),COLORRED;DRAWTEXT(CROSS(90,趋势线),90,'★卖'),COLORGREEN;逃顶1:=IF((BARSCOUNT(CLOSE)<70),100,IF((VAR1A>=200) AND (VAR19>=150),(-20),VAR1B)+100),COLORCCFF66;抄底1:=IF((BARSCOUNT(CLOSE)<70),(-100),IF((VAR1A<=(-200)) AND (VAR19<=(-150)),20,VAR1C)-100),COLORBLUE;逃顶:逃顶1=80,NODRAW;抄底:抄底1=-80,COLOR0080FF,NODRAW;DRAWTEXT(BARSLASTCOUNT(逃顶=1)=1,93,'逃顶'),COLORWHITE;DRAWTEXT(BARSLASTCOUNT(抄底=1)=1,7,'抄底'),COLOR0080FF;DRAWICON(BARSLASTCOUNT(逃顶=1),99,2);DRAWICON(BARSLASTCOUNT(抄底=1),1,1);。
文华财经:期货行业最准确的指标公式源码
文华财经:期货行业最准确的指标公式源码1. 简介文华财经是中国期货行业领先的信息技术服务提供商,为期货交易者提供了一系列高性能、高可靠性的交易软件和量化策略工具。
本文将详细介绍文华财经中几种常用且精准的期货指标公式源码,以帮助交易者更好地理解和应用这些工具。
2. 移动平均线(MA)移动平均线是最常用的技术分析指标之一,用以显示一定时间内价格的平均值。
2.1 简单移动平均线(SMA)简单移动平均线(SMA)的计算公式如下:def calculate_sma(prices, window_size):return np.mean(prices[-window_size:])其中,`prices` 是收盘价列表,`window_size` 是移动平均线的周期。
2.2 指数移动平均线(EMA)指数移动平均线(EMA)对近期价格更为敏感,其计算公式为:def calculate_ema(prices, window_size):return (2 / (window_size + 1)) * prices[-1] + (1 - 2 / (window_size+ 1)) * calculate_sma(prices, window_size)3. 相对强弱指数(RSI)相对强弱指数(RSI)是衡量资产价格动量的常用指标,其值介于0和100之间。
def calculate_rsi(gains, losses, window_size):if len(gains) < window_size or len(losses) < window_size:return Nonegain_avg = np.mean(gains[-window_size:])loss_avg = np.mean(losses[-window_size:])if loss_avg == 0:return 100else:return 100 - (100 / (1 + gain_avg / loss_avg)))其中,`gains` 是价格涨幅列表,`losses` 是价格跌幅列表,`window_size` 是计算RSI的周期。
文华财经指标公式源码文华财经指标多指标顶底背离
/*一号线:EMA(CLOSE,144);工作线:EMA(CLOSE,14),COLORRED;二号线:EMA(CLOSE,25);三号线:EMA(CLOSE,318);生命线:EMA(CLOSE,453),COLORRED,LINETHICK2;五号线:EMA(CLOSE,550);六号线:EMA(CLOSE,610);七号线:EMA(CLOSE,730);八号线:EMA(CLOSE,888);九号线:EMA(CLOSE,99),COLORGREEN;DIFF:=( EMA(CLOSE,7) - EMA(CLOSE,19));DEA:=EMA(DIFF,9);MACD:=0.90*(DIFF-DEA);TJ:=(DIFF>=DEA);TJ1:=(DIFF>=0);STICKLINE(TJ,H,L,0.5,0),COLORYELLOW;STICKLINE(TJ,O,C,4,0),COLORYELLOW;STICKLINE(TJ1 AND TJ,H,L,0.5,0),COLORF00FF0;STICKLINE(TJ1 AND TJ,O,C,4,1),COLORF00FF0;STICKLINE(DIFF<DEA,H,L,0.5,0),COLORF0F000;STICKLINE(DIFF<DEA,O,C,4,0),COLORF0F000;VAR1:=(CLOSE*2+HIGH+LOW)/4;SK:= EMA(VAR1,13)-EMA(VAR1,73);SD:= EMA(SK,2);DRAWTEXT((CROSS(SK,SD) AND SK<-0.04 AND (C-REF(C,1))/REF(C,1)>=0.03) OR (CROSS(SK,SD) AND SK<=-0.14 )OR (CROSS(SK,SD) AND SK<=0.05 AND (V/MA(V,5)>2 OR C/REF(C,1)>0.035)) ,L*0.99,'短线'),COLORGREEN;STICKLINE((CROSS(SK,SD) AND SK<-0.04 AND (C-REF(C,1))/REF(C,1)>=0.03) OR (CROSS(SK,SD) AND SK<=-0.14 )OR (CROSS(SK,SD) AND SK<=0.05 AND (V/MA(V,5)>2 OR C/REF(C,1)>0.035)),H,L,0.5,0),COLORRED;STICKLINE((CROSS(SK,SD) AND SK<-0.04 AND (C-REF(C,1))/REF(C,1)>=0.03) OR (CROSS(SK,SD) AND SK<=-0.14 )OR (CROSS(SK,SD) AND SK<=0.05 AN */DIFF :=EMA(CLOSE,12) - EMA(CLOSE,26);DEA :=EMA(DIFF,9);MACD :=(DIFF-DEA)*2;TR := SUM(MAX(MAX(HIGH-LOW,ABS(HIGH-REF(CLOSE,1))),ABS(LOW-REF(CLOSE,1))),14); HD := HIGH-REF(HIGH,1);LD := REF(LOW,1)-LOW;PDM:= SUM(IF(HD>0 AND HD>LD,HD,0),14);MDM:= SUM(IF(LD>0 AND LD>HD,LD,0),14);PDI:= PDM*100/TR;MDI:= MDM*100/TR;RSV:=(CLOSE-LLV(LOW,9))/(HHV(HIGH,9)-LLV(LOW,9))*100;K:=SMA(RSV,3,1);D:=SMA(K,3,1);J:=3*K-2*D;LC :=REF(CLOSE,6);//前一周期收盘价RSI1:=SMA(MAX(CLOSE-LC,0),12,1)/SMA(ABS(CLOSE-LC),12,1)*100;//当根K线收盘价与前一周期收盘价做差,在该差值与0之间取最大值,做N1周期移动平均。
准确率最高的期货指标文华财经期货软件指标公式期货指标大全汇总
N:=20;MA1:=MA(CLOSE,7);MA2:=MA(CLOSE,13);MA3:=MA(CLOSE,34);MA4:=MA(CLOSE,50);VAR3:=LLV(HIGH,240);VAR4:=100*(CLOSE-VAR3)/VAR3;VAR5:=(CLOSE-LLV(LOW,528))/(HHV(HIGH,528)-LLV(LOW,528))*100;VAR6:=(CLOSE-LLV(CLOSE,530))/(HHV(CLOSE,530)-LLV(CLOSE,530))*100;VAR7:=0;VAR8:=SMA(MAX(CLOSE-REF(CLOSE,1),0),34,1)/SMA(ABS(CLOSE-REF(CLOSE,1)),7,1)*100;VAR9:=SMA(MAX(CLOSE-REF(CLOSE,1),0),13,1)/SMA(ABS(CLOSE-REF(CLOSE,1)),13,1)*100;VAR10:=IF(TROUGHBARS(C,16,1,1)=0 AND HIGH>LOW+0.04,4,0);VAR11:=ZIGZAG(C,6,1)>REF(ZIGZAG(C,6,1),1) AND REF(ZIGZAG(C,6,1),1)<=REF(ZIGZAG(C,6,1),2) AND REF(ZIGZAG(C,6,1),2)<=REF(ZIGZAG(C,6,1),3);VAR12:=ZIGZAG(C,6,1)<REF(ZIGZAG(C,6,1),1) AND REF(ZIGZAG(C,6,1),1)>=REF(ZIGZAG(C,6,1),2) AND REF(ZIGZAG(C,6,1),2)>=REF(ZIGZAG(C,6,1),3);VAR13:=ZIGZAG(C,22,1)>REF(ZIGZAG(C,22,1),1) AND REF(ZIGZAG(C,22,1),1)<=REF(ZIGZAG(C,22,1),2) AND REF(ZIGZAG(C,22,1),2)<=REF(ZIGZAG(C,22,1),3);VAR14:=ZIGZAG(C,22,1)<REF(ZIGZAG(C,22,1),1) AND REF(ZIGZAG(C,22,1),1)>=REF(ZIGZAG(C,22,1),2) AND REF(ZIGZAG(C,22,1),2)>=REF(ZIGZAG(C,22,1),3);VAR15:=ZIGZAG(C,51,1)>REF(ZIGZAG(C,51,1),1) AND REF(ZIGZAG(C,51,1),1)<=REF(ZIGZAG(C,51,1),2) AND REF(ZIGZAG(C,51,1),2)<=REF(ZIGZAG(C,51,1),3);VAR16:=ZIGZAG(C,51,1)<REF(ZIGZAG(C,51,1),1) AND REF(ZIGZAG(C,51,1),1)>=REF(ZIGZAG(C,51,1),2) AND REF(ZIGZAG(C,51,1),2)>=REF(ZIGZAG(C,51,1),3);VAR17:=ZIGZAG(C,72,1)>REF(ZIGZAG(C,72,1),1) AND REF(ZIGZAG(C,72,1),1)<=REF(ZIGZAG(C,72,1),2) AND REF(ZIGZAG(C,72,1),2)<=REF(ZIGZAG(C,72,1),3);VAR18:=ZIGZAG(C,72,1)<REF(ZIGZAG(C,72,1),1) AND REF(ZIGZAG(C,72,1),1)>=REF(ZIGZAG(C,72,1),2) AND REF(ZIGZAG(C,72,1),2)>=REF(ZIGZAG(C,72,1),3);VAR19:=EMA(CLOSE,2)-EMA(CLOSE,150);买1:=VAR10;买2:=(VAR11+VAR13+VAR15+VAR17);卖1:=(VAR12+VAR14+VAR16+VAR18);B:=IF(买1>0 OR 买2>0,LOW*0.99,NULL),CROSSDOT,LINETHICK3,COLORYELLOW; DRAWTEXT(买1>0 OR 买2>0,LOW*0.99,'买入'),COLORRED;S:=IF(卖1>0,HIGH*1.01,NULL),CROSSDOT,LINETHICK3,COLORGREEN;DRAWTEXT(卖1>0,HIGH*1.02,'卖出'),COLORGREEN;VAR100:=(100 - ((90 * (HHV(HIGH,20) - CLOSE)) / (HHV(HIGH,20) - LLV(LOW,20))));VAR200:=(100 - ((90 * (HHV(HIGH,20) - CLOSE)) / (HHV(HIGH,20) - LLV(LOW,20))));VAR300:=(100 - MA(((100 * (HHV(HIGH,5) - CLOSE)) / (HHV(HIGH,5) - LLV(LOW,5))),34)); BOLLZ:MA(CLOSE,N),LINETHICK2,COLORWHITE;UB:BOLLZ+2*STD(CLOSE,N),LINETHICK2,COLORYELLOW;LB:BOLLZ-2*STD(CLOSE,N),LINETHICK2,COLORMAGENTA;ZJ1953:=ZIGZAG(H,15,1);粉丝:=MA(ZJ1953,3);DRAWTEXT(CROSS(ZJ1953,粉丝),LOW*1.025,'↖基金入场'),COLORMAGENTA;DRAWTEXT(CROSS(粉丝,ZJ1953),HIGH*0.988,'←基金清仓'),COLORFFFFFF;阻力价:HHV(HIGH,19),COLORGREEN,LINETHICK1,NODRAW;A:=(3*C+L+O+H)/6;X:=(20*A+19*REF(A,1)+18*REF(A,2)+17*REF(A,3)+16*REF(A,4)+15*REF(A,5)+14*REF(A,6)+13*RE F(A,7)+12*REF(A,8)+11*REF(A,9)+10*REF(A,10)+9*REF(A,11)+8*REF(A,12)+7*REF(A,13)+6*REF(A ,14)+5*REF(A,15)+4*REF(A,16)+3*REF(A,17)+2*REF(A,18)+REF(A,20))/210;主力成本线:EMA(X,13),COLORMAGENTA,NODRAW;UR:=2;LR:=4;TC1:=IF(H=HHV(H,8*UR),H,NULL);TC2:=REFX1(BARSLAST(TC1=H),9999)+1;UPPER:=REFX1(IF(TC2=1,H,REF(H,TC2-1)),9999);BC1:=IF(L=LLV(L,8*LR),L,NULL);BC2:=REFX1(BARSLAST(BC1=L),9999)+1;LOWER:=REFX1(IF(BC2=1,L,REF(L,BC2-1)),9999);CURRBARSCOUNT:=REFX1(BARPOS,9999)-BARPOS+1;LP:=CURRBARSCOUNT<=BC2 AND L=LOWER;//低点定位}HP:=CURRBARSCOUNT<=TC2 AND H=UPPER;//高点定位}NOD:=(IF(TC2>BC2,TC2,BC2)-IF(TC2>BC2,BC2,TC2));//用时}LR1:=FORCAST(C,NOD+1);NP:=IF(CURRBARSCOUNT<=MAX(BC2,TC2),REFX1(IF(MIN(TC2,BC2)=1,LR1,REF(LR1,MIN(TC2,BC2)-1)),9999),NULL),POINTDOT,COLOR93BDA8,NODRAW;//近点}//隐藏}LR2:=SLOPE(C,NOD+1);LR3:=REFX1(IF(MIN(TC2,BC2)=1,LR2,REF(LR2,MIN(TC2,BC2)-1)),9999);FP:=NP-LR3*(NOD),POINTDOT,COLOR93BDA8,NODRAW;//远点}//隐藏}EQU:=(NP+FP)/2,POINTDOT,COLOR93BDA8,NODRAW;//隐藏}AD:=ABS(NP-FP);//高差};DBL:=BARSLAST(BC1<>NULL)+1;DBH:=BARSLAST(TC1<>NULL)+1;BSP:=IF(BC2>TC2,DBL,DBH)-1;LRL:=IF(NP>FP,FP+AD/NOD*BSP,FP-AD/NOD*BSP);AT1:=IF(BETWEEN(CURRBARSCOUNT,BC2,TC2) AND H>LRL,H,LRL);AT2:=HHV(AT1-LRL,MAX(BC2,TC2));AT3:=REFX1(BARSLAST(AT1-LRL=AT2),9999);AT4:=REFX1(IF(AT3=0,H,REF(H,AT3)),9999);AT5:=REFX1(IF(AT3=0,AT1-LRL,REF(AT1-LRL,AT3)),9999);ATL:=LRL+AT5;UT1:=IF(BETWEEN(CURRBARSCOUNT,BC2,TC2) AND L<LRL,L,LRL);UT2:=HHV(LRL-UT1,MAX(BC2,TC2));UT3:=REFX1(BARSLAST(LRL-UT1=UT2),9999);UT4:=REFX1(IF(UT3=0,H,REF(H,UT3)),9999);UT5:=REFX1(IF(UT3=0,LRL-UT1,REF(LRL-UT1,UT3)),9999);UTL:=LRL-UT5;RH:=IF(CURRBARSCOUNT>=MIN(BC2,TC2)-10,ATL,REFX1(REF(ATL,MIN(BC2,TC2)-11),9999));//限制高}RL:=IF(CURRBARSCOUNT>=MIN(BC2,TC2)-10,UTL,REFX1(REF(UTL,MIN(BC2,TC2)-11),9999));//限制低}中轨:IF(NP>FP,IF(LRL<=RH,LRL,NULL),IF(LRL>=RL,LRL,NULL)),COLOR666666,LINETHICK2;上轨:IF(NP>FP,IF(ATL<=RH,ATL,NULL),IF(ATL>=RL,ATL,NULL)),COLOR666666,LINETHICK2;下轨:IF(NP>FP,IF(UTL<=RH,UTL,NULL),IF(UTL>=RL,UTL,NULL)),COLOR666666,LINETHICK2;VAR1:=(C+H+O+L)/4;顶阴影线:=REFX1(MA(VAR1,20),20/2)*(1+1/8),COLORGREEN,LINETHICK1;DRAWTEXT(CROSS(HIGH,顶阴影线),HIGH*0.990,'↙逃'),COLORGREEN;高点:=10;低点:=10;高点选择:=1;低点选择:=1;波浪尺1:=0;波浪尺2:=1;PURC:=REFX1(REF(HHV(H,高点*10),高点选择),9999);PLZ:=REFX1(BARSLAST(PURC=H),9999)+1;顶X:=REFX1(IF(PLZ=1,H,REF(H,PLZ-1)),9999);QQT:=REFX1(REF(LLV(L,低点*10),低点选择),9999);PLL:=REFX1(BARSLAST(QQT=L),9999)+1;低X:=REFX1(IF(PLL=1,L,REF(L,PLL-1)),9999);DRAWKLINE1(H,O,L,C);顶点:顶X,COLORRED;底点:低X,COLORRED;波动速率:=100*((顶X-低X)/(IF(PLL>PLZ,低X,顶X)))/(PLL-PLZ),NODRAW,COLORMAGENTA;波动幅度:=((顶X-低X)/(IF(PLL>PLZ,低X,顶X)))*100;波动价位:=(顶X-低X)*(IF(PLL>PLZ,1,-1));BPURC:=REFX1(REF(HHV(H,(IF(波浪尺1>0,波浪尺1,IF(PLZ<PLL,高点,低点)))*5),波浪尺2),9999); BPLZ:=REFX1(BARSLAST(BPURC=H),9999)+1;BQQT:=REFX1(REF(LLV(L,(IF(波浪尺1>0,波浪尺1,IF(PLZ<PLL,高点,低点)))*5),波浪尺2),9999); BPLL:=REFX1(BARSLAST(BQQT=L),9999)+1;BLC1:=REFX1(REF(HHV(H,(IF(波浪尺1>0,波浪尺1,IF(PLZ<PLL,高点,低点)))*5),波浪尺2),9999); BLC2:=REFX1(BARSLAST(BPURC=H),9999)+1;BLC顶X:=REFX1(IF(BPLZ=1,H,REF(H,BPLZ-1)),9999);BLC3:=REFX1(REF(LLV(L,(IF(波浪尺1>0,波浪尺1,IF(PLZ<PLL,高点,低点)))*5),波浪尺2),9999);B6C4:=REFX1(BARSLAST(BQQT=L),9999)+1;BLC低X:=REFX1(IF(BPLL=1,L,REF(L,BPLL-1)),9999);BASE:=IF(波动速率<0,BLC顶X,BLC低X),COLORRED;BLCX:=IF(波动速率<0,-1,1);BLCZ:=(顶点-底点)*(IF(PLL>PLZ,1,-1));B618:=BASE+(BLCZ*0.618),COLORRED,DOT;B382:=BASE+(BLCZ*0.382),COLORRED,DOT;B05:=BASE+(BLCZ*0.5),COLORRED,DOT;B809:=BASE+(BLCZ*0.809),COLORRED,DOT;B191:=BASE+(BLCZ*0.191),COLORRED,DOT;B100:=BASE+(BLCZ*1),COLORRED;B200:=BASE+(BLCZ*2),COLORRED;B11:=BASE+(BLCZ*1.191),COLORRED;B12:=BASE+(BLCZ*1.382),COLORRED;B13:=BASE+(BLCZ*1.5),COLORRED;B14:=BASE+(BLCZ*1.618),COLORRED;B15:=BASE+(BLCZ*1.809),COLORRED;BZ1:=BASE+(BLCZ*0.236),COLORRED;BZ2:=BASE+(BLCZ*1.236),COLORRED;BZ3:=BASE+(BLCZ*2.236),COLORRED;B11B:=BASE+(BLCZ*2.191),COLORRED;B12B:=BASE+(BLCZ*2.382),COLORRED;B13B:=BASE+(BLCZ*2.5),COLORRED;B14B:=BASE+(BLCZ*2.618),COLORRED;B15B:=BASE+(BLCZ*2.809),COLORRED;B300:=BASE+(BLCZ*3),COLORRED;XZDD:=IF(PLL>PLZ,BPLL,BPLZ);QADQ:=IF(PLL>PLZ,PLL,PLZ);QADH:=IF(PLL>PLZ,PLZ,PLL);QHL1:=IF(PLL>PLZ,L,H);QHL2:=IF(PLL>PLZ,H,L);DRAWLINE(CURRBARSCOUNT=QADQ,QHL1,CURRBARSCOUNT=QADH,QHL2,0),COLORRED; DRAWLINE(CURRBARSCOUNT=QADH,QHL2,CURRBARSCOUNT=XZDD,QHL1,0),COLORRED;JRH:=HHV(C,2);JRL:=LLV(C,2);YTSL:=(3*C+L+O+H)/6;Z1D:=C>=REF(C,1);Z1X:=C<=REF(C,1);Z2D:=C>=REF(C,2);Z2X:=C<=REF(C,2);X1D2:=Z1X AND Z2D;D1X2:=Z1D AND Z2X;R1:=Z1D AND Z2D;R2:=REF(R1,1) AND X1D2;R3:=REF(R2,1) AND D1X2;R4:=REF(R3,1) AND X1D2;R5:=REF(R4,1) AND D1X2;R6:=REF(R5,1) AND X1D2;R7:=REF(R6,1) AND D1X2;R8:=REF(R7,1) AND X1D2;R9:=REF(R8,1) AND D1X2;RA:=REF(R9,1) AND X1D2;RB:=REF(RA,1) AND D1X2;RC:=REF(RB,1) AND X1D2;RD:=Z1X AND Z2X;RE:=REF(RD,1) AND D1X2;RF:=REF(RE,1) AND X1D2;R10:=REF(RF,1) AND D1X2;R11:=REF(R10,1) AND X1D2;R12:=REF(R11,1) AND D1X2;R13:=REF(R12,1) AND X1D2;R14:=REF(R13,1) AND D1X2;R15:=REF(R14,1) AND X1D2;R16:=REF(R15,1) AND D1X2;R17:=REF(R16,1) AND X1D2;R18:=REF(R17,1) AND D1X2;R19:=((REF(RD OR RE OR RF OR R10 OR R11 OR R12 OR R13 OR R14 OR R15 OR R16 OR R17 OR R18,1)) AND R1);R1A:=((REF(R1 OR R2 OR R3 OR R4 OR R5 OR R6 OR R7 OR R8 OR R9 OR RA OR RB OR RC,1)) AND RD);红色持股:=R1 OR R2 OR R3 OR R4 OR R5 OR R6 OR R7 OR R8 OR R9 OR RA OR RB OR RC,COLOR0000FF,NODRAW;离场:=IF(红色持股,JRL,NULL);明离场价:=离场,COLORFF99FF,NODRAW;今离场价:REF(离场,1),COLORGREEN,NODRAW;青色观望:=RD OR RE OR RF OR R10 OR R11 OR R12 OR R13 OR R14 OR R15 OR R16 OR R17 OR R18,COLORFFFF00,NODRAW;进:=IF(青色观望,JRH,NULL);明进场价:=进,COLOR33AACC,NODRAW;今进场价:REF(明进场价,1),COLORRED,NODRAW;短买:R19,COLORLIGHTRED,NODRAW;STICKLINE(ISLASTBAR AND (红色持股OR REF(红色持股,1)=1),今离场价,今离场价,30,1),COLOR0000FF;STICKLINE(ISLASTBAR AND (青色观望OR REF(青色观望,1)=1),今进场价,今进场价,30,1),COLOR00FF00;QLIFE:=(EMA(CLOSE,60)+EMA(CLOSE,90))/2,POINTDOT,COLORGREEN,LINETHICK4; FROMOPEN:=IF(HOUR<12,60*(HOUR-9)-30+MINUTE,120+60*(HOUR-13)+MINUTE);TT:=240/FROMOPEN;比:=TT;J12:=(HIGH - ((HIGH - LOW) / 3));J23:=(LOW + ((HIGH - LOW) / 3));AAA:=REFX1(HHV(H,90),9999);BBB:=REFX1(LLV(L,100),9999);DRAWKLINE1(H,O,L,C);升:=EMA(C,2),COLOR000000;降:=EMA(SLOPE(C,12)*20+C,30),COLOR000000;买:=CROSS(升,降);卖:=CROSS(降,升);BUY1:=ZIGZAG(C,10,1);SELL1:=MA(BUY1,2);DRAWICON(CROSS(BUY1,SELL1),L-0.3,7);DRAWICON(CROSS(SELL1,BUY1),H+0.2,8);STICKLINE(BUY1>SELL1 AND O>=C,C,O,-1,0),COLORRED;STICKLINE(BUY1>SELL1 AND O>=C,L,H,0,0),COLORRED;STICKLINE(BUY1<SELL1 AND O<=C,O,C,-1,1),COLORCYAN;STICKLINE(BUY1<SELL1 AND O<=C,O,L,0,1),COLORCYAN;STICKLINE(BUY1<SELL1 AND O<=C,C,H,0,1),COLORCYAN;GET:ZIGZAG(C,5,1),COLORAAAAAA;PL5:=ZIGZAG(C,5,1);EN1:=ZIGZAG(C,5,1)>REF(ZIGZAG(C,5,1),1) AND REF(ZIGZAG(C,5,1),1)<=REF(ZIGZAG(C,5,1),2) AND REF(ZIGZAG(C,5,1),2)<=REF(ZIGZAG(C,5,1),3);EX1:=ZIGZAG(C,5,1)<REF(ZIGZAG(C,5,1),1) AND REF(ZIGZAG(C,5,1),1)>=REF(ZIGZAG(C,5,1),2) AND REF(ZIGZAG(C,5,1),2)>=REF(ZIGZAG(C,5,1),3);PL10:=ZIGZAG(C,13,1);EN2:=ZIGZAG(C,10,1)>REF(ZIGZAG(C,10,1),1) AND REF(ZIGZAG(C,10,1),1)<=REF(ZIGZAG(C,10,1),2) AND REF(ZIGZAG(C,10,1),2)<=REF(ZIGZAG(C,10,1),3);EX2:=ZIGZAG(C,10,1)<REF(ZIGZAG(C,10,1),1) AND REF(ZIGZAG(C,10,1),1)>=REF(ZIGZAG(C,10,1),2) AND REF(ZIGZAG(C,10,1),2)>=REF(ZIGZAG(C,10,1),3);PL20:=ZIGZAG(C,26,1);EN3:=ZIGZAG(C,20,1)>REF(ZIGZAG(C,20,1),1) AND REF(ZIGZAG(C,20,1),1)<=REF(ZIGZAG(C,20,1),2)AND REF(ZIGZAG(C,20,1),2)<=REF(ZIGZAG(C,20,1),3);EX3:=ZIGZAG(C,20,1)<REF(ZIGZAG(C,20,1),1) AND REF(ZIGZAG(C,20,1),1)>=REF(ZIGZAG(C,20,1),2) AND REF(ZIGZAG(C,20,1),2)>=REF(ZIGZAG(C,20,1),3);PL40:=ZIGZAG(C,55,1);走强一:=BARSLAST(PL5<REF(PL5,1));走弱一:=BARSLAST(PL5>REF(PL5,1));走强二:=BARSLAST(PL10<REF(PL10,1));走弱二:=BARSLAST(PL10>REF(PL10,1));走强三:=BARSLAST(PL20<REF(PL20,1));走弱三:=BARSLAST(PL20>REF(PL20,1));ZTJZ5:=IF(PL10>REF(PL10,1),COUNT(EN1,走强二),0);ZTJD5:=IF(PL10>REF(PL10,1),COUNT(EX1,走强二),0);DTJZ5:=IF(PL10<REF(PL10,1),COUNT(EN1,走弱二),0);DTJD5:=IF(PL10<REF(PL10,1),COUNT(EX1,走弱二),0);ZTJZ10:=IF(PL20>REF(PL20,1),COUNT(EN2,走强三),0);ZTJD10:=IF(PL20>REF(PL20,1),COUNT(EX2,走强三),0);DTJZ10:=IF(PL20<REF(PL20,1),COUNT(EN2,走弱三),0);DTJD10:=IF(PL20<REF(PL20,1),COUNT(EX2,走弱三),0);DRAWTEXT(EN1 AND DTJZ5=1,LOW*0.97,'(ⅠA多)'),COLORFFFF00;DRAWTEXT(EX1 AND DTJD5=2,HIGH*1.03,'(ⅡB空)'),COLORFFFF00;DRAWTEXT(EN2 AND ZTJZ5=1,LOW*0.97,'(ⅢC全仓)'),COLORFFFF00;DRAWTEXT(EX1 AND PL10>REF(PL10,1) AND ZTJD5=1,HIGH*1.02,'⑴空'),COLOR0000FF; DRAWTEXT(EN1 AND PL10>REF(PL10,1) AND ZTJZ5=2,LOW*0.98,'⑵全仓多'),COLOR0000FF; DRAWTEXT(EX1 AND PL10>REF(PL10,1) AND ZTJZ5=2,HIGH*1.02,'⑶空'),COLOR0000FF; DRAWTEXT(EN1 AND PL10>REF(PL10,1) AND ZTJZ5=3,LOW*0.98,'⑷全仓多'),COLOR0000FF; DRAWTEXT(EX2 AND PL20>REF(PL20,1) AND ZTJD10=1,HIGH*1.02,'⑸顶'),COLOR0000FF; DRAWTEXT(EN2 AND DTJZ10=1,LOW*0.94,'【A】多'),COLOR00FF00;DRAWTEXT(EX2 AND DTJD10=2,HIGH*1.05,'【B】空'),COLOR00FF00;DRAWTEXT(EN3 AND ZTJZ10=1,LOW*0.94,'【C】全仓多'),COLOR00FF00;DRAWTEXT(EX2 AND PL20>REF(PL20,1) AND ZTJD10=1,HIGH*1.04,'①空进'),COLOR00FFFF; DRAWTEXT(EN2 AND PL20>REF(PL20,1) AND ZTJZ10=2,LOW*0.96,'②多全仓'),COLOR00FFFF; DRAWTEXT(EX2 AND PL20>REF(PL20,1) AND ZTJD10=2 OR (ZTJD10=0 OR ZTJD10=2) AND EX2,HIGH*1.04,'③空'),COLOR00FFFF;DRAWTEXT(EN2 AND PL20>REF(PL20,1) AND ZTJZ10=3,LOW*0.96,'④多补'),COLOR00FFFF;走势线:ZIGZAG(C,3,1);G:=MA(走势线,2);DRAWTEXT(CROSS(走势线,G),L,'多买'),COLORRED;DRAWTEXT(CROSS(G,走势线),H,'空卖' ),COLORGREEN;支撑位:IF((走势线-REF(走势线,1))/REF(走势线,1)*100>=0,REF(走势线,BARSLAST(CROSS((走势线-REF(走势线,1))/REF(走势线,1)*100,0))+1),NULL),COLORRED,LINETHICK2;阻力位:IF((走势线-REF(走势线,1))/REF(走势线,1)*100<0,REF(走势线,BARSLAST(CROSS(0,(走势线-REF(走势线,1))/REF(走势线,1)*100))+1),NULL),COLORLIGHTBLUE,LINETHICK2;买卖价格位:MA(C,3);头部:=PEAKBARS(C,3,1,1)=0;底部:=TROUGHBARS(C,3,1,1)=0;DRAWTEXT(头部,H,'有阻力'),COLORGREEN;DRAWTEXT(底部,L,'有支撑'),COLORRED;。
准确率最高的期货指标文华财经期货软件指标公式顶底之王指标
CAPITAL:=GETPRICE1('流通股本');AA:=ZIGZAG(C,5,1);DRAWNUMBER(AA=HHV(C,10),H*1.01,H,0,COLORGREEN);DRAWNUMBER(AA=LLV(C,10),L*0.99,L,0,COLOR00EEFF);HH:=REFX1(MA(H,125),125/2);LL:=REFX1(MA(L,125),125/2);金牛:(REFX1(MA(HH,125),125/2)-REFX1(MA(LL,125),125/2))*1+REFX1(MA(HH,125),125/2),DOT,LINET HICK5,COLORYELLOW;金钻趋势:REFX1(MA(LL,125),125/2)-(REFX1(MA(HH,125),125/2)-REFX1(MA(LL,125),125/2))*1,LINETHICK1 ,COLORRED;金牛2:EMA(金钻趋势,25),COLORCYAN,LINETHICK2;FILLRGN(金钻趋势>金牛2,金钻趋势,金牛2,RGB(55,0,0));FILLRGN(金钻趋势<金牛2,金钻趋势,金牛2,RGB(0,91,0));DRAWKLINE1(H,O,L,C);STICKLINE(金钻趋势>LOW AND 金钻趋势<HIGH,金钻趋势,MIN(MIN(OPEN,CLOSE),金钻趋势),2,0),COLORYELLOW;STICKLINE(金钻趋势>MIN(C,O) AND 金钻趋势<MAX(C,O),金钻趋势,MIN(OPEN,CLOSE),2,0),COLORYELLOW;STICKLINE(金钻趋势>HIGH,OPEN,CLOSE,2,0),COLORYELLOW;STICKLINE(金钻趋势>HIGH,HIGH,LOW,0,0),COLORYELLOW;CC1:=REFX1(MA(C-REF(C,1),6),6/2);CC2:=REFX1(MA(ABS(C-REF(C,1)),6),6/2);VAR23:=100*REFX1(MA(CC1,6),6/2)/REFX1(MA(CC2,6),6/2);回调买:=LLV(VAR23,2)=LLV(VAR23,7) AND COUNT(VAR23<0,2) AND CROSS(VAR23,MA(VAR23,2)); XG:=金钻趋势>HIGH AND 回调买AND L<=金钻趋势;DRAWTEXT(XG,L,'▲TTT买入'),COLORRED;JJ:=(HIGH+LOW+CLOSE)/3;QJ0:=VOL/IF(HIGH=LOW,4,HIGH-LOW);QJ1:=IF(CAPITAL=0,QJ0*(JJ-MIN(CLOSE,OPEN)),QJ0*IF(HIGH=LOW,1,(MIN(OPEN,CLOSE)-LOW))); QJ2:=IF(CAPITAL=0,QJ0*(MIN(OPEN,CLOSE)-LOW),QJ0*IF(HIGH=LOW,1,(JJ-MIN(CLOSE,OPEN)))); QJ3:=IF(CAPITAL=0,QJ0*(HIGH-MAX(OPEN,CLOSE)),QJ0*IF(HIGH=LOW,1,(HIGH-MAX(OPEN,CLOSE ))));QJ4:=IF(CAPITAL=0,QJ0*(MAX(CLOSE,OPEN)-JJ),QJ0*IF(HIGH=LOW,1,(MAX(CLOSE,OPEN)-JJ))); DDX:=((QJ1+QJ2)-(QJ3+QJ4))/IF(CAPITAL=0,10000,10000),COLOR00AAAA,LINETHICK1;V2:=SMA(IF(C>=REF(C,1),DDX,-DDX/100),2,1);FROMOPEN:=IF(HOUR<12,60*(HOUR-9)-30+MINUTE,120+60*(HOUR-13)+MINUTE);V5:=SMA(V2*120/FROMOPEN*5,2,1);V10:=SMA(V5,5,1);V20:=SMA(V10,5,1);CURRBARSCOUNT:=DATACOUNT-BARPOS+1;DY:=CURRBARSCOUNT=1 AND C<REF(C,1);DY2:=REF(V2,1)-DY;XG2:=C>O AND DY2<0.02 AND MA(C,5)>MA(C,60) AND C/REF(C,1)>=1.02 AND H<金牛; DRAWTEXT(XG2 AND L<金钻趋势,L,'↖金钻起涨'),COLORMAGENTA;EMA3:EMA(C,3),COLORWHITE,LINETHICK2;EMA13:EMA(C,13),COLORYELLOW;EMA21:EMA(C,21),COLORFF00FF;EMA55:EMA(C,55),COLORGREEN;AR1:=EMA21>EMA13 AND EMA13>EMA3;AR2:=BARSLAST((C-EMA3)/EMA3*100<-6);AR3:=EMA3>=REF(EMA3,2);AR4:=COUNT(CROSS(C,EMA3),AR2)=1;AR5:=AR1 AND AR2 AND AR3 AND AR4;AR6:=AR5 AND FILTER(AR5,10);DRAWTEXT(AR6,L-0.09,'------启动'),COLORYELLOW;BR1:=COUNT(BETWEEN((C-REF(C,1))/REF(C,1)*100,0,5) ,5)=5;BR2:=ABS((EMA3-EMA13)+(EMA13-EMA21))/C<0.2;BR3:=C>EMA21 AND (REF(C,1)<REF(EMA21,1) OR REF(C,2)<REF(EMA21,2) OR REF(C,3)<REF(EMA21,3) OR REF(C,4)<REF(EMA21,4) OR REF(C,5)<REF(EMA21,5));BR4:=BR1 AND BR2 AND BR3;DRAWTEXT(BR4 AND FILTER(BR4,10),L-0.09,'------转强'),COLOR00C5FF;STICKLINE(BR4 AND FILTER(BR4,10),H,L,0.5,1),COLOR00C5FF;CR1:=(C-REF(C,1))/REF(C,1)*100>0.5;CR2:=V>MA(V,5)*0.6;CR3:=COUNT(CROSS(EMA3,EMA21),3)=1;CR4:=ABS(EMA13-EMA21)/EMA21<0.03;CR5:=EMA21<=EMA55 AND EMA21>=REF(EMA21,1);CR6:=FILTER(CR1 AND CR2 AND CR3 AND CR4 AND CR5,2);DRAWTEXT(CR6,L-0.09,'---拉升'),COLORF00FF0;DR1:=EMA3>EMA13 AND EMA13<EMA21;DR2:=BARSLAST(CROSS(C,EMA21) );DR3:=H=HHV(H,DR2);DR4:=BARSLAST(DR3);DR5:=COUNT(O>C AND C<REF(C,1) AND C>EMA21 AND BETWEEN((C-EMA21)/EMA21,0,0.02),DR4)=1;DR6:=C>REF(C,1) ;DR7:= DR1 AND DR5 AND DR6 ;DR8:=DR7 AND FILTER(DR7 ,10);DRAWTEXT(DR8,L-0.09,'------------拉升'),COLORD6BA63;STICKLINE(DR8,O,C,6,1),LINETHICK2,COLORD6BA63;ER:=BARSLAST(REF(CROSS(EMA21,EMA13),1)) AND CROSS(EMA13,EMA21);DRAWTEXT(ER,L-0.09,'------上攻'),COLOR0099FF;FR:=BARSLAST(REF(CROSS(EMA13,EMA3),1)) AND CROSS(EMA3,EMA13);DRAWTEXT(FR,L-0.09,'------中继'),COLORWHITE;STICKLINE(FR,H,L,0.5,1),COLORWHITE;DIFF:=(EMA(CLOSE,12) - EMA(CLOSE,26));DEA:=EMA(DIFF,9);MACD:=2*(DIFF-DEA);X1:=(C+L+H)/3;X2:=EMA(X1,6);X3:=EMA(X2,5);BIAS1 : (CLOSE-MA(CLOSE,6))/MA(CLOSE,6)*100;BIAS2 : (CLOSE-MA(CLOSE,13))/MA(CLOSE,13)*100;BIAS3 : (CLOSE-MA(CLOSE,24))/MA(CLOSE,24)*100;GR1:=BARSLAST(BETWEEN(BIAS2,0,5));GR2:=EMA(X1,13)>EMA(X1,21) AND EMA(X1,21)>EMA(X1,34)AND EMA(X1,13)>REF(EMA(X1,13),1);GR3:=COUNT(BIAS2>10 AND H=HHV(H,GR1),GR1);GR4:=H=HHV(H,GR1);GR5:=MACD<REF(MACD,1);GR6:=GR2 AND GR3 AND GR4;GR7:=GR2 AND GR3 AND GR4 AND GR5;DRAWTEXT(GR6 AND GR7,H+0.3,'逃顶'),COLOR00FF00;STICKLINE(GR6 AND GR7,H,H+0.09,4,0),COLOR00FF00;HR2:=EMA3>=REF(EMA3,3) AND EMA13>=REF(EMA13,1) AND EMA21>=REF(EMA21,1) ANDCROSS(C,EMA3) AND CROSS(C,EMA13) AND CROSS(C,EMA21);DRAWTEXT(HR2 AND FILTER(HR2,10),L-0.09,'进场!'),COLORFFC8FF;MA1:MA(CLOSE,34),COLORBLUE;K1:=(C+H+L)/3;D1:=MA(K1,4);高:=REF(HHV(H,80),3);低:=REF(LLV(L,80),3);顶点:REFX1(高,10000),COLORGREEN,LINETHICK2;低点:REFX1(低,10000),COLORRED,LINETHICK2;AA05:MA(C,5),LINETHICK3,COLOR00CCFF;BB05:=ATAN((AA05/REF(AA05,1)-1)*100)*180/3.1416;IF(BB05>30 AND AA05>REF(AA05,1), AA05,NULL),LINETHICK3,COLORRED;买线:=ZIGZAG(C,10,1);卖线:=MA(买线,3);BU:=CROSS(买线,卖线);SEL:=CROSS(卖线,买线);DRAWTEXT(BU,L*0.99,'买多'),LINETHICK1,COLOR00AAFF;DRAWTEXT(SEL,H*1.01,'卖进'),LINETHICK1,COLOR00FF00;STICKLINE(买线>=卖线,LOW,HIGH,0,1),COLOR0000CC;STICKLINE(买线>=卖线,CLOSE,OPEN,2,1),COLOR0000CC;STICKLINE(买线<卖线,CLOSE,OPEN,2,0),COLORCYAN;STICKLINE(买线<卖线,LOW,HIGH,0,0),COLORCYAN;STICKLINE(CROSS(买线,卖线),OPEN,CLOSE,3,0),COLOR00AAFF;STICKLINE(CROSS(卖线,买线),OPEN,CLOSE,3,0),COLOR00DD00;VAR3:=LLV(HIGH,240);VAR4:=100*(CLOSE-VAR3)/VAR3;VAR5:=(CLOSE-LLV(LOW,528))/(HHV(HIGH,528)-LLV(LOW,528))*100;VAR6:=(CLOSE-LLV(CLOSE,530))/(HHV(CLOSE,530)-LLV(CLOSE,530))*100;VAR7:=0;VAR8:=SMA(MAX(CLOSE-REF(CLOSE,1),0),34,1)/SMA(ABS(CLOSE-REF(CLOSE,1)),7,1)*100;VAR9:=SMA(MAX(CLOSE-REF(CLOSE,1),0),13,1)/SMA(ABS(CLOSE-REF(CLOSE,1)),13,1)*100;VAR10:=IF(TROUGHBARS(C,16,1,1)=0 AND HIGH>LOW+0.04,4,0);VAR11:=ZIGZAG(C,6,1)>REF(ZIGZAG(C,6,1),1) AND REF(ZIGZAG(C,6,1),1)<=REF(ZIGZAG(C,6,1),2) AND REF(ZIGZAG(C,6,1),2)<=REF(ZIGZAG(C,6,1),3);VAR12:=ZIGZAG(C,6,1)<REF(ZIGZAG(C,6,1),1) AND REF(ZIGZAG(C,6,1),1)>=REF(ZIGZAG(C,6,1),2) AND REF(ZIGZAG(C,6,1),2)>=REF(ZIGZAG(C,6,1),3);VAR13:=ZIGZAG(C,22,1)>REF(ZIGZAG(C,22,1),1) AND REF(ZIGZAG(C,22,1),1)<=REF(ZIGZAG(C,22,1),2) AND REF(ZIGZAG(C,22,1),2)<=REF(ZIGZAG(C,22,1),3);VAR14:=ZIGZAG(C,22,1)<REF(ZIGZAG(C,22,1),1) AND REF(ZIGZAG(C,22,1),1)>=REF(ZIGZAG(C,22,1),2) AND REF(ZIGZAG(C,22,1),2)>=REF(ZIGZAG(C,22,1),3);VAR15:=ZIGZAG(C,51,1)>REF(ZIGZAG(C,51,1),1) AND REF(ZIGZAG(C,51,1),1)<=REF(ZIGZAG(C,51,1),2) AND REF(ZIGZAG(C,51,1),2)<=REF(ZIGZAG(C,51,1),3);VAR16:=ZIGZAG(C,51,1)<REF(ZIGZAG(C,51,1),1) AND REF(ZIGZAG(C,51,1),1)>=REF(ZIGZAG(C,51,1),2) AND REF(ZIGZAG(C,51,1),2)>=REF(ZIGZAG(C,51,1),3);VAR17:=ZIGZAG(C,72,1)>REF(ZIGZAG(C,72,1),1) AND REF(ZIGZAG(C,72,1),1)<=REF(ZIGZAG(C,72,1),2) AND REF(ZIGZAG(C,72,1),2)<=REF(ZIGZAG(C,72,1),3);VAR18:=ZIGZAG(C,72,1)<REF(ZIGZAG(C,72,1),1) AND REF(ZIGZAG(C,72,1),1)>=REF(ZIGZAG(C,72,1),2) AND REF(ZIGZAG(C,72,1),2)>=REF(ZIGZAG(C,72,1),3);VAR19:=EMA(CLOSE,2)-EMA(CLOSE,150);买1:=VAR10;买2:=(VAR11+VAR13+VAR15+VAR17);卖1:=(VAR12+VAR14+VAR16+VAR18);B:IF(买1>0 OR 买2>0,LOW*0.99,NULL),CROSSDOT,LINETHICK3,COLORYELLOW; DRAWTEXT(买1>0 OR 买2>0,LOW*0.99,'买'),COLORRED;S:IF(卖1>0,HIGH*1.01,NULL),CROSSDOT,LINETHICK3,COLORGREEN;DRAWTEXT(卖1>0,HIGH*1.02,'卖'),COLORGREEN;DRAWICON((ZIGZAG(C,5,1)>REF(ZIGZAG(C,5,1),1)) AND (REF(ZIGZAG(C,5,1),1)<=REF(ZIGZAG(C,5,1),2)) AND (REF(ZIGZAG(C,5,1),2)<=REF(ZIGZAG(C,5,1),3)),LOW*0.98,1) ;DRAWICON((ZIGZAG(C,5,1)<REF(ZIGZAG(C,5,1),1)) AND (REF(ZIGZAG(C,5,1),1)>=REF(ZIGZAG(C,5,1),2)) AND (REF(ZIGZAG(C,5,1),2)>=REF(ZIGZAG(C,5,1),3)),HIGH*1.01,2);ZB:=EMA(EMA(VAR3,5),5)*3, COLORSTICK;VARA:=IF(VAR9 AND CROSS(MA(CLOSE,3),MA(CLOSE,5)),20,0);K:=EMA(VAR7,5)*2,COLORFF00FF;D:=EMA(K,5),COLORWHITE;J:=K*3-D*2,COLORYELLOW;VARB:=BETWEEN(CLOSE,MA(CLOSE,3),MA(CLOSE,5)) AND J>10;HS:=VOL/CAPITAL*100,COLORGREEN;VARE:=MA(100*(CLOSE-LLV(CLOSE,34))/(HHV(HIGH,34)-LLV(LOW,34)),5)-20;VARF:=100-3*SMA((CLOSE-LLV(LOW,75))/(HHV(HIGH,75)-LLV(LOW,75))*100,20,1)+2*SMA(SMA(( CLOSE-LLV(LOW,75))/(HHV(HIGH,75)-LLV(LOW,75))*100,20,1),15,1);DRAWTEXT(VAR11 AND COUNT(VAR11,30)=1,LOW*0.95,'机构进场'),LINETHICK1,COLORFF00FF; VAR1A:=IF(VARE>0,VARE,0);VAR1B:=IF(VAR14>=200 AND VAR13>=150,15,IF(VAR14<=-200 AND VAR13<=-150,-15,VAR16))+60;VAR1C:=VAR1A>48 AND VAR1B>60 AND VAR19<100;DRAWTEXT(VAR1C AND COUNT(VAR1C,30)=1,LOW*0.95,'大顶(底)'),COLORWHITE;。
文华财经期货软件指标公式源码MACD顶底背离指标
DIFF:EMA(CLOSE,7) - EMA(CLOSE,19); DEA:EMA(DIFF,9);FILLRGN(DIFF>DEA,DEA,DIFF,RGB(200,50,55)); FILLRGN(DIFF>DEA,DEA,DIFF,RGB(50,100,10));MACD:2*(DIFF-DEA),COLORSTICK;LC := REF(CLOSE,1);//前一周期收盘价RSI1:=SMA(MAX(CLOSE-LC,0),6,1)/SMA(ABS(CLOSE-LC),6,1)*100;//当根K线收盘价与前一周期收盘价做差,在该差值与0之间取最大值,做N1周期移动平均。
收盘价与前一周期收盘价做差值,取该差值的N1周期移动平均值,两平均值之间做比值。
RSI2:=SMA(MAX(CLOSE-LC,0),12,1)/SMA(ABS(CLOSE-LC),12,1)*100;//当根K线收盘价与前一周期收盘价做差,在该差值与0之间取最大值,做N2周期移动平均。
收盘价与前一周期收盘价做差值,取该差值的N2周期移动平均值,两平均值之间做比值。
RSV:=(CLOSE-LLV(LOW,9))/(HHV(HIGH,9)-LLV(LOW,9))*100;//收盘价与N周期最低值做差,N周期最高值与N周期最低值做差,两差之间做比值。
K:=SMA(RSV,3,1);//RSV的移动平均值D:=SMA(K,3,1);//K的移动平均值J:=3*K-2*D;A1:=BARSLAST(REF(CROSS(DIFF,DEA),1));B1:=REF(C,A1+1)>C AND REF(DIFF,A1+1)<DIFF AND CROSS(DIFF,DEA);A2:=BARSLAST(REF(CROSS(K,D),1));B2:=REF(C,A2+1)>C AND REF(K,A2+1)<K AND CROSS(K,D);A3:=BARSLAST(REF(CROSS(RSI1,RSI2),1));B3:=REF(C,A3+1)>C AND REF(RSI1,A3+1)<RSI1 AND CROSS(RSI1,RSI2); C1:=BARSLAST(REF(CROSS(DEA,DIFF),1));D1:=REF(C,C1+1)<C AND REF(DIFF,C1+1)>DIFF AND CROSS(DEA,DIFF); C2:=BARSLAST(REF(CROSS(D,K),1));D2:=REF(C,C2+1)<C AND REF(K,C2+1)>K AND CROSS(D,K);C3:=BARSLAST(REF(CROSS(RSI2,RSI1),1));D3:=REF(C,C3+1)<C AND REF(RSI1,C3+1)>RSI1 AND CROSS(RSI2,RSI1); STICKLINE(B1>0,-0.1,0,1,0),COLORRED;STICKLINE(B2>0,-0.1,0,1,0),COLORFF00FF;STICKLINE(B3>0,-0.1,0,1,0),COLORYELLOW;STICKLINE(D1>0,0.1,0,1,0),COLOR00FF00;STICKLINE(D2>0,0.1,0,1,0),COLORFFCC66;STICKLINE(D3>0,0.1,0,1,0),COLORWHITE;STICKLINE(MACD>REF(MACD,1) AND MACD>0,0,MACD,0,0),COLORRED; STICKLINE(MACD<=REF(MACD,1) AND MACD>0,0,MACD,0,0),COLORYELLOW; STICKLINE(MACD<REF(MACD,1) AND MACD<0,0,MACD,0,0),COLORCYAN; STICKLINE(MACD>=REF(MACD,1) AND MACD<0,0,MACD,0,0),COLORMAGENTA;STICKLINE(C>0,0,0,50,1),COLORBLUE;MACD底背:IF(B1>0,-0.1,0),COLORRED,POINTDOT; KDJ底背:IF(B2>0,-0.1,0),COLORFF00FF,POINTDOT; RSI底背:IF(B3>0,-0.1,0),COLORYELLOW,POINTDOT; MACD顶背:IF(D1>0,0.1,0),COLOR00FF00,POINTDOT; KDJ顶背:IF(D2>0,0.1,0),COLORFFCC66,POINTDOT; RSI顶背:IF(D3>0,0.1,0),COLORWHITE,POINTDOT;强:IF(DIFF>MA(DIFF,2),DIFF,NULL),COLORRED,LINETHICK2;弱:IF(DEA>MA(DEA,2),DEA,NULL),COLORMAGENTA,LINETHICK2; DRAWICON(CROSS(DIFF,DEA),DEA,5);DRAWICON(CROSS(DEA,DIFF),DEA,27);A:=REF(DIFF,1)<REF(DIFF,2) AND REF(DIFF,2)<REF(DIFF,3) AND DIFF>REF(DIFF,1); B:=REF(DIFF,1)>REF(DIFF,2) AND REF(DIFF,2)>REF(DIFF,3) AND DIFF<REF(DIFF,1);DRAWICON(A,DIFF,1);DRAWICON(B,DIFF,2);STICKLINE1((MACD > 0),0,MACD,0.1,0),COLOR0000CC; STICKLINE1((MACD > 0),0,MACD*0.9,0.1,0),COLOR0000EE; STICKLINE1((MACD > 0),0,MACD*0.8,0.1,0),COLOR0011FF; STICKLINE1((MACD > 0),0,MACD*0.7,0.1,0),COLOR0033FF;STICKLINE1((MACD > 0),0,MACD*0.6,0.1,0),COLOR0055FF; STICKLINE1((MACD > 0),0,MACD*0.5,0.1,0),COLOR0077FF; STICKLINE1((MACD > 0),0,MACD*0.4,0.1,0),COLOR0099FF; STICKLINE1((MACD > 0),0,MACD*0.3,0.1,0),COLOR00BBFF; STICKLINE1((MACD > 0),0,MACD*0.2,0.1,0),COLOR00DDFF; STICKLINE1((MACD > 0),0,MACD*0.1,0.1,0),COLOR00FFFF; STICKLINE1((MACD < 0),0,MACD,0.1,0),COLORCC0033;STICKLINE1((MACD < 0),0,MACD*0.9,0.1,0),COLOREE0033; STICKLINE1((MACD < 0),0,MACD*0.8,0.1,0),COLORFF1133; STICKLINE1((MACD < 0),0,MACD*0.7,0.1,0),COLORFF3333; STICKLINE1((MACD < 0),0,MACD*0.6,0.1,0),COLORFF5533; STICKLINE1((MACD < 0),0,MACD*0.5,0.1,0),COLORFF7733; STICKLINE1((MACD < 0),0,MACD*0.4,0.1,0),COLORFF9933;STICKLINE1((MACD < 0),0,MACD*0.3,0.1,0),COLORFFBB33; STICKLINE1((MACD < 0),0,MACD*0.2,0.1,0),COLORFFDD33; STICKLINE1((MACD < 0),0,MACD*0.1,0.1,0),COLORFFFF33;。
文华期货软件指标公式赢顺云指标源码 MACD金叉死叉
DIF:EMA(CLOSE,12)-EMA(CLOSE,26);DEA:EMA(DIF,9);MACD:(DIF-DEA)*2,COLORSTICK;T:=BARSLAST(CROSS(DIF,DEA) AND DIF<0);T1:=SUMBARS(T=0,2);T2:=SUMBARS(T=0,3);M:=BARSLAST(CROSS(0,MACD));M1:=SUMBARS(M=0,2);M2:=SUMBARS(M=0,3);D1:=REF(DIF,BARSLAST(DIF=LLV(DIF,M+1)));D2:=REF(D1,T1-1);D3:=REF(D2,T1-1);LT:=BARSLAST(L=LLV(L,M+1));MT:=BARSLAST(DIF=LLV(DIF,M+1));L1:=REF(L,LT);L2:=REF(L1,T1-1);L3:=REF(L2,T1-1);XG:=T=0 AND L1<L2 AND L2<L3 AND D1>D2 AND D2>D3;V AR1:BACKSET(XG,T2+REF(MT,T2-1)),NODRAW;V AR2:BACKSET(XG,T1+REF(MT,T1-1)),NODRAW;V AR3:BACKSET(XG,T+REF(MT,T)+1),NODRAW;DRAWLINE1(CROSS(V AR1=1,0.5),DIF,CROSS(V AR2=1,0.5) AND V AR1=1,DIF,0),COLORYELLOW,LINETHICK2;DRAWLINE1(CROSS(V AR2=1,0.5) AND VAR1=1,DIF,V AR1=1 AND V AR2=1 AND CROSS(VAR3=1,0.5),DIF,0),COLORMAGENTA,LINETHICK2;DRAWICON(XG,DIF,4);SHORT:=12;LONG:=26;MID:=9;DIFF:EMA(C,SHORT)-EMA(C,LONG);A1:=BARSLAST(REF(CROSS(0, DEA),1));A2:= BARSLAST(REF(COUNT(DEA<=0,A1+1)=A1+1 AND LLV(DIFF,5)=LLV(DIFF,A1+1) AND CROSS(DIFF,DEA),1));A3:= BARSLAST(REF(CROSS(DIFF,DEA),1));DIBL1:=LLV(C,A3+1)=LLV(C,A1+1) AND NOT(LLV(DIFF,A3+1)=LLV(DIFF,A1+1)) AND COUNT(DEA<=0,A2+1)=A2+1 AND CROSS(DIFF,DEA);金叉:IF(CROSS(DIFF,DEA) AND DEA<=0 AND DIBL1=0,0,DEA),COLORYELLOW;底背离:IF(DIBL1,0,DEA),COLORRED;B1:=BARSLAST(REF(CROSS(DEA,0),1));B2:=BARSLAST(REF(COUNT(DEA>=0,B1+1)=B1+1 AND HHV(DIFF,5)=HHV(DIFF,A1+1) AND CROSS(DEA,DIFF),1));B3:=BARSLAST(REF(CROSS(DEA,DIFF),1));DINGBL1:= HHV(C,B3+1)=HHV(C,B1+1) AND NOT(HHV(DIFF,B3+1)=HHV(DIFF,B1+1)) AND COUNT(DEA>=0,B2+1)=B2+1 AND CROSS(DEA,DIFF);死叉:IF(CROSS(DEA,DIFF) AND DEA>=0 AND DINGBL1=0,0,DEA),COLORFFFF00;顶背离:IF(DINGBL1,0,DEA),COLORGREEN;DIBJG:=LLV(C,A3+1)=LLV(C,A1+1) AND NOT(LLV(DIFF,A3+1)=LLV(DIFF,A1+1)) AND DIFF>REF(DIFF,1) AND COUNT(DEA<=0,A2+1)=A2+1 AND DIFF<DEA ;DINGBJG:=HHV(C,B3+1)=HHV(C,B1+1) AND NOT(HHV(DIFF,B3+1)=HHV(DIFF,B1+1)) AND REF(DIFF,1)>DIFF AND COUNT(DEA>=0,B2+1)=B2+1 AND DIFF>DEA ; STICKLINE(DIBJG =1 ,DEA,DIFF,2,0),COLORRED;STICKLINE(DINGBJG =1 ,DEA,DIFF,2,0),COLORGREEN;MB:=EMA(DIFF,20);UB:=MB+1.9104*STD(DIFF,20);LB:=MB-1.9104*STD(DIFF,20);ZJS:=HHV(DEA,B1+1)/2;ZJX:=LLV(DEA,A1+1)/2;STICKLINE(DEA>DIFF AND DEA>0 AND DEA>ZJS, ZJS,REF(ZJS,1),1,0), COLORRED; STICKLINE(DEA<DIFF AND DEA<0 AND DEA<ZJX,ZJX, REF(ZJX,1),1,0),COLORGREEN;。