文华财经指标代码
文华财经期货软件指标公式源码至尊波段王指标公式源码
/*JJ:=(CLOSE+HIGH+LOW)/3;A:=EMA(JJ,10);B:=REF(A,1);STICKLINE(A>B,A,B,5,0),COLORYELLOW;STICKLINE(A<B,A,B,5,0),COLORBLUE;M1:=EMA(CLOSE,3);M2:=EMA(CLOSE,8);M3:=EMA(M2,13);M4:=EMA(M2,55);VAR1:=EMA(M3,55);M5:=EMA(M4,81), COLORRED,LINETHICK2;VAR2:=(REF(HIGH,1)+REF(LOW,1))/2;VAR3:=MA(CLOSE,21)+2*STD(CLOSE,21);VAR4:=REF(CLOSE,1);VAR5:=SMA(MAX(CLOSE-VAR4,0),7,1)/SMA(ABS(CLOSE-VAR4),7,1)*100;VAR6:=CROSS(79,VAR5);VAR7:=FILTER(VAR6,4);A7:=(2*C+H+L)/4;VAR10:=LLV(LOW,34);VAR11:=HHV(HIGH,34);SK:=EMA((A7-VAR1)/(VAR2-VAR1)*100,7);SD:=EMA(0.667*REF(SK,1)+0.333*SK,5);DRAWTEXT(IF(COUNT(CLOSE<REF(CLOSE,1),8)/8>6/10 AND VOL>=1.5*MA(VOL,5) ANDCOUNT(SK>=SD,3) AND REF(LOW,1)=LLV(LOW,120),1,0),LOW,'买进') ,COLORRED; DRAWTEXT(IF(COUNT(CLOSE<REF(CLOSE,1),13)/13>6/10 ANDCOUNT(SK>SD,6) AND REF(LOW,5)=LLV(LOW,120) AND REF(CLOSE>=OPEN,4) ANDREF(CLOSE>OPEN,3) AND REF(CLOSE>OPEN,2) AND REF(OPEN>CLOSE,1) AND OPEN>REF(CLOSE,1),1,0),LOW,'买进'), COLORRED;D:=MA(CLOSE,80)-MA(CLOSE,10)/3;DRAWTEXT(IF(CLOSE<D AND VOL/240>MA(VOL,5)/240 ANDCLOSE>REF(CLOSE,1)*1.08AND CLOSE<MA(CLOSE,13)*1.3,1,0),LOW,'抄底'),COLORRED;工作线:EMA(CLOSE,18),COLORGREEN,LINETHICK1;B1:=MA(C,1);B2:=SMA(SMA(SMA(B1,2,1),2,1),2,1),COLORCYAN;买入:MA(B2,2),COLORRED;倍量柱:=V/REF(V,1)>1.89;{主图叠加划线}高抛低吸:=STICKLINE((((((HIGH-IF((CLOSE>OPEN),CLOSE,OPEN))/(HIGH-LOW))*VOL)>((ABS ((OPEN-CLOSE))/(HIGH-LOW))*VOL)) AND((((HIGH-IF((CLOSE>OPEN),CLOSE,OPEN))/(HIGH-LOW))*VOL)>(((IF((CLOSE>OPEN),O PEN,CLOSE)-LOW)/(HIGH-LOW))*VOL))),0,(((HIGH-IF((CLOSE>OPEN),CLOSE,OPEN))/( HIGH-LOW))*VOL),2,0);量能平台:STICKLINE(倍量柱 AND FILTER(倍量柱,24) ANDC>O,C,C,400,0),COLORMAGENTA;STICKLINE(倍量柱 AND FILTER(倍量柱,24) AND C>O,C,O,2,0),COLORYELLOW;AA:=MA(C,49);BB:=EMA(C,49);黄金线:(AA+BB)/2,LINETHICK2,COLORYELLOW;N8:=STRCAT(CON2STR(YEAR,0),' 年 ');Y8:=STRCAT(CON2STR(MONTH,0),' 月 ');R8:=STRCAT(CON2STR(DAY,0),' 日 ');SJ8:=STRCAT(STRCAT(N8,Y8), R8);DRAWTEXT_FIX(C>0,0.88,2,0,SJ8),COLOR00FFFF;DRAWTEXT_FIX(ISLASTBAR,0.81,2,2,CODE),COLORMAGENTA;DRAWTEXT_FIX(ISLASTBAR,0.86,2,2,STKNAME),COLORMAGENTA;STICKLINE(C>1.099*REF(C,1),O+(C-O)/2,C,1,0),COLOR00DDFF;STICKLINE(C<0.901*REF(C,1),C,C+(O-C)/2,1,0),COLOR00DDFF;涨停:=IF(REF(C,1)*1.095-C<0.01 ,1,0);DRAWTEXT(涨停,L-0.1,'涨停'),COLORMAGENTA;{高点 1 9999 50低点 1 9999 30 }GD:=CONST(FINDHIGH(H,0,高点*10,1));DD:=CONST(FINDLOW(L,0,低点*10,1));GT:=CONST(BARSLAST(GD=H))+1;DT:=CONST(BARSLAST(DD=L))+1;SH:=CONST(IF(GT=1,H,REF(H,GT-1)));SL:=CONST(IF(DT=1,L,REF(L,DT-1)));CC:=IF(DT>GT,DT,GT);CD:=INTPART(CC-(DT+GT)/2);CG:=IF(高点>CD,CD/2,高点);下跌周期:BARSLAST(GD=H),COLORWHITE,NODRAW;下跌幅:IF(CURRBARSCOUNT<=GT,C/SH*100-100,DRAWNULL),NODRAW,COLORGREEN; 下跌均价:IF(CURRBARSCOUNT<=GT,SUM(AMOUNT,GT)/SUM(V,GT)/100,DRAWNULL),NODRA W,COLORLIGRAY;跌换手%:IF(CURRBARSCOUNT<=GT,SUM(HSL.HSL,GT),DRAWNULL),COLORCYAN,NODRAW; 上涨周期:IF(CURRBARSCOUNT<=DT,BARSLAST(DD=L),DRAWNULL),COLORWHITE,NODRAW; 上涨幅:IF(CURRBARSCOUNT<=DT,C/SL*100-100,DRAWNULL),NODRAW,COLORRED;上涨均价:IF(CURRBARSCOUNT<=DT,SUM(AMOUNT,DT)/SUM(V,DT)/100,DRAWNULL),NODRA W,COLORLIGRAY;涨换手%:IF(CURRBARSCOUNT<=DT,SUM(HSL.HSL,DT),DRAWNULL),COLORLIMAGENTA,NO DRAW;星期:=VARCAT(VARCAT('(',IF(WEEKDAY=1,'一',IF(WEEKDAY=2,'二',IF(WEEKDAY=3,'三',IF(WEEKDAY=4,'四',IF(WEEKDAY=5,'五','')))))),')');日期:=VARCAT('-',VARCAT(VARCAT(VARCAT(VARCAT(VARCAT(VARCAT(VAR2STR(YEAR,0), '年'),VAR2STR(MONTH,0)),'月'),VAR2STR(DAY,0)),'日'),星期));{自动黄金分割普通等系坐标}DRAWRECTREL(990,1,382,1,RGB(250,250,0));DRAWTEXT_FIX(C>0,0.382,0.00,0,'100%'),COLOR00CCCC;DRAWRECTREL(990,188,382,188,RGB(200,200,0));DRAWTEXT_FIX(C>0,0.382,0.189,0,'19.1%'),COLOR00CCCC;DRAWRECTREL(990,375,382,375,RGB(200,200,0));DRAWTEXT_FIX(C>0,0.382,0.376,0,'38.2%'),COLOR00CCCC;DRAWRECTREL(990,491,382,491,RGB(200,200,0));DRAWTEXT_FIX(C>0,0.382,0.492,0,'50.0%'),COLOR00CCCC;DRAWRECTREL(990,607,382,607,RGB(200,200,0));DRAWTEXT_FIX(C>0,0.382,0.608,0,'61.8%'),COLOR00CCCC;DRAWRECTREL(990,794,382,794,RGB(200,200,0));DRAWTEXT_FIX(C>0,0.382,0.795,0,'80.9%'),COLOR00CCCC;DRAWRECTREL(990,982,382,982,RGB(250,250,0));DRAWTEXT_FIX(C>0,0.382,0.936,0,'BASE'),COLOR00CCCC;DRAWRECTREL(990,232,382,232,RGB(100,100,0));DRAWRECTREL(990,144.6,382,144.6,RGB(100,100,0));DRAWRECTREL(990,750,382,750,RGB(100,100,0));DRAWTEXT_FIX(C>0,0.75,0.0,0,'【铭轩881】【趋势为王】'),COLORFF9300; DRAWTEXT_FIX(C>0,0.75,0.08,0,'【交易法则:均线多头排列买入】'),COLORRED;今涨停价:REF(C,1)+REF(C,1)*0.1,COLORRED,NODRAW;明涨停价:C+C*0.1,COLORRED,NODRAW;*/赢:=MA(C,1);在:=SMA(SMA(SMA(赢,2,1),2,1),2,1);龙:=MA(在,3);FILLRGN(龙>在,龙,在,COLORBLUE);FILLRGN(龙<在,龙,在,RGB(231,231,231));DRAWTEXT(CROSS(龙>在,0.5),龙,'空'),COLORYELLOW,FONTSIZE30;DRAWTEXT(CROSS(龙<在,0.5),龙,'多'),COLORRED,FONTSIZE30,VALIGN0;赢在龙头:=(L+H+C*4)/6;工作:=EMA(赢在龙头,12),COLOR00FF00;度假:=EMA(赢在龙头,19);赢在:=(工作-REF(工作,1))/REF(工作,1)*100;龙头:=(度假-REF(度假,1))/REF(度假,1)*100;G:=BARSLAST(CROSS(赢在,0));赢在龙:=REF(赢在龙头,G),COLORWHITE,LINETHICK4;A2:=3*EMA((C-LLV(L,30))/(HHV(H,30)-LLV(L,30))*100,5)-2*EMA((C-LLV(L,30))/(HHV(H,30)-LLV(L,3 0))*100,5);A4:=(HHV(H,34)-C)/(HHV(H,34)-LLV(L,34))*100;A5:=EMA(CLOSE,12)-EMA(CLOSE,26);A6:=EMA(A5,9);A7:=(A5-A6);//IF(赢在>=0,赢在龙,NULL),LINETHICK4,COLORRED;。
文华财经期货软件指标公式源码操盘线高抛低吸指标
EMA250:=MA(C,250);EMA6:=MA(C,6);EMA18:=MA(C,18);EMA55:=MA(C,55);EMA144:=MA(C,144);EMA288:=MA(C,288);中线【买进】:=COUNT(CLOSE<EMA18,5)=4 ANDCLOSE/EMA18>1.004 AND CROSS(CLOSE,EMA18) AND EMA18>=REF(EMA18,1);IF(中线【买进】,40 ,0 );DRAWTEXT(中线【买进】,40,' 中线【买进】'),COLORRED;VL:=REF(LOW,1);GUP12:=(SMA(ABS(LOW-VL),13,1))/(SMA(MAX(LOW-VL,0),13,1))*100;GUP14:=MA(GUP12,13);GUP15:=LLV(LOW,34);GUP18:=EMA(IF(LOW<=GUP15,GUP14,0),3);GUP110:=SMA(SMA((CLOSE-LLV(LOW,54))/(HHV(HIGH,54)-LLV(LOW,54))*100,7,1),5,1);GUP111:=SMA((CLOSE-LLV(LOW,54))/(HHV(HIGH,54)-LLV(LOW,54))*100,7,1)*16.18-GUP110*10.9 ;T:=FILTER(IF(GUP111<=GUP110 AND GUP18>REF(GUP18,1),GUP18*8,0),20);IF(T ,50 ,0 );DRAWTEXT(T,50,'←洗盘完毕'),COLORFF00FF;DRAWTEXT(T,50,'|'),COLORFF00FF;GUP21:=(CLOSE-LLV(LOW,36))/(HHV(HIGH,36)-LLV(LOW,36))*100;GUP22:=SMA(GUP21,3,1);GUP23:=SMA(GUP22,3,1);GUP24:=SMA(GUP23,3,1);GUP25:=CROSS(GUP23,GUP24) AND GUP23<20;IF(FILTER(GUP25,10)=1 ,50 ,0 );DRAWTEXT(FILTER(GUP25,10)=1,60,'←买点'),COLORRED;DRAWTEXT(FILTER(GUP25,10)=1,50,'|'),COLORRED;GUP29:=CROSS(GUP24,GUP23) AND GUP23>80;IF(FILTER(GUP29,5)=1,80 ,100 );DRAWTEXT(FILTER(GUP29,5)=1,80,'←卖点'),COLORBLUE;DRAWTEXT(FILTER(GUP29,5)=1,80,'|'),COLORBLUE;VARV:=(2*C+H+L)/4;VARU:=LLV(LOW,30);VARA1:=HHV(HIGH,30);B:=EMA((VARV-VARU)/(VARA1-VARU)*100,8);B1:=EMA(B,5);STICKLINE1(B-B1>0,B,B1,8,1),COLORRED;STICKLINE1(B-B1<0,B,B1,8,1),COLOR00FF00;LC:=REF(CLOSE,1);RSI:=SMA(MAX(CLOSE-LC,0),6,1)/SMA(ABS(CLOSE-LC),6,1)*100;低吸:IF(CROSS(RSI,11),70,0),COLORWHITE,POINTDOT;STICKLINE(低吸,70,0,4,0),COLORWHITE;AMOUNT:=AVPRICE*V;VAR7:=EMA(AMOUNT/VOL/100,3);VAR8:=EMA(VAR7,88);VAR9:=EMA(VAR7,88)*0.85;VARA:=VAR9*0.87;VARB:=LOW<VARA AND CLOSE>REF(CLOSE,1)*1.02;STICKLINE1(FILTER(VARB,6),65,0,4,0),COLORFF00FF;建仓3层:IF(FILTER(VARB,6),65,0),COLORFF00FF,POINTDOT;VARF:=(2*CLOSE+HIGH+LOW)/4;VA4:=LLV(LOW,34);VA5:=HHV(HIGH,34);VA6:=EMA((VARF-VA4)/(VA5-VA4)*100,6);VA7:=EMA(0.667*REF(VA6,1)+0.333*VA6,4);出击:IF(IF(COUNT(CLOSE<REF(CLOSE,1),8)/8>0.3 AND COUNT(VA6>VA7,3) AND REF(LOW,1)=LLV(LOW,120) ANDCLOSE>OPEN,1,0),60,0),COLORYELLOW,POINTDOT;STICKLINE1(IF(COUNT(CLOSE<REF(CLOSE,1),8)/8>0.3 AND COUNT(VA6>VA7,3) ANDREF(LOW,1)=LLV(LOW,120) AND CLOSE>OPEN,1,0),60,0,4,0),COLORYELLOW;A:=(3*CLOSE+LOW+OPEN+HIGH)/6;D1:=(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*REF(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))/211;D2:=EMA(D1,2);D3:=EMA(D2,2);K1:=EMA(D3,2);补仓位:IF(CROSS(D1,K1),55,0),COLOR0099FF,POINTDOT;STICKLINE1(CROSS(D1,K1),55,0,4,0),COLOR0099FF;多方趋势:=7*SMA((CLOSE-LLV(LOW,27))/(HHV(HIGH,27)-LLV(LOW,27))*30,4,1)-3*SMA(SMA((CLOSE-LLV(LOW,27))/(HHV(HIGH,27)-LLV(LOW,27))*30,4,1),3,1)-SMA(SMA(SMA((CLOSE-LLV(LOW,27))/(HHV(HIGH,27)-LLV(LOW,27))*30,4,1),3,1),2,1);天线:=78.89;STICKLINE1(CROSS(天线,多方趋势),90,95,6,0),COLOR00FF00;VAR1:=REF(CLOSE,2);操盘线: SMA(MAX(CLOSE-VAR1,0),7,1)/SMA(ABS(CLOSE-VAR1),7,1)*100,COLORFFAA66;VAR2:=REF(CLOSE,1);VAR3:=SMA(MAX(CLOSE-VAR2,0),7,1)/SMA(ABS(CLOSE-VAR2),7,1)*100;清仓逃: IF(操盘线< REF(操盘线,1) AND 操盘线>79,操盘线,0);DRAWTEXT(清仓逃,70 ,'★<-清仓逃'),COLORYELLOW,LINETHICK1;DRAWTEXT(88>0 AND REF(O,1)/REF(C,1)>1.04 AND REF(L,1)<=688 AND O>REF(C,1) AND C<REF(O,1) AND C/O>=1.01,L-L*0.02,'★<--波段底初现'),LINETHICK1;DRAWTEXT(C-O>=0 AND O/L>1.05 AND L<=LLV(L,20),L,'★<--波段底'),COLORBLUE,LINETHICK1;H1:=MAX(GETPRICE('YCLOSE'),GETPRICE('HIGH'));L1:=MIN(GETPRICE('YCLOSE'),GETPRICE('LOW'));P1:=H1-L1;阻力:=L1+P1*7/8,COLORGREEN;支撑:=L1+P1*0.5/8,COLORRED;中线:=(支撑+阻力)/2,COLORWHITE,POINTDOT;V11:=3*SMA((C-LLV(L,55))/(HHV(H,55)-LLV(L,55))*100,5,1)-2*SMA(SMA((C-LLV(L,55))/(HHV(H,55) -LLV(L,55))*100,5,1),3,1);趋势线:EMA(V11,3),LINETHICK2,COLORMAGENTA;V12:=(趋势线-REF(趋势线,1))/REF(趋势线,1)*100;STICKLINE(趋势线<11,趋势线,11,5,0),COLORYELLOW;AA:=(趋势线<11) AND FILTER((趋势线<=11),15) AND C<中线;BB0:=REF(趋势线,1)<11 AND CROSS(趋势线,11) AND C<中线;BB1:=REF(趋势线,1)<11 AND REF(趋势线,1)>6 AND CROSS(趋势线,11);BB2:=REF(趋势线,1)<6 AND REF(趋势线,1)>3 AND CROSS(趋势线,6);BB3:=REF(趋势线,1)<3 AND REF(趋势线,1)>1 AND CROSS(趋势线,3);BB4:=REF(趋势线,1)<1 AND REF(趋势线,1)>0 AND CROSS(趋势线,1);BB5:=REF(趋势线,1)<0 AND CROSS(趋势线,0);BB:=BB1=1 OR BB2=1 OR BB3=1 OR BB4=1 OR BB5=1;STICKLINE(BB=1 AND C<中线,11,50,3,0),COLORRED;DRAWICON(BB=1 AND C<中线,55,1);DRAWTEXT(BB0,60,'★买多'),COLORRED;DRAWTEXT(AA,16,'等待底分型'),COLORYELLOW;STICKLINE(趋势线>89,趋势线,89,5,0),COLORWHITE;CC:=(趋势线>89) AND FILTER((趋势线>89),15) AND C>中线;DD0:=REF(趋势线,1)>89 AND CROSS(89,趋势线) AND C>中线;DD1:=REF(趋势线,1)>89 AND REF(趋势线,1)<94 AND CROSS(89,趋势线); DD2:=REF(趋势线,1)>94 AND REF(趋势线,1)<97 AND CROSS(94,趋势线); DD3:=REF(趋势线,1)>97 AND REF(趋势线,1)>99 AND CROSS(97,趋势线); DD4:=REF(趋势线,1)>99 AND REF(趋势线,1)<100 AND CROSS(99,趋势线); DD5:=REF(趋势线,1)>100 AND CROSS(100,趋势线);DD:=DD1=1 OR DD2=1 OR DD3=1 OR DD4=1 OR DD5=1;STICKLINE(DD=1 AND C>中线,89,50,3,0),COLORGREEN;DRAWICON(DD=1 AND C>中线,45,2);DRAWTEXT(DD0,40,'★沽空'),COLORGREEN;DRAWTEXT (CC,84,'等待顶分型'),COLORWHITE;顶:89,COLORGREEN;底:11,COLORRED;中:50,POINTDOT,COLORWHITE;DRAWTEXT(ISLASTBAR,顶,'空'),COLORGREEN;DRAWTEXT(ISLASTBAR,底,'多'),COLORRED;DRAWTEXT(ISLASTBAR,中,'中'),COLORWHITE;。
文华财经指标文华财经期货软件指标多空线指标公式源码
/*DIFF1:=EMA(CLOSE,12)-EMA(CLOSE,26);DEA1:=EMA(DIFF1,9);DRAWBAND(DEA1,DRAWNULL,DIFF1,RGB(250,0,0));DIFF:EMA(CLOSE,12)-EMA(CLOSE,26),COLORYELLOW;DEA:EMA(DIFF,9),COLORCYAN;MACD:2*(DIFF-DEA),COLORSTICK;TR1:=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;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("KDJ.K"(9,3,3),"KDJ.D"(9,3,3)),1));B2:=REF(C,A2+1)>C AND REF("KDJ.K"(9,3,3),A2+1)<"KDJ.K"(9,3,3) ANDCROSS("KDJ.K"(9,3,3),"KDJ.D"(9,3,3));A3:=BARSLAST(REF(CROSS("RSI.RSI1"(6,12,24),"RSI.RSI2"(6,12,24)),1));B3:=REF(C,A3+1)>C AND REF("RSI.RSI1"(6,12,24),A3+1)<"RSI.RSI1"(6,12,24) AND CROSS("RSI.RSI1"(6,12,24),"RSI.RSI2"(6,12,24));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("KDJ.D"(9,3,3),"KDJ.K"(9,3,3)),1));D2:=REF(C,C2+1)<C AND REF("KDJ.K"(9,3,3),C2+1)>"KDJ.K"(9,3,3) ANDCROSS("KDJ.D"(9,3,3),"KDJ.K"(9,3,3));C3:=BARSLAST(REF(CROSS("RSI.RSI2"(6,12,24),"RSI.RSI1"(6,12,24)),1));D3:=REF(C,C3+1)<C AND REF("RSI.RSI1"(6,12,24),C3+1)>"RSI.RSI1"(6,12,24) AND CROSS("RSI.RSI2"(6,12,24),"RSI.RSI1"(6,12,24));C4:=BARSLAST(REF(CROSS(MDI,PDI),1));D4:=REF(C,C+1)<C AND REF(MDI,C4+1)>MDI AND CROSS(MDI,PDI);A4:=BARSLAST(REF(CROSS(PDI,MDI),1));B4:=REF(C,A4+1)>C AND REF(PDI,A4+1)<PDI AND CROSS(PDI,MDI);MACD底背:IF(B1>0,1,0),COLORRED,NODRAW;KDJ底背:IF(B2>0,1,0),COLORFF00FF,NODRAW;RSI底背:IF(B3>0,1,0),COLORYELLOW,NODRAW;DMI底背:IF(B4>0,1,0),COLORBROWN,NODRAW;MACD顶背:IF(D1>0,1,0),COLOR00FF00,NODRAW;KDJ顶背:IF(D2>0,1,0),COLORFFCC66,NODRAW;RSI顶背:IF(D3>0,1,0),COLORWHITE,NODRAW;DMI顶背:IF(D4>0,1,0),COLORLIRED,NODRAW;{DRAWLINE(A1=0,DEA,MACD底背,DEA,0),COLORRED,LINETHICK2;DRAWLINE(A2=0,DEA,MACD顶背,DEA,0),COLOR00FF00,LINETHICK2;}STICKLINE(B1>0,-0.1,0,2,0),COLORRED;STICKLINE(B2>0,-0.1,-0.2,2,0),COLORFF00FF;STICKLINE(B3>0,-0.1,0,2,0),COLORYELLOW;STICKLINE(B4>0,-0.1,-0.2,2,0),COLORBROWN;STICKLINE(D1>0,0.1,0,2,0),COLOR00FF00;STICKLINE(D2>0,0.1,0.2,2,0),COLORFFCC66;STICKLINE(D3>0,0.1,0,2,0),COLORWHITE;STICKLINE(D4>0,0.1,0.2,2,0),COLORLIRED;SQX:=(C-MA(CLOSE,13))*100;DIF:EMA(MA(SQX,7),1),LINETHICK1;DEA:EMA(DIF,7),LINETHICK1;MACD: (DIF-DEA)*2,COLORSTICK;红柱持股:IF(MACD>REF(MACD,1),MACD,DRAWNULL),STICK,COLORRED,LINETHICK3;绿柱持币:IF(MACD<REF(MACD,1),MACD,DRAWNULL),STICK,COLORGREEN,LINETHICK3; 低位金叉:IF(CROSS(DIF,DEA) AND DIF<-0.1,0.3,0),COLORYELLOW,POINTDOT; STICKLINE(低位金叉,0,10,8,1),COLORYELLOW;DRAWICON(低位金叉,0.3,1);JCCOUNT:=COUNT(CROSS(DIF,DEA),BARSLAST(DEA>=0));二次金叉:IF(CROSS(DIF,DEA) AND DEA<0 ANDCOUNT(JCCOUNT=2,21)=1,0.2,0),COLORFF00FF,POINTDOT;STICKLINE(二次金叉,25,15,8,1),COLORFF00FF;A1:=BARSLAST(REF(CROSS(DIF,DEA),1));底背离:IF(REF(CLOSE,A1+1)>CLOSE AND DIF>REF(DIF,A1+1) ANDCROSS(DIF,DEA),0.1,0),COLORRED,POINTDOT;STICKLINE(底背离,40,30,8,1),COLORMAGENTA;DRAWLINE(A1=0,DEA,底背离,DEA,0),COLORMAGENTA,LINETHICK3;A2:=BARSLAST(REF(CROSS(DEA,DIF),1));顶背离:REF(CLOSE,A2+1)<CLOSE AND REF(DIF,A2+1)>DIF ANDCROSS(DEA,DIF),COLORGREEN;DRAWLINE(A2=0,DEA,顶背离,DEA,0),COLORBLUE,LINETHICK3;A3:=CROSS(DIF,DEA) AND DEA<0;零下二次金叉:IF(FILTER(COUNT(A3,21)=2,10),0.05,0),COLORWHITE,POINTDOT; STICKLINE(零下二次金叉,45,55,8,1),COLORWHITE;金叉:DRAWICON(CROSS(DIF,DEA),DIF,1);死叉:DRAWICON(CROSS(DEA,DIF),DIF,2);{MACD底背离选股公式}DIFF:=EMA(CLOSE,12)-EMA(CLOSE,26);DEA:=EMA(DIFF,9),;A1:=BARSLAST(REF(CROSS(DIFF,DEA),1));XG:REF(C,A1+1)>C AND REF(DIFF,A1+1)<DIFF AND CROSS(DIFF,DEA);*/N:=120;CURRBARSCOUNT:=DATACOUNT-BARPOS+1;K:=BARSLAST(CURRBARSCOUNT=N);GD:=REFX1(IF(ISLASTBAR=1,HHV(H,K),0),10000),NODRAW;{高点}DD:=REFX1(IF(ISLASTBAR=1,LLV(L,K),0),10000),NODRAW;{低点}KJ:=GD-DD;//{高低点差值=分区高度}GD4:=IF(CURRBARSCOUNT<=N/2,GD,NULL);高区:IF(CURRBARSCOUNT<=N,GD,NULL),COLORRED,LINETHICK2,NODRAW;低区:IF(CURRBARSCOUNT<=N,DD,NULL),COLOR00FF00,LINETHICK2,NODRAW;平衡:=IF(CURRBARSCOUNT<=N,DD+KJ/2,NULL),COLOR00FFFF,NODRAW;低:IF(CURRBARSCOUNT<=N/2,DD,NULL),COLORFFFF00;高:IF(CURRBARSCOUNT<=N/2,GD,NULL),COLOR00FFFF;支撑:IF(CURRBARSCOUNT<=N/2,DD+KJ*0.191,NULL),COLOR00FFFF;第一防线:REFX1(低,10000),DOT,COLORYELLOW,NODRAW;第二防线:REFX1(支撑,10000),DOT,COLORWHITE,NODRAW;今日保护价:(REF(C,2)+REF(C,1)+O)/3 ,COLORCC3299;CC:IF(CURRBARSCOUNT<18,REFX1(REF(C,1),10000),NULL),COLOR000000,NODRAW;止赢:1.05*CC,COLORMAGENTA,LINETHICK2;DRAWTEXT(ISLASTBAR,止赢,'止赢'),LINETHICK2;止损:0.97*CC,COLORYELLOW,LINETHICK2;DRAWTEXT(ISLASTBAR,止损,'止损'),LINETHICK2;DRAWNUMBER1(ISLASTBAR ,C,C,2),COLORWHITE;MAA10:=MA(C,10);MAA30:MA(C,30),COLORRED;KS:IF(MAA10>MAA30,MAA10,MAA30),COLORBLUE;A3:=(C-LLV(L,9))/(HHV(H,9)-LLV(L,9))*100;A4:=SMA(A3,3,1);A5:=SMA(A4,3,1);A6:=3*A4-2*A5;A7:=C-REF(C,1);A8:=100*EMA(EMA(A7,6),6)/EMA(EMA(ABS(A7),6),6);买:=LLV(A8,2)=LLV(A8,7) AND COUNT(A8<0,2) AND CROSS(A8,MA(A8,2)); DRAWTEXT(FILTER(买=1,5),LOW-0.05,'跟庄买进'),COLORYELLOW; STICKLINE1(买,OPEN,CLOSE,2,0),COLORYELLOW;。
文华财经期货软件指标公式源码期货傻瓜式买卖指标
文华财经期货软件指标公式源码期货傻瓜式买卖指标以下是一个用Python编写的期货买卖指标的示例代码,包含了几个常见的指标公式:```pythonimport pandas as pdfrom talib.abstract import *#读取期货数据data = pd.read_csv('futures_data.csv')#计算技术指标data['macd'], data['macdsignal'], data['macdhist'] = MACD(data, fastperiod=12, slowperiod=26, signalperiod=9) #生成买卖信号data['buy_signal'] = (data['sma_5'] > data['sma_10']) & (data['rsi_14'] < 30) & (data['macd'] > data['macdsignal']) data['sell_signal'] = (data['sma_5'] < data['sma_10']) ,(data['rsi_14'] > 70) , (data['macd'] < data['macdsignal']) #模拟交易position = 0 # 仓位for i in range(len(data)):if data['buy_signal'][i]:if position == 0: # 无仓位,买入position = 1entry_price = data['close'][i]print(f"买入:{entry_price}")elif data['sell_signal'][i]:if position == 1: # 有仓位,卖出position = 0exit_price = data['close'][i]pnl = (exit_price - entry_price) / entry_priceprint(f"卖出:{exit_price},盈亏:{pnl}")#输出结果print(data)```在这个示例代码中,我们使用了Pandas库来读取期货数据,并使用了TALib库来计算一些常见的技术指标,如简单移动平均(SMA)、相对强弱指标(RSI)、移动平均收敛/发散指标(MACD)和布林带(BBANDS)。
文华财经指标文华财经期货软件指标压力支撑指标公式源码
/*MA5:MA(C,5)LINETHICK3,COLOR00CCFF;MA10:=MA(C,10);MA20:=MA(C,20);MA30:=MA(C,30);五日乖离率:=(C-MA5)/MA5*100;BB5:=ATAN((MA5/REF(MA5,1)-1)*100)*180/3.1416;速度5:=SMA(EMA((MA5-REF(MA5,1))/REF(MA5,1),3)*100,3,1);加速度5:=EMA((速度5-REF(速度5,1)),3),NODRAW;IF(BB5>30 AND MA5>REF(MA5,1), MA5,DRAWNULL),LINETHICK3,COLORRED;BB10:=ATAN((MA10/REF(MA10,1)-1)*100)*180/3.1416;IF(BB5<0 AND MA5<REF(MA5,1), MA5,DRAWNULL),LINETHICK3,COLORGREEN;三拾日乖离率:=(C-MA30)/MA30*100,NODRAW;VAR1:=(MA20-MA30)>REF((MA20-MA30),1) AND MA20>REF(MA20,1) ANDMA30>REF(MA30,1);VAR2:=(MA30-MA20)<REF((MA30-MA20),1) AND MA20<REF(MA20,1) ANDMA30<REF(MA30,1);BB30:=ATAN((MA30/REF(MA30,1)-1)*100)*180/3.1416;强势狙击:=FILTER(BB30>30 AND BB10>45 AND CROSS(BB5,60),10);加仓:=FILTER(COUNT(CROSS(BB5,30),5)>=1 AND MA5>REF(MA5,1) AND 三拾日乖离率>REF(三拾日乖离率,1) AND MA10>REF(MA10,1)AND 加速度5>REF(加速度5,1) AND 速度5>REF(速度5,1),10);清仓:=FILTER(COUNT(CROSS(30,BB5),5)>=1 AND (C>MA30 OR O>MA30) ANDMA5<REF(MA5,1) AND 三拾日乖离率<REF(三拾日乖离率,1) ANDMA10<REF(MA10,1),10);DRAWTEXT(加仓 ,LOW*0.98,'←加仓'),COLORYELLOW;JC:=CROSS(0,五日乖离率) AND 三拾日乖离率<REF(三拾日乖离率,1) ANDMA10>REF(MA10,1) ;减仓:=FILTER(JC,10);MR:=COUNT(CROSS(五日乖离率,0),3)>=1 AND 三拾日乖离率>REF(三拾日乖离率,1)AND MA5>REF(MA5,1) AND (C/REF(C,1)-1)*100>5 AND REF(C,1)<MA30;买入:=FILTER(MR,10);MA5:MA(C,5)LINETHICK3,COLOR00CCFF;MA10:=MA(C,10);MA20:=MA(C,20);MA30:=MA(C,30);五日乖离率:=(C-MA5)/MA5*100;BB5:=ATAN((MA5/REF(MA5,1)-1)*100)*180/3.1416;速度5:=SMA(EMA((MA5-REF(MA5,1))/REF(MA5,1),3)*100,3,1);加速度5:=EMA((速度5-REF(速度5,1)),3),NODRAW;IF(BB5>30 AND MA5>REF(MA5,1), MA5,DRAWNULL),LINETHICK3,COLORRED;BB10:=ATAN((MA10/REF(MA10,1)-1)*100)*180/3.1416;IF(BB5<0 AND MA5<REF(MA5,1), MA5,DRAWNULL),LINETHICK3,COLORGREEN;三拾日乖离率:=(C-MA30)/MA30*100,NODRAW;VAR1:=(MA20-MA30)>REF((MA20-MA30),1) AND MA20>REF(MA20,1) ANDMA30>REF(MA30,1);VAR2:=(MA30-MA20)<REF((MA30-MA20),1) AND MA20<REF(MA20,1) ANDMA30<REF(MA30,1);BB30:=ATAN((MA30/REF(MA30,1)-1)*100)*180/3.1416;强势狙击:=FILTER(BB30>30 AND BB10>45 AND CROSS(BB5,60),10);加仓:=FILTER(COUNT(CROSS(BB5,30),5)>=1 AND MA5>REF(MA5,1) AND 三拾日乖离率>REF(三拾日乖离率,1) AND MA10>REF(MA10,1)AND 加速度5>REF(加速度5,1) AND 速度5>REF(速度5,1),10);清仓:=FILTER(COUNT(CROSS(30,BB5),5)>=1 AND (C>MA30 OR O>MA30) ANDMA5<REF(MA5,1) AND 三拾日乖离率<REF(三拾日乖离率,1) ANDMA10<REF(MA10,1),10);DRAWTEXT(加仓 ,LOW*0.98,'←加仓'),COLORYELLOW;JC:=CROSS(0,五日乖离率) AND 三拾日乖离率<REF(三拾日乖离率,1) ANDMA10>REF(MA10,1) ;减仓:=FILTER(JC,10);MR:=COUNT(CROSS(五日乖离率,0),3)>=1 AND 三拾日乖离率>REF(三拾日乖离率,1) AND MA5>REF(MA5,1) AND (C/REF(C,1)-1)*100>5 AND REF(C,1)<MA30;买入:=FILTER(MR,10);DRAWTEXT(减仓,HIGH*1.02,'←风险'),COLORCYAN;DRAWTEXT(买入,LOW*0.98,'←买入'),COLORYELLOW;DRAWTEXT(清仓 ,HIGH*1.02,'←清仓'),COLORGREEN;DRAWTEXT(强势狙击,LOW*0.95,'←狙击'),COLORYELLOW;VAR21:=MAX(ABS(HIGH-AMOUNT/VOL/100),ABS(AMOUNT/VOL/100-LOW));VAR3:=ABS((OPEN+CLOSE)/2-AMOUNT/VOL/100);MV:=(VAR21+VAR3)/AMOUNT*VOL*100*50;压力:MA(REF(HHV(C,30),1),2),COLOR9DFFFF;支撑:MA(REF(LLV(C,30),1),2),COLORABFF46;DRAWTEXT(减仓,HIGH*1.02,'←风险'),COLORCYAN;DRAWTEXT(买入,LOW*0.98,'←买入'),COLORYELLOW;DRAWTEXT(清仓 ,HIGH*1.02,'←清仓'),COLORGREEN;DRAWTEXT(强势狙击,LOW*0.95,'←狙击'),COLORYELLOW;VAR21:=MAX(ABS(HIGH-AMOUNT/VOL/100),ABS(AMOUNT/VOL/100-LOW));VAR3:=ABS((OPEN+CLOSE)/2-AMOUNT/VOL/100);MV:=(VAR21+VAR3)/AMOUNT*VOL*100*50;压力:MA(REF(HHV(C,30),1),2),COLOR9DFFFF;支撑:MA(REF(LLV(C,30),1),2),COLORABFF46;*/VAR1:=(LOW+HIGH+CLOSE+O)/4;操作:MA(VAR1,5),COLOR00FFFF,LINETHICK2;拉升:HHV(操作,13),COLORFF00FF;买卖:LLV(操作,13),COLOR00FFFF;压力:HHV(操作,60),COLORFF6600;支撑:LLV(LOW,60)*1.02,COLOR00FF00,LINETHICK2;顶部:HHV(HIGH,60)*0.98,COLORFFFF00,LINETHICK2;涨:IF(MA(VAR1,5)>REF(MA(VAR1,5),1),MA(VAR1,5),NULL),COLORRED,LINETHICK2;平:IF(MA(VAR1,5)=REF(MA(VAR1,5),1),MA(VAR1,5),NULL),COLOR00FFFF,LINETHICK3;跌:IF(MA(VAR1,5)<REF(MA(VAR1,5),1),MA(VAR1,5),NULL),COLORGREEN,LINETHICK2; DRAWTEXT(C-O>=0 AND O/L>1.05 AND L<=LLV(L,30),L,'★<--极品绝底'), LINETHICK1;DIFF := EMA(CLOSE,12) - EMA(CLOSE,26);DEA := EMA(DIFF,9);MACD:=2*(DIFF-DEA),COLORSTICK;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,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 AND REF(DIFF,BARSLAST(REF(CROSS(DIFF,DEA),1))+1)<DIFF AND CROSS(DIFF,DEA)>0,L-0.02,'★M'),COLOR00FFFF;DRAWTEXT(REF(C,BARSLAST(REF(CROSS(K,D),1))+1)>C AND REF(K,BARSLAST(REF(CROSS(K,D),1))+1)<K AND CROSS(K,D),L-0.10,'◎K'),COLORFF00FF; DRAWTEXT(REF(C,BARSLAST(REF(CROSS(RSI1,RSI2),1))+1)>C AND REF(RSI1,BARSLAST(REF(CROSS(RSI1,RSI2),1))+1)<RSI1 AND CROSS(RSI1,RSI2)>0,L-0.18,'◆R'),COLOR0000FF;DRAWTEXT(REF(C,BARSLAST(REF(CROSS(DEA,DIFF),1))+1)<C AND REF(DIFF,BARSLAST(REF(CROSS(DEA,DIFF),1))+1)>DIFF AND CROSS(DEA,DIFF)>0,H+0.16,'★M'),COLOR00FF00;DRAWTEXT(REF(C,BARSLAST(REF(CROSS(D,K),1))+1)<C ANDREF(K,BARSLAST(REF(CROSS(D,K),1))+1)>K AND CROSS(D,K)>0,H+0.08,'◎K'),COLORFFFFCC; DRAWTEXT(REF(C,BARSLAST(REF(CROSS(RSI2,RSI1),1))+1)<C AND REF(RSI1,BARSLAST(REF(CROSS(RSI2,RSI1),1))+1)>RSI1 AND CROSS(RSI2,RSI1)>0,H+0.04,'◆R'),COLORFF9900;。
文华财经指标代码
文华财经指标代码
1、文华财经指数(WSE):它是由文华财经公司推出的一个指数,反
映华尔街的行情,用以大致反映市场的总体情况和未来走向。
文华财经指
数的代码为WSE。
2、文华财经投资者保护指标(IPPI):它是文华财经公司推出的指标,用于帮助投资者评估投资风险,以便更好地保护投资者的财富。
文华
财经投资者保护指标的代码为IPPI。
3、文华财经区域财富指标(RWFI):它是文华财经公司推出的指标,用来衡量一个地区的经济状况和对外贸易的状况,用来帮助投资者判断一
个地区的投资机会和投资风险。
文华财经区域财富指标的代码为RWFI。
4、文华财经国际金融指标(IFFI):它是文华财经公司推出的指标,用以衡量国际金融市场的稳定性,并帮助投资者判断投资国际金融市场的
机会和投资风险。
文华财经国际金融指标的代码为IFFI。
5、文华财经技术分析指标(TAPI):它是文华财经公司推出的指标,用来衡量技术分析投资策略的效率,帮助投资者在投资过程中作出更明智
的决策。
文华财经技术分析指标的代码为TAPI。
6、文华财经市场情绪指标(MSEI):它是文华财经公司推出的指标。
文华财经期货软件指标公式源码期货指标赢顺云指标文华指标破解
MA5:=MA(CLOSE,5);MA10:=MA(CLOSE,10);MA20:=MA(CLOSE,20);MA30:=MA(CLOSE,30);MA60:=MA(CLOSE,60);MA120:=MA(CLOSE,120);HIGHN:=10;LOWN:=10;HIGHDISPLAY:=0;LOWDISPLAY:=0;ZGDISPLAY:=0;MADISPLAY:=0;AA:=REF(H,HIGHN)=HHV(H,2*HIGHN+1);QY:=BACKSET(AA,HIGHN+1);CC:=FILTER(QY,HIGHN) AND H=HHV(H,HIGHN+1);DDD:=BARSLAST(CC);CURRBARSCOUNT:=DATACOUNT-BARPOS;GDTS:=IF(CC,CURRBARSCOUNT,0);DINGBU:=IF(DDD,REF(H,DDD),H);{顶部}DINGBUTS:=IF(DDD,REF(GDTS,DDD),GDTS);DINGBU1:=REF(DINGBU,DDD+1);GDCS1:=REFX1(DINGBUTS,10000);DINGBUTS1:=REF(DINGBUTS,DDD+1);GDCS2:=REFX1(DINGBUTS1,10000);DINGBU2:=REF(DINGBU1,DDD+1);MM:=IF(CURRBARSCOUNT>GDCS2,0,1);高点压力:TRENDLINES(CURRBARSCOUNT=GDCS2,H,CURRBARSCOUNT=GDCS1,H),COLORGREEN,DOT; DRAWHORIZONTALLINE(CURRBARSCOUNT=GDCS1,H,COLORLIGHTGREY),POINTDOT; DRAWHORIZONTALLINE(CURRBARSCOUNT=GDCS2,H,COLORLIGHTGREY),POINTDOT;AA1:=REF(L,LOWN)=LLV(L,2*LOWN+1);QY1:=BACKSET(AA1,LOWN+1);CC1:=FILTER(QY1,LOWN) AND L=LLV(L,LOWN+1);DD1:=BARSLAST(CC1);DDTS:=IF(CC1,CURRBARSCOUNT,0);YDB:=IF(DD1,REF(L,DD1),L);DDTS1:=IF(DD1,REF(DDTS,DD1),DDTS);DDCS1:=REFX1(DDTS1,10000);ZDB:=REF(YDB,DD1+1);DDTS2:=REF(DDTS1,DD1+1);DDCS2:=REFX1(DDTS2,10000);低点支撑:TRENDLINES(CURRBARSCOUNT=DDCS2,L,CURRBARSCOUNT=DDCS1,L),COLORRED,DOT; ZGSTAR:=(高点压力+低点支撑)/2;ZGEND:=REFX1((高点压力+低点支撑)/2,10000);STARDAY:=IF(DDCS2<GDCS2,DDCS2,GDCS2);DRAWHORIZONTALLINE(CURRBARSCOUNT=DDCS1,L,COLORLIGHTGREY),POINTDOT; DRAWHORIZONTALLINE(CURRBARSCOUNT=DDCS2,L,COLORLIGHTGREY),POINTDOT;G:=MA(C,5);D:=MA(C,10);NNH:=BARSLAST(H=HHV(H,7)) ,NODRAW;NNL:=BARSLAST(L=LLV(L,7)) ,NODRAW;NN:=IF(REF(G,NNH)>REF(D,NNH) AND NNH<=4,NNH,IF(REF(G,NNL)<REF(D,NNL) AND NNL<=4,NNL,5)) ,NODRAW;N:=IF(ISLASTBAR AND NN>0,NN,5) ,NODRAW;HH:=REF(H,N)=HHV(H,6);LL:=REF(L,N)=LLV(L,6);FG01:BACKSET(HH,N+1)>BACKSET(HH,N),NODRAW;FD01:BACKSET(LL,N+1)>BACKSET(LL,N) ,NODRAW;FG02:=FG01=FD01 AND G>D,NODRAW;FD02:FG01=FD01 AND G<D,NODRAW;TTTT:BARSLAST(FD01),NODRAW;FG0:=FG01 AND IF(FG02=1,H=HHV(H,BARSLAST(REF(FD01,1))+1),H=HHV(H,IF(BARSLAST(L=LLV(L,7))>=5,5,BARSLA ST(FD01)))) AND FD02=0 ,NODRAW;FD0:=FD01 ANDIF(FD02=1,L=LLV(L,BARSLAST(REF(FG01,1))+1),L=LLV(L,IF(BARSLAST(H=HHV(L,7))>=5,5,BARSLAST( FG01)))) AND FG02=0 ,NODRAW;GT:BARSLAST(FG0),NODRAW;DT:BARSLAST(FD0),NODRAW;LLLL:DT=0 AND REF(DT,1)<GT AND L>REF(L,REF(DT,1)+1),NODRAW;FG1:BACKSET(REFX(GT,1)=0 AND GT<DT AND REFX(H,1)>=REF(H,GT),GT+1),NODRAW;FD1:BACKSET(REFX(DT,1)=0 AND DT<GT AND REFX(L,1)<=REF(L,DT),DT+1),NODRAW;FG11:IF(GT=0 AND REF(GT,1)<DT AND IF(REF(G,BARSLAST(L=LLV(L,7)))>REF(D,BARSLAST(L=LLV(L,7))),BARSLAST(L=LLV(L,7))<5,1) AND H<REF(H,REF(GT,1)+1),1,0),NODRAW;FD11:IF(DT=0 AND REF(DT,1)<GT AND IF(REF(G,BARSLAST(H=HHV(H,7)))<REF(D,BARSLAST(H=HHV(H,7))),BARSLAST(H=HHV(H,7))<5,1) AND L>REF(L,REF(DT,1)+1),1,0),NODRAW;GT1:BARSLAST(FG11<>1 AND FG1<>1 AND FG0),NODRAW;DT1:BARSLAST(FD11<>1 AND FD1<>1 AND FD0),NODRAW;FD2:BACKSET(REFX(GT1,1)=0 AND DT1<3 AND GT1-DT1<4 AND REF(L,DT1)>LLV(L,GT1+5),DT1+1),NODRAW;FG2A:BACKSET(REFX(GT1,1)=0 AND DT1<3 AND GT1-DT1<4 AND REF(L,DT1)<=LLV(L,GT1+5) AND REF(H,GT1)>HHV(H,GT1+5),GT1+1),NODRAW;FG2B:IF(GT1=0 AND DT1<4 AND REF(GT1,1)-DT1<4 AND REF(L,DT1)<=LLV(L,REF(GT1,1)+6) AND H>HHV(H,REF(GT1,1)+6),1,0),NODRAW;FG2:BACKSET(REFX(DT1,1)=0 AND GT1<3 AND DT1-GT1<4 AND REF(H,GT1)<HHV(H,DT1+5),GT1+1),NODRAW;FD2A:BACKSET(REFX(DT1,1)=0 AND GT1<3 AND DT1-GT1<4 AND REF(H,GT1)>=HHV(L,DT1+5) AND REF(L,DT1)>LLV(L,DT1+5),DT1+1),NODRAW;FD2B:IF(DT1=0 AND GT1<4 AND REF(DT1,1)-GT1<4 AND REF(H,GT1)>=HHV(H,REF(DT1,1)+6) AND L>LLV(L,REF(DT1,1)+6),1,0),NODRAW;TTTTTT: H<REF(H,REF(GT1,1)+1) AND DT1<4,NODRAW;HHHHHH:REF(LLV(L,10),DT1),NODRAW;FG21:IF(GT1=0 AND DT1<4 AND H<=REF(H,REF(GT1,1)+1) ,1,0),NODRAW;FD21:IF(DT1=0 AND GT1<4 AND L>=REF(L,REF(DT1,1)+1) ,1,0),NODRAW;FD231:BACKSET(REFX(GT1,1)=0 AND DT1>3 AND GT1>DT1 AND GT1-DT1<4 AND REFX(H,1)>REF(H,GT1) AND REF(L,DT1)>REF(LLV(L,10),DT1),DT1+1),NODRAW;FG23:BACKSET(REFX(GT1,1)=0 AND DT1>3 AND GT1>DT1 AND GT1-DT1<4 AND REFX(H,1)>REF(H,GT1) AND (REF(H,GT1)<REF(HHV(H,13),GT1) OR REF(FD231,DT1)=0),GT1+1),NODRAW;FG231:BACKSET(REFX(DT1,1)=0 AND GT1>3 AND DT1>GT1 AND DT1-GT1<4 AND REFX(L,1)<REF(L,DT1) AND REF(H,GT1)<REF(HHV(H,10),GT1) ,GT1+1),NODRAW;FD23:BACKSET(REFX(DT1,1)=0 AND GT1>3 AND DT1>GT1 AND DT1-GT1<4 AND REFX(L,1)<REF(L,DT1) AND ( REF(L,DT1)>REF(LLV(L,13),DT1) OR REF(FG231,GT1)=0),DT1+1),NODRAW;FDD23:REF(H,GT1)<REF(HHV(H,10),GT1) OR REF(FD23,DT1)=0,NODRAW;FD24:BACKSET(REFX(GT1,1)=0 AND DT1>3 AND GT1>DT1 AND GT1-DT1<4 AND REFX(H,1)<HHV(H,GT1+3) AND REF(L,DT1)>LLV(L,DT1+5),DT1+1),NODRAW;FG24:BACKSET(REFX(DT1,1)=0 AND GT1>3 AND DT1>GT1 AND DT1-GT1<4 AND REFX(L,1)>LLV(L,DT1+3) AND REF(H,GT1)<HHV(H,GT1+5),GT1+1),NODRAW;GT2:BARSLAST(FG21<>1 AND FG23<>1 AND FG231<>1 AND FG24<>1 AND FG2<>1 AND FG2A<>1 AND FG2B<>1 AND GT1=0),NODRAW;DT2:BARSLAST(FD21<>1 AND FD23<>1 AND FD231<>1 AND FD24<>1 AND FD2<>1 AND FD2A<>1 AND FD2B<>1 AND DT1=0),NODRAW;FG3:BACKSET(REFX(GT2,1)=0 AND GT2<DT2 AND REFX(H,1)>=REF(H,GT2),GT2+1),NODRAW;FD3:BACKSET(REFX(DT2,1)=0 AND DT2<GT2 AND REFX(L,1)<=REF(L,DT2),DT2+1),NODRAW;FG31:IF(GT2=0 AND REF(GT2,1)<DT2 AND H<REF(H,REF(GT2,1)+1),1,0),NODRAW;FD31:IF(DT2=0 AND REF(DT2,1)<GT2 AND L>REF(L,REF(DT2,1)+1),1,0),NODRAW;GT3:BARSLAST(GT2=0 AND FG3<>1 AND FG31<>1 ),NODRAW;DT3:BARSLAST(DT2=0 AND FD3<>1 AND FD31<>1),NODRAW;FG4:BACKSET(REFX(GT3,1)=0 AND GT3<DT3 AND REFX(H,1)>=REF(H,GT3),GT3+1),NODRAW;FD4:BACKSET(REFX(DT3,1)=0 AND DT3<GT3 AND REFX(L,1)<=REF(L,DT3),DT3+1),NODRAW;FG41:IF(GT3=0 AND REF(GT3,1)<DT3 AND H<REF(H,REF(GT3,1)+1),1,0),NODRAW;FD41:IF(DT3=0 AND REF(DT3,1)<GT3 AND L>REF(L,REF(DT3,1)+1),1,0),NODRAW;HHH:=GT3=0 AND FG31<>1 AND FG3<>1,NODRAW;LLL:=DT3=0 AND FD31<>1 AND FD3<>1,NODRAW;DRAWLINE1(HHH ,H,LLL,L,0),COLORYELLOW,LINETHICK1;DRAWLINE1(LLL,L,HHH ,H,0),COLORYELLOW,LINETHICK1;PARTLINE1(FG0 ,H),COLORGREEN,POINTDOT,LINETHICK2;PARTLINE1(FD0 ,L),COLORCYAN,CIRCLEDOT,LINETHICK2;笔周期:=10;半分位:=50;画趋势:=1;涨停位:=50;时间:=1;日线:=IF(PERIOD=5,1,0);CA3:=REF(C,1)*日线;A1:=REF(H,3)=HHV(H,笔周期*3+1)*1;B1:=FILTER(A1,3);C1:=BACKSET(B1,3+1);D1:=FILTER(C1,3);{高点}A2:=REF(L,3)=LLV(L,笔周期*3+1)*1;B2:=FILTER(A2,3);C2:=BACKSET(B2,3+1);D2:=FILTER(C2,3);{低点}E1:=(REF(LLV(L,2*3),1)+REF(HHV(H,2*3),1))/2;E2:=(H+L)/2;H1:=(D1 AND NOT(D2 AND E1>=E2)) OR BARSTATUS=2 OR BARSCOUNT(C)=1;H2:=D1 AND NOT(D2 AND E1>=E2);L1:=D2 AND NOT(D1 AND E1=E2);X1:=REF(BARSLAST(H1),1)+1;F1:=BACKSET(H1 AND COUNT(L1,X1)>0,LLVBARS(IF(L1,L,100000),X1)+1);G1:=F1>REF(F1,1);I1:=BACKSET(G1,1);LD:=I1>REF(I1,1);L2:=LD OR BARSTATUS=2 OR BARSCOUNT(C)=1;X2:=REF(BARSLAST(L2),1)+1;F2:=BACKSET(L2 AND COUNT(H2,X2)>0,HHVBARS(IF(H2,H,0),X2)+1);G2:=F2>REF(F2,1);I2:=BACKSET(G2,1);HD:=I2>REF(I2,1);DRAWLINE3(LD,REF(H,BARSLAST(HD)),BARSLAST(HD),HD,REF(L,BARSLAST(LD)),BARSLAST(LD),0),C OLORGREEN,LINETHICK3;DRAWLINE3(HD,REF(L,BARSLAST(LD)),BARSLAST(LD),LD,REF(H,BARSLAST(HD)),BARSLAST(HD),0),C OLORRED,LINETHICK3;J1:=BACKSET(ISLASTBAR,MIN(BARSLAST(HD),BARSLAST(LD))+1);J2:=J1>REF(J1,1);A3:=H;B3:=REF(H,REF(BARSLAST(HD),1)+1)>REF(H,REF(BARSLAST(HD),1)+2+REF(BARSLAST(HD),REF(BAR SLAST(HD),1)+2));D3:=A3 AND B3 AND HD;E3:=BACKSET(D3,REF(BARSLAST(HD),1)+2);HH8:=E3>REF(E3,1);A4:=L>REF(L,REF(BARSLAST(LD),1)+1);B4:=REF(L,REF(BARSLAST(LD),1)+1);D4:=A4 AND B4 AND LD;E4:=BACKSET(D4,REF(BARSLAST(LD),1)+2);LL8:=E4>REF(E4,1);H3:=HH8 OR BARSTATUS=2 OR BARSCOUNT(C)=1;X3:=REF(BARSLAST(H3),1)+1;F3:=BACKSET(H3 AND COUNT(LL8,X3)>0,LLVBARS(IF(LL8,L,POW(10,20)),X3));G3:=F3>REF(F3,1);I3:=BACKSET(G3,2);LZ:=I3>REF(I3,1);L4:=LZ OR BARSTATUS=2 OR BARSCOUNT(C)=1;X4:=REF(BARSLAST(L4),1)+1;F4:=BACKSET(L4 AND COUNT(HH,X4)>0,HHVBARS(IF(HH,H,-POW(10,20)),X4));G4:=F4>REF(F4,1);I4:=BACKSET(G4,2);HZ:=I4>REF(I4,1);K1:=BACKSET(BARSTATUS=2,MIN(BARSLAST(HZ),BARSLAST(LZ))+1);K2:=K1>REF(K1,1);UU:=BACKSET(BARSTATUS=2,BARSLAST(LD)+1);VV:=UU>REF(UU,1);WW:=BACKSET(VV,REF(BARSLAST(LD),1)+2);XX:=WW>REF(WW,1);WWQ:=BACKSET(XX,REF(BARSLAST(LD),1)+2);XXQ:=WWQ>REF(WWQ,1);UU2:=BACKSET(BARSTATUS=2,BARSLAST(HD)+1);VV2:=UU2>REF(UU2,1);WW2:=BACKSET(VV2,REF(BARSLAST(HD),1)+2);XX2:=WW2>REF(WW2,1);WW3Q:=BACKSET(XX2,REF(BARSLAST(HD),1)+2);XX3Q:=WW3Q>REF(WW3Q,1);WW4Q:=BACKSET(XX3Q,REF(BARSLAST(HD),1)+2);XX4Q:=WW4Q>REF(WW4Q,1);Q0:=BARSLAST(XX2>0);Q1:=BARSLAST(XX>0);Q2:=BARSLAST(WW2>0);Q3:=BARSLAST(VV>0);Q4:=BARSLAST(XXQ>0);Q5:=BARSLAST(XX3Q>0);Q6:=BARSLAST(XX4Q>0);低1:REF(L,BARSLAST(VV)),LINETHICK2,COLORGREEN;低壹:=REF(C,BARSLAST(VV));低壹1:=REF(C,BARSLAST(VV)+1);高1:REF(H,BARSLAST(VV2)),LINETHICK2,COLORRED;高壹:=REF(C,BARSLAST(VV2));高壹1:=REF(C,BARSLAST(VV2)+1);低2:REF(L,BARSLAST(XX)),DOT,COLORGREEN;低贰:=REF(C,BARSLAST(XX));低贰2:=REF(C,BARSLAST(XX)+1);高2:REF(H,BARSLAST(XX2)),DOT,COLORRED;高贰:=REF(C,BARSLAST(XX2));高贰2:=REF(C,BARSLAST(XX2)+1);①②③:=IF(Q5<Q4,REF(H,BARSLAST(XX3Q)),0),DOT,COLORCYAN;DRAWLINE1(J2,IF(HD,H,L),ISLASTBAR,IF(BARSLAST(HD)>BARSLAST(LD),H,L),0),DOT,COLORYELLOW ,LINETHICK1;。
文华财经期货软件指标公式源码持仓量指标
文华财经期货软件指标公式源码持仓量指标以下是一种实现指标公式的源码示例,用于计算期货市场的持仓量指标。
该指标可以帮助分析师和交易员跟踪和评估市场参与者的持仓活动以及市场的整体情绪。
```pythonimport numpy as npdef open_interest_indicator(data):"""参数:- data: 输入数据,为一个二维数组,每一行代表一个交易周期(如天、小时)的数据,每一列代表不同的变量(如开盘价、收盘价、持仓量等)返回值:- indicator: 持仓量指标,为一个一维数组,表示每个交易周期的持仓量指标数值"""open_interest = data[:, 2] # 提取持仓量数据,假设持仓量在第3列#计算指标公式indicator = np.zeros(len(open_interest))for i in range(1, len(open_interest)):indicator[i] = open_interest[i] / open_interest[i-1]return indicator#假设已有输入数据,用于测试data = np.array([[100, 101, 1000],[101,98,900],[98,99,1100],[99,100,1200],[100,102,1300]])indicator = open_interest_indicator(data)print(indicator)```在上述示例代码中,`open_interest_indicator`函数实现了持仓量指标的计算逻辑。
该函数接收一个二维数组`data`作为输入数据,其中每一行代表一个交易周期的数据,每一列代表不同的变量。
通过提取第3列(假设为持仓量数据),并根据指标公式计算得到持仓量指标。
最后,将指标结果存储在一维数组`indicator`中并返回。
文华财经指标文华财经期货软件指标多空线指标公式源码
/*DIFF1:=EMA(CLOSE,12)-EMA(CLOSE,26);DEA1:=EMA(DIFF1,9);DRAWBAND(DEA1,DRAWNULL,DIFF1,RGB(250,0,0));DIFF:EMA(CLOSE,12)-EMA(CLOSE,26),COLORYELLOW;DEA:EMA(DIFF,9),COLORCYAN;MACD:2*(DIFF-DEA),COLORSTICK;TR1:=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;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("KDJ.K"(9,3,3),"KDJ.D"(9,3,3)),1));B2:=REF(C,A2+1)>C AND REF("KDJ.K"(9,3,3),A2+1)<"KDJ.K"(9,3,3) ANDCROSS("KDJ.K"(9,3,3),"KDJ.D"(9,3,3));A3:=BARSLAST(REF(CROSS("RSI.RSI1"(6,12,24),"RSI.RSI2"(6,12,24)),1));B3:=REF(C,A3+1)>C AND REF("RSI.RSI1"(6,12,24),A3+1)<"RSI.RSI1"(6,12,24) AND CROSS("RSI.RSI1"(6,12,24),"RSI.RSI2"(6,12,24));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("KDJ.D"(9,3,3),"KDJ.K"(9,3,3)),1));D2:=REF(C,C2+1)<C AND REF("KDJ.K"(9,3,3),C2+1)>"KDJ.K"(9,3,3) ANDCROSS("KDJ.D"(9,3,3),"KDJ.K"(9,3,3));C3:=BARSLAST(REF(CROSS("RSI.RSI2"(6,12,24),"RSI.RSI1"(6,12,24)),1));D3:=REF(C,C3+1)<C AND REF("RSI.RSI1"(6,12,24),C3+1)>"RSI.RSI1"(6,12,24) AND CROSS("RSI.RSI2"(6,12,24),"RSI.RSI1"(6,12,24));C4:=BARSLAST(REF(CROSS(MDI,PDI),1));D4:=REF(C,C+1)<C AND REF(MDI,C4+1)>MDI AND CROSS(MDI,PDI);A4:=BARSLAST(REF(CROSS(PDI,MDI),1));B4:=REF(C,A4+1)>C AND REF(PDI,A4+1)<PDI AND CROSS(PDI,MDI);MACD底背:IF(B1>0,1,0),COLORRED,NODRAW;KDJ底背:IF(B2>0,1,0),COLORFF00FF,NODRAW;RSI底背:IF(B3>0,1,0),COLORYELLOW,NODRAW;DMI底背:IF(B4>0,1,0),COLORBROWN,NODRAW;MACD顶背:IF(D1>0,1,0),COLOR00FF00,NODRAW;KDJ顶背:IF(D2>0,1,0),COLORFFCC66,NODRAW;RSI顶背:IF(D3>0,1,0),COLORWHITE,NODRAW;DMI顶背:IF(D4>0,1,0),COLORLIRED,NODRAW;{DRAWLINE(A1=0,DEA,MACD底背,DEA,0),COLORRED,LINETHICK2;DRAWLINE(A2=0,DEA,MACD顶背,DEA,0),COLOR00FF00,LINETHICK2;}STICKLINE(B1>0,-0.1,0,2,0),COLORRED;STICKLINE(B2>0,-0.1,-0.2,2,0),COLORFF00FF;STICKLINE(B3>0,-0.1,0,2,0),COLORYELLOW;STICKLINE(B4>0,-0.1,-0.2,2,0),COLORBROWN;STICKLINE(D1>0,0.1,0,2,0),COLOR00FF00;STICKLINE(D2>0,0.1,0.2,2,0),COLORFFCC66;STICKLINE(D3>0,0.1,0,2,0),COLORWHITE;STICKLINE(D4>0,0.1,0.2,2,0),COLORLIRED;SQX:=(C-MA(CLOSE,13))*100;DIF:EMA(MA(SQX,7),1),LINETHICK1;DEA:EMA(DIF,7),LINETHICK1;MACD: (DIF-DEA)*2,COLORSTICK;红柱持股:IF(MACD>REF(MACD,1),MACD,DRAWNULL),STICK,COLORRED,LINETHICK3;绿柱持币:IF(MACD<REF(MACD,1),MACD,DRAWNULL),STICK,COLORGREEN,LINETHICK3; 低位金叉:IF(CROSS(DIF,DEA) AND DIF<-0.1,0.3,0),COLORYELLOW,POINTDOT; STICKLINE(低位金叉,0,10,8,1),COLORYELLOW;DRAWICON(低位金叉,0.3,1);JCCOUNT:=COUNT(CROSS(DIF,DEA),BARSLAST(DEA>=0));二次金叉:IF(CROSS(DIF,DEA) AND DEA<0 ANDCOUNT(JCCOUNT=2,21)=1,0.2,0),COLORFF00FF,POINTDOT;STICKLINE(二次金叉,25,15,8,1),COLORFF00FF;A1:=BARSLAST(REF(CROSS(DIF,DEA),1));底背离:IF(REF(CLOSE,A1+1)>CLOSE AND DIF>REF(DIF,A1+1) ANDCROSS(DIF,DEA),0.1,0),COLORRED,POINTDOT;STICKLINE(底背离,40,30,8,1),COLORMAGENTA;DRAWLINE(A1=0,DEA,底背离,DEA,0),COLORMAGENTA,LINETHICK3;A2:=BARSLAST(REF(CROSS(DEA,DIF),1));顶背离:REF(CLOSE,A2+1)<CLOSE AND REF(DIF,A2+1)>DIF ANDCROSS(DEA,DIF),COLORGREEN;DRAWLINE(A2=0,DEA,顶背离,DEA,0),COLORBLUE,LINETHICK3;A3:=CROSS(DIF,DEA) AND DEA<0;零下二次金叉:IF(FILTER(COUNT(A3,21)=2,10),0.05,0),COLORWHITE,POINTDOT; STICKLINE(零下二次金叉,45,55,8,1),COLORWHITE;金叉:DRAWICON(CROSS(DIF,DEA),DIF,1);死叉:DRAWICON(CROSS(DEA,DIF),DIF,2);{MACD底背离选股公式}DIFF:=EMA(CLOSE,12)-EMA(CLOSE,26);DEA:=EMA(DIFF,9),;A1:=BARSLAST(REF(CROSS(DIFF,DEA),1));XG:REF(C,A1+1)>C AND REF(DIFF,A1+1)<DIFF AND CROSS(DIFF,DEA);*/N:=120;CURRBARSCOUNT:=DATACOUNT-BARPOS+1;K:=BARSLAST(CURRBARSCOUNT=N);GD:=REFX1(IF(ISLASTBAR=1,HHV(H,K),0),10000),NODRAW;{高点}DD:=REFX1(IF(ISLASTBAR=1,LLV(L,K),0),10000),NODRAW;{低点}KJ:=GD-DD;//{高低点差值=分区高度}GD4:=IF(CURRBARSCOUNT<=N/2,GD,NULL);高区:IF(CURRBARSCOUNT<=N,GD,NULL),COLORRED,LINETHICK2,NODRAW;低区:IF(CURRBARSCOUNT<=N,DD,NULL),COLOR00FF00,LINETHICK2,NODRAW;平衡:=IF(CURRBARSCOUNT<=N,DD+KJ/2,NULL),COLOR00FFFF,NODRAW;低:IF(CURRBARSCOUNT<=N/2,DD,NULL),COLORFFFF00;高:IF(CURRBARSCOUNT<=N/2,GD,NULL),COLOR00FFFF;支撑:IF(CURRBARSCOUNT<=N/2,DD+KJ*0.191,NULL),COLOR00FFFF;第一防线:REFX1(低,10000),DOT,COLORYELLOW,NODRAW;第二防线:REFX1(支撑,10000),DOT,COLORWHITE,NODRAW;今日保护价:(REF(C,2)+REF(C,1)+O)/3 ,COLORCC3299;CC:IF(CURRBARSCOUNT<18,REFX1(REF(C,1),10000),NULL),COLOR000000,NODRAW;止赢:1.05*CC,COLORMAGENTA,LINETHICK2;DRAWTEXT(ISLASTBAR,止赢,'止赢'),LINETHICK2;止损:0.97*CC,COLORYELLOW,LINETHICK2;DRAWTEXT(ISLASTBAR,止损,'止损'),LINETHICK2;DRAWNUMBER1(ISLASTBAR ,C,C,2),COLORWHITE;MAA10:=MA(C,10);MAA30:MA(C,30),COLORRED;KS:IF(MAA10>MAA30,MAA10,MAA30),COLORBLUE;A3:=(C-LLV(L,9))/(HHV(H,9)-LLV(L,9))*100;A4:=SMA(A3,3,1);A5:=SMA(A4,3,1);A6:=3*A4-2*A5;A7:=C-REF(C,1);A8:=100*EMA(EMA(A7,6),6)/EMA(EMA(ABS(A7),6),6);买:=LLV(A8,2)=LLV(A8,7) AND COUNT(A8<0,2) AND CROSS(A8,MA(A8,2)); DRAWTEXT(FILTER(买=1,5),LOW-0.05,'跟庄买进'),COLORYELLOW; STICKLINE1(买,OPEN,CLOSE,2,0),COLORYELLOW;。
文华财经指标公式源码变色K线变色主图线公式源码
DRAWTEXT_FIX(1,0.50,0,0,' 所属行业:')COLOR0080FF;
DRAWTEXT_FIX(1,0.56,0,0, HYBLOCK)COLORWHITE;
DRAWTEXT_FIX(1,0.62,0,0,' 所属概念:')COLORRED;
DRAWTEXT_FIX(1,0.68,0,0, GNBLOCK)COLOR00FFFF;
DRAWTEXT_FIX(1,0.92,0,T_FIX(1,0.96,0,0,
CON2STR(CAPITAL/1000000,2))COLOR00FFFF;
CON2STR(CAPITAL/1000000,2))COLOR00FFFF;
*/ MA5:MA(C,5); MA10:MA(C,10); MA18:MA(C,18),NODRAW; DRAWCOLORLINE(MA5>=MA10,MA5,COLORMAGENTA,COLORCYAN),LINETHICK1; DRAWCOLORLINE(MA5>=MA10,MA10,COLORMAGENTA,COLORCYAN),LINETHICK1; DRAWCOLORLINE(L>MA18||MA5>MA18||MA10>MA18,MA18,RGB(128,0,255),COLORM AGENTA),LINETHICK2; DRAWCOLORLINE(H<MA18||MA5<MA18||MA10<MA18,MA18,COLORCYAN,COLORMA GENTA),LINETHICK2; DRAWCOLORKLINE(L>MA18,COLORRED,1); DRAWCOLORKLINE(H<MA18,COLORCYAN,0);
文华财经指标公式源码资金买入卖出公式源码
/*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;J1:=REVERSE(J);AA8:=REF(MA(C,1),10)>REF(MA(C,60),10);买点:CROSS(J,J1) AND AA8;STICKLINE(买点,0,30,6,0),COLORBLUE;STICKLINE(买点,30,60,4,0),COLORWHITE;STICKLINE(买点,60,80,2,0),COLORYELLOW;DRAWTEXT(买点,70,'庄家出现'),COLORRED;VAR1:=REF((LOW+OPEN+CLOSE+HIGH)/4,1);VAR2:=SMA(ABS(LOW-VAR1),13,1)/SMA(MAX(LOW-VAR1,0),10,1); VAR3:=EMA(VAR2,10);VAR4:=LLV(LOW,33);VAR5:=EMA(IF(LOW<=VAR4,VAR3,0),3);主力进场:IF(VAR5>REF(VAR5,1),VAR5,0),COLORRED,NODRAW; STICKLINE(VAR5>REF(VAR5,1),0,VAR5,3,0 ),COLORRED; STICKLINE(VAR5>REF(VAR5,1),0,VAR5,3,0 ),COLOR000055; STICKLINE(VAR5>REF(VAR5,1),0,VAR5,2.6,0 ),COLOR000077; STICKLINE(VAR5>REF(VAR5,1),0,VAR5,2.1,0 ),COLOR000099; STICKLINE(VAR5>REF(VAR5,1),0,VAR5,1.5,0 ),COLOR0000BB; STICKLINE(VAR5>REF(VAR5,1),0,VAR5,0.9,0 ),COLOR0000DD; STICKLINE(VAR5>REF(VAR5,1),0,VAR5,0.3,0 ),COLOR0000FF;洗盘:IF(VAR5<REF(VAR5,1),VAR5,0),COLORGREEN,NODRAW; STICKLINE(VAR5<REF(VAR5,1),0,VAR5,3,0),COLORGREEN; STICKLINE(VAR5<REF(VAR5,1),0,VAR5,3,0),COLOR005500; STICKLINE(VAR5<REF(VAR5,1),0,VAR5,2.6,0),COLOR007700; STICKLINE(VAR5<REF(VAR5,1),0,VAR5,2.1,0),COLOR009900; STICKLINE(VAR5<REF(VAR5,1),0,VAR5,1.5,0),COLOR00BB00; STICKLINE(VAR5<REF(VAR5,1),0,VAR5,0.9,0),COLOR00DD00; STICKLINE(VAR5<REF(VAR5,1),0,VAR5,0.3,0),COLOR00FF00;VAR12:=SMA(ABS(VAR1-H),13,1)/SMA(MAX(VAR1-H,0),10,1); VAR13:=EMA(VAR12,10);VAR14:=HHV(H,33);VAR15:=EMA(IF(H>=VAR14,VAR13,0),3);冲顶:IF(VAR15>REF(VAR15,1),VAR15,0),COLORFF00FF,NODRAW; STICKLINE(VAR15>REF(VAR15,1),0,VAR15,3,0),COLORFF00FF; STICKLINE(VAR15>REF(VAR15,1),0,VAR15,3,0 ),COLOR550055; STICKLINE(VAR15>REF(VAR15,1),0,VAR15,2.6,0 ),COLOR770077; STICKLINE(VAR15>REF(VAR15,1),0,VAR15,2.1,0 ),COLOR990099; STICKLINE(VAR15>REF(VAR15,1),0,VAR15,1.5,0 ),COLORBB00BB; STICKLINE(VAR15>REF(VAR15,1),0,VAR15,0.9,0 ),COLORDD00DD; STICKLINE(VAR15>REF(VAR15,1),0,VAR15,0.3,0 ),COLORFF00FF; 主力出场:IF(VAR15<REF(VAR15,1),VAR15,0),COLORYELLOW,NODRAW; STICKLINE(VAR15<REF(VAR15,1),0,VAR15,3,0 ),COLORYELLOW; STICKLINE(VAR15<REF(VAR15,1),0,VAR15,3,0),COLOR005555; STICKLINE(VAR15<REF(VAR15,1),0,VAR15,2.6,0),COLOR007777; STICKLINE(VAR15<REF(VAR5,1),0,VAR15,2.1,0),COLOR009999; STICKLINE(VAR15<REF(VAR15,1),0,VAR15,1.5,0),COLOR00BBBB; STICKLINE(VAR15<REF(VAR15,1),0,VAR15,0.9,0),COLOR00DDDD; STICKLINE(VAR15<REF(VAR15,1),0,VAR15,0.3,0),COLOR00FFFF; A1:=REF(CLOSE,2);A2:=SMA(MAX(CLOSE-A1,0),7,1)/SMA(ABS(CLOSE-A1),7,1)*100;波段介入点:IF(A2<19,19,0)COLORWHITE;20,POINTDOT;80,POINTDOT;VAR18:=(2*C+H+L)/4;VAR28:=LLV(LOW,34);VAR38:=HHV(HIGH,34);AA:EMA((VAR18-VAR28)/(VAR38-VAR28)*100,5),COLORRED; BB:EMA(AA,5)COLOR00FFFF;DRAWBAND(AA,RGB(200,0,0),BB,RGB(0,200,200)); DRAWICON(CROSS(AA,BB),BB-5,1);DRAWICON(CROSS(BB,AA),AA+5,2);STICKLINE(AA<20,2,7,1,1),COLORFF00FF;STICKLINE(AA>80,92,97,1,1),COLOR00FFFF;IF(AA>=BB,100,108);IF(AA<BB,0,-8);DRAWICON(AA>=BB,105,1);DRAWICON(BB>AA,-8,2);STICKLINE( CROSS(AA,BB),-8,15,1,0),COLORRED,LINETHICK2; STICKLINE( CROSS(AA,BB),1,6,1,0),COLOR00FFFF,LINETHICK2; DRAWICON(CROSS(AA,BB),13,13);STICKLINE( CROSS(BB,AA),108,85,1,0),COLOR00FF00,LINETHICK2;STICKLINE( CROSS(BB,AA),94,99,1,0),COLORFF00FF,LINETHICK2; DRAWICON(CROSS(BB,AA),85,14);*/V AR3:=(CLOSE-MA(CLOSE,6))/MA(CLOSE,6)*100;V AR4:=(CLOSE-MA(CLOSE,24))/MA(CLOSE,24)*100;V AR5:=(CLOSE-MA(CLOSE,32))/MA(CLOSE,32)*100;V AR6:=(V AR3+V AR4+V AR5)/3;V AR7:=EMA(VAR6,5);指标: EMA(EMA(V AR3,5),5)*3, COLORSTICK;V AR8:=IF(VAR6<=-20,10,0);V AR9:=HHV(V AR8,10);STICKLINE(V AR8=10,20,10,5,0),COLOR6666FF;V ARA:=IF(VAR9 AND CROSS(MA(CLOSE,3),MA(CLOSE,5)),20,0);DRAWTEXT(V ARA=20,15,'底部'),LINETHICK1,COLORWHITE;STICKLINE((V ARA=20),0,10,5,0),COLORWHITE;V ARC:=(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));V ARD:=(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));STICKLINE((V ARC=1),(-14),0,4,0),COLOR0000FF;DRAWTEXT((V ARC=1),(-14),'买入'),COLOR0000FF;STICKLINE((V ARD=1),14,0,4,0),COLOR00FF00;DRAWTEXT((V ARD=1),18,'卖出'),COLOR00FF00;V ARE:=MA(100*(CLOSE-LLV(CLOSE,34))/(HHV(HIGH,34)-LLV(LOW,34)),5)-20;V ARF:=100-3*SMA((CLOSE-LLV(LOW,75))/(HHV(HIGH,75)-LLV(LOW,75))*100,20,1)+2*S MA(SMA((CLOSE-LLV(LOW,75))/(HHV(HIGH,75)-LLV(LOW,75))*100,20,1),15,1);V AR10:=100-3*SMA((OPEN-LLV(LOW,75))/(HHV(HIGH,75)-LLV(LOW,75))*100,20,1)+2*S MA(SMA((OPEN-LLV(LOW,75))/(HHV(HIGH,75)-LLV(LOW,75))*100,20,1),15,1);V AR11:=VARF<REF(V AR10,1) AND VOL>REF(VOL,1) AND CLOSE>REF(CLOSE,1); DRAWTEXT(V AR11 AND COUNT(V AR11,30)=1,15,'大资金活动'),LINETHICK1,COLORFF00FF;STICKLINE(V AR11 AND COUNT(V AR11,30)=1,1,10,5,0),COLORFF00FF;V AR12:=(HIGH+LOW+CLOSE)/3;V AR13:=(V AR12-MA(V AR12,14))/(0.015*A VEDEV(V AR12,14));V AR14:=(V AR12-MA(V AR12,70))/(0.015*A VEDEV(V AR12,70));V AR15:=IF(VAR13>=150 AND V AR13<200 AND V AR14>=150 AND VAR14<200,10,0);V AR16:=IF(VAR13<=-150 AND V AR13>-200 AND V AR14<=-150 AND V AR14>-200,-10,V AR15);V AR17:=(CLOSE-MA(CLOSE,13))/MA(CLOSE,13)*100;V AR18:=100-ABS(V AR17);V AR19:=IF(VAR18<90,V AR18,100);。
文华财经趋势线指标公式源码
文华财经趋势线指标公式源码
以下是一个简化的文华财经趋势线指标的公式源代码:
```python
import numpy as np
def wenhua_trend_line(close):
n = len(close)
x = np.arange(n)
y = np.log(close)
k, b = np.polyfit(x, y, 1)
trend_line = np.exp(k*x + b)
return trend_line
```
上述代码使用了python的numpy库来进行数学计算,其中`close`是一个包含了收盘价数据的numpy数组。
首先,计算对数价格数据`y`。
然后,使用`polyfit`函数来拟合线性趋势线的系数`k`和截距`b`。
最后,根据拟合的系数计算趋势线的价格值。
这段代码只是一个简单的示例,实际使用中可能需要进行更多的数据预处理和参数调整。
希望这可以帮助到您。
文华财经指标代码
| 操作符 | 语法 | 函数 | 交易指令 | 编程举例 |自编公式支持的操作符| 操作符 | 语法 | 函数 | 交易指令 | 编程举例 |编辑平台的语法1.关于公式名称:公式的名称不可以和已经存在的公式重复。
2.关于参数:每个自编公式最多可以定义四个参数,参数的定义如下,首先是参数名称,然后是参数的最小值,最大值,最后是参数的默认值。
在定义参数时要注意的是参数名称不可以重复。
3.关于变量名称:变量名称不可以互相重复,不可以和参数名重复,不可以和函数名称重复。
4.关于公式内容:公式的每个语句应该以分号结束,包括最后一条语句。
在数据公式的时候请您注意一定要使用半角输入。
在编写公式的过程中,如果您不记得某个函数的确切写法,可以选择插入函数来插入函数。
5.如果您在编写公式之后,想给这个公式加上注释、说明,可以点击公式名称后面的“公式说明”,在弹出窗口中输入。
6.IFELSE(C,A,B)如果条件C成立则返回A值,否则返回B值例:IFELSE(CLOSE>REF(CLOSE,1),1,0);表示若今日收盘价高于前一日收盘价,则返回1,否则返回0| 操作符 | 语法 | 函数 | 交易指令 | 编程举例 |自编公式支持的函数1.引用数据2.金融统计3.数理统计4.逻辑判断5.数学运算6.时间函数7.绘图8、颜色常数常数意义COLORRED 红色COLORGREEN 绿色COLORBLUE 蓝色COLORMAGENTA 红紫色COLORYELLOW 黄色COLORLIGHTGREY 浅灰色COLORLIGHTRED 浅红色COLORLIGHTGREEN 浅绿色COLORLIGHTBLUE 浅蓝色COLORBLACK 黑色COLORWHITE 白色COLORCYAN 青色9、level-2函数(只有嬴智版本支持)10、头寸函数11、信号记录函数| 操作符 | 语法 | 函数 | 交易指令 | 编程举例 |交易模型中的交易指令期货交易指令股票、权证、外汇交易指令套利模型中的交易指令| 操作符 | 语法 | 函数 | 交易指令 | 编程举例 |编程举例■举例:1. MACD公式MACD公式有三个参数:SHORT(短期)、LONG(长期)、M 天数,一般为12、26、10 MACD公式的用法:①DIFF、DEA均为正,DIFF向上突破DEA,买入信号。
- 1、下载文档前请自行甄别文档内容的完整性,平台不提供额外的编辑、内容补充、找答案等附加服务。
- 2、"仅部分预览"的文档,不可在线预览部分如存在完整性等问题,可反馈申请退款(可完整预览的文档不适用该条件!)。
- 3、如文档侵犯您的权益,请联系客服反馈,我们会尽快为您处理(人工客服工作时间:9:00-18:30)。
| 操作符 | 语法 | 函数 | 交易指令 | 编程举例 |自编公式支持的操作符
| 操作符 | 语法 | 函数 | 交易指令 | 编程举例 |
编辑平台的语法
1.关于公式名称:
公式的名称不可以和已经存在的公式重复。
2.关于参数:
每个自编公式最多可以定义四个参数,参数的定义如下,首先是参数名称,然后是参数的最小值,最大值,最后是参数的默认值。
在定义参数时要注意的是参数名称不可以重复。
3.关于变量名称:
变量名称不可以互相重复,不可以和参数名重复,不可以和函数名称重复。
4.关于公式内容:
公式的每个语句应该以分号结束,包括最后一条语句。
在数据公式的时候请您注意一定要使用半角输入。
在编写公式的过程中,如果您不记得某个函数的确切写法,可以选择插入函数来插入函数。
5.如果您在编写公式之后,想给这个公式加上注释、说明,可以点击公式名称后面的“公式说
明”,在弹出窗口中输入。
6.IFELSE(C,A,B)
如果条件C成立则返回A值,否则返回B值
例:IFELSE(CLOSE>REF(CLOSE,1),1,0);表示若今日收盘价高于前一日收盘价,则返回1,否则返回0
| 操作符 | 语法 | 函数 | 交易指令 | 编程举例 |
自编公式支持的函数1.引用数据
2.金融统计
3.数理统计
4.逻辑判断
5.数学运算
6.时间函数
7.绘图
8、颜色常数
常数意义COLORRED 红色
COLORGREEN 绿色
COLORBLUE 蓝色
COLORMAGENTA 红紫色
COLORYELLOW 黄色
COLORLIGHTGREY 浅灰色
COLORLIGHTRED 浅红色
COLORLIGHTGREEN 浅绿色
COLORLIGHTBLUE 浅蓝色
COLORBLACK 黑色
COLORWHITE 白色
COLORCYAN 青色
9、level-2函数(只有嬴智版本支持)
10、头寸函数
11、信号记录函数
| 操作符 | 语法 | 函数 | 交易指令 | 编程举例 |交易模型中的交易指令
期货交易指令
股票、权证、外汇交易指令
套利模型中的交易指令
| 操作符 | 语法 | 函数 | 交易指令 | 编程举例 |
编程举例
■举例:
1. MACD公式
MACD公式有三个参数:SHORT(短期)、LONG(长期)、M 天数,一般为12、26、10 MACD公式的用法:
①DIFF、DEA均为正,DIFF向上突破DEA,买入信号。
②DIFF、DEA均为负,DIFF向下跌破DEA,卖出信号。
③DEA线与K线发生背离,行情反转信号。
④分析MACD柱状线,由红变绿(正变负),卖出信号;由绿变红,买入信号。
其中:
⑴DIFF线收盘价短期、长期指数平滑移动平均线间的差
⑵DEA线 DIFF线的M日指数平滑移动平均线
⑶MACD线DIFF线与DEA线的差,彩色柱状线
按照上述原理,MACD公式应该写成如下形式:
参数表:
参数名最小值最大值默认值
SHORT 5 40 12
LONG 20 100 26
M 2 60 10
公式写成如下形式即可:
DIFF:=EMA(CLOSE,SHORT)-EMA(CLOSE,LONG);
DEA:=MA(DIFF,M);
MACD:2*(DIFF-DEA);
公式的第一行对应于⑴,公式的第二行对应于⑵,公式的第三行对应于⑶。
2. KD公式:
算法:对每一交易日求RSV(未成熟随机值)
⑴RSV=(收盘价-最近N日最低价)/(最近N日最高价-最近N日最低价)×100
⑵K线:RSV的M1日移动平均
⑶D线:K值的M2日移动平均。
参数:N、M1、M2 天数,一般取9、3、3
用法:
①D>70,超买;D<30,超卖。
②线K向上突破线D,买进信号;线K向下跌破线D ,卖出信号。
③线K与线D的交叉发生在70以上,30以下,才有效。
④KD指标不适于发行量小,交易不活跃的股票;
⑤KD指标对大盘和热门大盘股有极高准确性。
参照KD公式算法,KD公式可以按照如下方式来编写。
参数表:
参数名称最小值最大值缺省值
N 1 100 9
M1 2 40 3
M2 2 40 3
公式的内容如下:
RSV:=(CLOSE-LLV(CLOSE,N))/(HHV(CLOSE,N)-LLV(CLOSE,N))*100;
K:SMA(RSV,M1,1);
D:SMA(RSV,M2,1);
3. K线:
算法略。
公式如下:
TMP:=OPEN-CLOSE;
DRAWLINE(TMP>0.00001,HIGH,TMP>0.00001,OPEN,COLORCYAN);
DRAWLINE(TMP>0.00001,LOW,TMP>0.00001,CLOSE,COLORCYAN);
DRAWLINE(TMP<-0.00001,HIGH,TMP<-0.00001,CLOSE,COLORRED);
DRAWLINE(TMP<-0.00001,LOW,TMP<-0.00001,OPEN,COLORRED);
DRAWLINE(ABS(TMP)<0.00001,LOW,ABS(TMP)<0.00001,OPEN,COLORWHITE); DRAWLINE(ABS(TMP)<0.00001,HIGH,ABS(TMP)<0.00001,OPEN,COLORWHITE); STICKLINE(TMP>0.00001,OPEN,CLOSE,COLORCYAN,0);
STICKLINE(TMP<-0.00001,OPEN,CLOSE,COLORRED,1);
公式说明:
第一行,当当前周期收阴时,从HIGH向OPEN画直线,颜色为COLORCYAN;
第二行,当当前周期收阴时,从LOW向CLOSE画直线,颜色为COLORCYAN;
第三行,当当前周期收阳时,从HIGH向CLOSE画直线,颜色为COLORRED;
第四行,当当前周期收阳时,从LOW向OPEN画直线,颜色为COLORRED;
第五行,当当前周期平盘时,从LOW向OPEN画直线,颜色为白色;
第六行,当当前周期平盘时,从HIGH向OPEN画直线,颜色为白色;
第七行,当当前周期收阴时,从OPEN向CLOSE画实心柱线,颜色为COLORCYAN;
第八行,当当前周期收阳时,从OPEN向CLOSE画空心柱线,颜色为COLORRED。