恒温交易系统文华财经源码

合集下载

文华财经指标公式源码文华财经指标CCI指标RSI指标共振

文华财经指标公式源码文华财经指标CCI指标RSI指标共振

文华财经指标公式源码文华财经指标CCI指标RSI指标共振文华财经指标公式源码——文华财经指标CCI指标、RSI指标共振CCI指标CCI指标的计算公式如下:def calculate_CCI(close_prices, high_prices, low_prices, period):typical_prices = (high_prices + low_prices + close_prices) / 3average_price = np.average(typical_prices[1:period+1])mean_deviation = np.mean(np.abs(typical_prices[1:period+1] - average_price))CCI = (typical_prices - average_price) / (0.015 * mean_deviation)return CCI示例用法close_prices = [112.32, 113.45, 111.98, 110.76, 109.99, 111.02, 112.67, 112.33, 111.81]high_prices = [113.78, 114.48, 113.42, 112.58, 111.67, 112.4, 113.41, 113.34, 112.1]low_prices = [111.93, 112.86, 111.4, 110.05, 109.87, 109.74, 112.08, 111.66, 111.58]period = 9CCI = calculate_CCI(close_prices, high_prices, low_prices, period)RSI指标RSI指标(Relative Strength Index)是一种用来分析价格走势的技术指标,它主要通过计算一段时间内上涨日和下跌日的平均涨幅来衡量市场的强弱程度。

文华财经指标公式源码最神奇的主图买卖指标公式源码

文华财经指标公式源码最神奇的主图买卖指标公式源码

/* AMV0:=VOL*(O+C)/2;CG:MA(C,3),COLORFFCC66,LINETHICK2;FL:=HHV(CG,2);黄金线:HHV(CG,2),COLOR00FF00;FS:CG-(FL-CG),COLORRED,LINETHICK2;十:MA(C,13),COLOR00FFFF,LINETHICK2;涨:IF(MA(CLOSE,13)>REF(MA(CLOSE,13),1),MA(CLOSE,13),DRAWN ULL),COLORRED,LINETHICK2;平:IF(MA(CLOSE,13)=REF(MA(CLOSE,13),1),MA(CLOSE,13),DRAWN ULL),COLOR00FFFF,LINETHICK3;跌:IF(MA(CLOSE,13)<REF(MA(CLOSE,13),1),MA(CLOSE,13),DRAWN ULL),COLORGREEN,LINETHICK2;DRAWTEXT(平=十,十*0.998-0.01,'关注'),COLORCYAN;TY:=C;A1:=REF(TY,10)=HHV(TY,2*10+1); B1:=FILTER(A1,10);C1:=BACKSET(B1,10+1); HD:=FILTER(C1,10);A2:=REF(TY,10)=LLV(TY,2*10+1); B2:=FILTER(A2,10);C2:=BACKSET(B2,10+1); LD:=FILTER(C2,10);A:=REF(C,BARSLAST(HD)); B:=REF(C,BARSLAST(LD));T1:=BARSLAST(HD)<BARSLAST(LD) AND NOT(HD) ;T2:=BARSLAST(HD)>BARSLAST(LD) AND NOT(LD);波峰:IF(T1,A,A),COLORFF00FF,POINTDOT;STICKLINE(T1,A,A,9,0),COLORFF00FF;波谷:IF(T2,B,B),COLOR80FF00,POINTDOT;STICKLINE(T2,B,B,9,0),COLOR80FF00;VAR3:=LLV(HIGH,240); VAR4:=100*(CLOSE-VAR3)/VAR3;VAR5:=(CLOSE-LLV(LOW,528))/(HHV(HIGH,528)-LLV(LOW,528))*10 0;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-R EF(CLOSE,1)),7,1)*100;VAR9:=SMA(MAX(CLOSE-REF(CLOSE,1),0),13,1)/SMA(ABS(CLOSE-R EF(CLOSE,1)),13,1)*100;VAR10:=IF(TROUGHBARS(3,16,1)=0 AND HIGH>LOW+0.04,4,0); VAR11:=ZIG(3,6)>REF(ZIG(3,6),1) ANDREF(ZIG(3,6),1)<=REF(ZIG(3,6),2) ANDREF(ZIG(3,6),2)<=REF(ZIG(3,6),3);VAR12:=ZIG(3,6)<REF(ZIG(3,6),1) AND REF(ZIG(3,6),1)>=REF(ZIG(3,6),2) AND REF(ZIG(3,6),2)>=REF(ZIG(3,6),3);VAR13:=ZIG(3,22)>REF(ZIG(3,22),1) AND REF(ZIG(3,22),1)<=REF(ZIG(3,22),2) AND REF(ZIG(3,22),2)<=REF(ZIG(3,22),3); VAR14:=ZIG(3,22)<REF(ZIG(3,22),1) AND REF(ZIG(3,22),1)>=REF(ZIG(3,22),2) AND REF(ZIG(3,22),2)>=REF(ZIG(3,22),3); VAR15:=ZIG(3,51)>REF(ZIG(3,51),1) AND REF(ZIG(3,51),1)<=REF(ZIG(3,51),2) AND REF(ZIG(3,51),2)<=REF(ZIG(3,51),3); VAR16:=ZIG(3,51)<REF(ZIG(3,51),1) AND REF(ZIG(3,51),1)>=REF(ZIG(3,51),2) AND REF(ZIG(3,51),2)>=REF(ZIG(3,51),3); VAR17:=ZIG(3,72)>REF(ZIG(3,72),1) AND REF(ZIG(3,72),1)<=REF(ZIG(3,72),2) AND REF(ZIG(3,72),2)<=REF(ZIG(3,72),3); VAR18:=ZIG(3,72)<REF(ZIG(3,72),1) AND REF(ZIG(3,72),1)>=REF(ZIG(3,72),2) AND REF(ZIG(3,72),2)>=REF(ZIG(3,72),3); VAR19:=EMA(CLOSE,2)-EMA(CLOSE,150);买1:=VAR10;买2:=(VAR11+VAR13+VAR15+VAR17);卖1:=(VAR12+VAR14+VAR16+VAR18);DRAWTEXT(买1>0 OR 买2>0,LOW*0.99,'买'),COLORRED;S:IF(卖1>0,HIGH*1.01,DRAWNULL),CROSSDOT,LINETHICK3,COLORGREE N;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));X1:=(C+L+H)/3;X2:=EMA(X1,6);X3:=EMA(X2,5);GR1:=BARSLAST(BETWEEN("BIAS.BIAS2"(6,13,24),0,5));GR3:=COUNT("BIAS.BIAS2"(6,13,24)>10 AND H=HHV(H,GR1),GR1); GR4:=H=HHV(H,GR1);GR5:="MACD.MACD"(9,17,8)<REF("MACD.MACD"(9,17,8),1);STICKLINE(CLOSE> REF(CLOSE,1) ,HIGH,LOW,0,1 ),COLORRED; STICKLINE(CLOSE> REF(CLOSE,1) ,OPEN,CLOSE,3,0 ),COLOR000055; STICKLINE(CLOSE>REF(CLOSE,1) ,OPEN,CLOSE,2.7,0 ),COLOR000077;STICKLINE(CLOSE>REF(CLOSE,1) ,OPEN,CLOSE,2.1,0 ),COLOR000099;STICKLINE(CLOSE>REF(CLOSE,1) ,OPEN,CLOSE,1.5,0 ),COLOR0000BB;STICKLINE(CLOSE>REF(CLOSE,1) ,OPEN,CLOSE,0.9,0 ),COLOR0000DD;STICKLINE(CLOSE>REF(CLOSE,1) ,OPEN,CLOSE,0.3,0 ),COLOR0000FF;STICKLINE(CLOSE= REF(CLOSE,1) ,HIGH,LOW,0,1 ),COLORWHITE; STICKLINE(CLOSE= REF(CLOSE,1) ,OPEN,CLOSE,3,0 ),COLOR555555; STICKLINE(CLOSE=REF(CLOSE,1) ,OPEN,CLOSE,2.7,0 ),COLOR777777;STICKLINE(CLOSE=REF(CLOSE,1) ,OPEN,CLOSE,2.1,0 ),COLOR999999;STICKLINE(CLOSE=REF(CLOSE,1) ,OPEN,CLOSE,1.5,0 ),COLORBBBBBB;STICKLINE(CLOSE=REF(CLOSE,1) ,OPEN,CLOSE,0.9,0 ),COLORDDDDDD;*/趋势5:MA(CLOSE,5);CURRBARSCOUNT:=DATACOUNT - BARPOS;拐头卖10:MA(CLOSE,10);方向15:MA(CLOSE,15);中心线:(MA(C,30)+MA(C,72))/2,COLORGRAY,DOT;脱离价格1:中心线*1.2,COLORGRAY,DOT;脱离价格2:中心线*0.8,COLORGRAY,DOT;地心引力线:(MA(C,30)+MA(C,72))/2,COLORGRAY,DOT;地心引力区1:地心引力线*1.1,COLORGRAY,DOT;地心引力区2:地心引力线*0.9,COLORGRAY,DOT;DIFF:=EMA(CLOSE,12)-EMA(CLOSE,26);DEA:=EMA(DIFF,9);MACD:=2*(DIFF-DEA);平空开多:=CROSS(MACD,0);平多开空:=CROSS(0,MACD);//BUYSHORT_BUY(平空开多,LOW);//SELL_SELLSHORT(平多开空,HIGH);//AUTOFILTER;N:=10;T1:=REFX1(HHVBARS(V,N),10000);T0:IF(CURRBARSCOUNT<=N+3,REFX1(IF(T1=0,C,REF(C,T1)),10000),NULL),COLORYELLOW,DOT; IF(CURRBARSCOUNT=T1+1,T0,NULL),CIRCLEDOT,COLORFF00FF;涨跌:=REF(C,1);涨停:=IF((C-涨跌)*100/涨跌>=(10-0.01*100/涨跌),1,0);STICKLINE1(涨停,OPEN,CLOSE,2,0),COLORMAGENTA;STICKLINE1(涨停,H,L,0,0),COLORMAGENTA;ZT:=C/REF(C,1)>1.0945 AND C=H;AA:=BACKSET(ZT AND CURRBARSCOUNT<60,0);AC:=REF(C,BARSLAST(AA));STICKLINE1(C,AC,AC,5,0),COLORMAGENTA;VAR4:=PEAKBARS(C,15,1,1)<10;VAR5:=IF(VAR4=1,2,0);顶:= IF(VAR5=2,2,0);中线卖出:=IF(顶>REF(顶,1),1,0);止损价:IF(中线卖出=1, C*0.9,0), POINTDOT,COLOR00FF00,LINETHICK5;STICKLINE1(止损价,C*0.9,C*0.9,200,1),COLORRED,COLORGREEN;MA5:=MA(C,5);角度: ATAN((MA5/REF(MA5,1)-1)*100)*180/3.1416,NODRAW;。

文华财经指标公式源码MACD绿柱面积红柱面积公式源码

文华财经指标公式源码MACD绿柱面积红柱面积公式源码

/*3.3,COLOR555555;0.45,COLOR555555;R0:=1;MA5:=MA(R0,5);最小值:=LLV(LOW,10);最大值:=HHV(HIGH,25);波动线:=EMA((CLOSE-最小值)/(最大值-最小值)*4,4);平均线:EMA(波动线,3);主力攻击:=R0-(ABS(REF(R0,1))+ABS(REF(R0,2))+ABS(REF(R0,3))+ABS(REF(R0,4))+ABS(REF( R0,5))/2)>0 AND 平均线>=REF(平均线,1) AND REF(平均线,1)<REF(平均线,2);主力撤退:=R0+(ABS(REF(R0,1))+ABS(REF(R0,2))+ABS(REF(R0,3))+ABS(REF(R0,4))+ABS(REF( R0,5))/2)<0 AND 平均线<=REF(平均线,1) AND REF(平均线,1)>REF(平均线,2); DRAWTEXT(主力攻击>0,1.5,'主进'),colorred;DRAWTEXT(主力撤退<0,2.8,'主退'),colorgreen;信息:=平均线>=REF(平均线,1);走强:=CLOSE>MA(CLOSE,20)AND CLOSE>MA(CLOSE,5);走弱:=CLOSE<MA(CLOSE,10)AND CLOSE<MA(CLOSE,5);量:=VOL>MA(VOL,5);STICKLINE(平均线>=REF(平均线,1),波动线,REF(波动线,1),6,0),colorred;STICKLINE(平均线<REF(平均线,1),波动线 ,REF(波动线,1),6,0),colorgreen;D:=信息=1 AND REF(信息,1)=0 AND (REF(信息,2)+REF(信息,3)=0) AND 平均线<0.5; S:=信息=1 AND REF(信息,1)=0 AND (REF(信息,2)+REF(信息,3)=0) AND 走强=1 AND REF(走强,1)=0 AND 量=1;DD:=平均线>2 AND (信息=0 AND REF(信息,1)=1) AND (REF(信息,2)+REF(信息,3)=2); TZ:=(信息=0 AND REF(信息,1)=1) AND (REF(信息,2)+REF(信息,3)=2) AND MA5<0AND 走弱=1 AND 平均线>1;DRAWTEXT(D=1,1.75,'极底'),colorred;DRAWTEXT(S=1,平均线,'升');DRAWTEXT(DD=1,平均线,'顶');DRAWTEXT(TZ=1,平均线,'下');IF(平均线>=REF(平均线,1),平均线,DRAWNULL),colorred,LINETHICK2;IF(平均线<REF(平均线,1),平均线,DRAWNULL),colorgreen,LINETHICK2;LC:=REF(CLOSE,1);RSI5:=((SMA(MAX((CLOSE - LC),0),5,1) / SMA(ABS((CLOSE - LC)),5,1)) * 100);TR1:=SUM(MAX(MAX((HIGH - LOW),ABS((HIGH - REF(CLOSE,1)))),ABS((LOW - REF(CLOSE,1)))),10);HD:=(HIGH - REF(HIGH,1));LD:=(REF(LOW,1) - LOW);DMP:=SUM(IF(((HD > 0) AND (HD > LD)),HD,0),10);DMM:=SUM(IF(((LD > 0) AND (LD > HD)),LD,0),10);PDI:=((DMP * 100) / TR1);MDI:=((DMM * 100) / TR1);ADX:=MA(((ABS((MDI - PDI)) / (MDI + PDI)) * 100),5);AV:=(RSI5 + ADX);WR10:=((100 * (HHV(HIGH,10) - CLOSE)) / (HHV(HIGH,10) - LLV(LOW,10)));ZCJL:=(RSI5 - WR10);最佳买入:=(AV + ZCJL);最佳买入选股:=IF(CROSS(最佳买入,0),1,0);VAR5:=SMA(最佳买入选股,3,1);VAR6:=SMA(VAR5,3,1);VAR7:=SMA(VAR6,3,1);建仓买点:=IF(CROSS(VAR6,VAR7) AND (VAR6<40),5,0);DRAWTEXT(建仓买点,0.75,'建仓'),colorred;VAR8:=REF(CLOSE,2);会员:=SMA(MAX(CLOSE-VAR8,0),7,1)/SMA(ABS(CLOSE-VAR8),7,1)*100;逃亡:=IF(会员< REF(会员,1) AND 会员>79,会员,0);DRAWTEXT(逃亡,3.1,'逃'),coloryellow;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,1,'见底'),colorlired;DRAWTEXT(C-O>=0 AND O/L>1.05 AND L<=LLV(L,20),1,'绝底'),colorred;VAR11:=REF(LOW,1);VAR12:=SMA(ABS(LOW-VAR11),3,1)/SMA(MAX(LOW-VAR11,0),3,1)*100;VAR13:=EMA(IF(CLOSE*1.2,VAR12*10,VAR12/10),3);VAR14:=LLV(LOW,38);VAR15:=HHV(VAR13,38);VAR16:=IF(LLV(LOW,90),1,0);VAR17:=EMA(IF(LOW<=VAR14,(VAR13+VAR15*2)/2,0),3)/618*VAR16;CDXS:=HHV(VAR17,0)/2.6;STICKLINE(VAR17,0.53,VAR17/CDXS+0.53,0.6,0),colorwhite;HUA:=(CLOSE - LLV(LOW,14)) / (HHV(HIGH,14) - LLV(LOW,14)) * 1.2 * CLOSE;NV1:=EMA(HUA,4);NV2:=EMA(HUA,8);DRAWICON(CROSS(NV1,NV2) AND CLOSE/OPEN>1.05,0.5,1);DRAWICON(CROSS(NV2,NV1) AND COUNT(CROSS(NV1,NV2) AND CLOSE/OPEN>1.05 ,20) ,3.2,2);HUA2:=SMA(MAX(CLOSE-REF(CLOSE,1),0),16,2)/SMA(ABS(CLOSE/REF(CLOSE,1)),16,2)* 100;XIAN:=SMA(HUA2,3,1);NV3:=SMA(XIAN,3,1);XINV:=3*XIAN-2*NV3;买入条件:=CROSS(XINV,NV3);卖出条件:=CROSS(NV3,XINV);DRAWICON( 卖出条件,3.3,2),coloryellow;DRAWICON(买入条件,0.4,222),colorwhite;HXN:=IF(CLOSE/REF(CLOSE,1)>1.05 AND HIGH/CLOSE<1.01 AND IF(CLOSE>REF(CLOSE,1),88,0)>0, 91, 0);DRAWTEXT(HXN>90 AND VOL>REF(VOL,1) AND CLOSE>REF(CLOSE,1) AND COUNT(HXN>90,30)=1,平均线-0.25, '见涨'),,colorlired;HXJZ:=MA((2*CLOSE+HIGH+LOW)/4,5);BZTD:=HXJZ*89/100;DRAWTEXT(CROSS(LOW,BZTD),1.25,'必涨'),colorred;花:=EMA(SLOPE(1,1)+C,3),colorred;女:=EMA(SLOPE(1,1)+C,7),colorblue;STICKLINE(花>女 ,0.5,0.53,6,0) ,colorred;STICKLINE(花<=女 ,0.5,0.53,6,0),colorgreen;RJ:=1;{好}RSI_1:=SMA(MAX(CLOSE-LC,0),3,1)/SMA(ABS(CLOSE-LC),3,1)*100;RSI_2:=SMA(MAX(CLOSE-LC,0),5,1)/SMA(ABS(CLOSE-LC),5,1)*100;RSI_3:=SMA(MAX(CLOSE-LC,0),8,1)/SMA(ABS(CLOSE-LC),8,1)*100;相对强弱:=0.5*RSI_1+0.31*RSI_2+0.19*RSI_3;WAVE_1:=SMA(100*(CLOSE-LLV(LOW,8))/(HHV(HIGH,8)-LLV(LOW,8)),3,1);WAVE_2:=SMA(100*(CLOSE-LLV(LOW,8))/(HHV(HIGH,8)-LLV(LOW,8)),5,1);WAVE_3:=SMA(100*(CLOSE-LLV(LOW,8))/(HHV(HIGH,8)-LLV(LOW,8)),8,1);短线波段:=0.5*WAVE_1+0.31*WAVE_2+0.19*WAVE_3;风险系数:=0.5*相对强弱+0.5*短线波段,coloryellow;CD1:=IF(风险系数<20 AND CLOSE>OPEN AND RJ>0,1,0);CD2:=IF(风险系数<20 AND LOW>=REF(LOW,1) AND CLOSE>LOW AND RJ>0,1,0);CD3:=IF(REF(风险系数,1)<20 AND 风险系数>REF(风险系数,1),1,0);SIGNALBUY:=(CD1=1 OR CD2=1 OR CD3=1);CD:=(SIGNALBUY AND COUNT(SIGNALBUY,3)=1);DRAWTEXT(CD,0.5,'抄底'),COLOR0099FF;DIF:=(EMA(CLOSE,12)-EMA(CLOSE,26))*100;DEA:=EMA(DIF,9);RSV:=(CLOSE-LLV(LOW,9))/(HHV(HIGH,9)-LLV(LOW,9))*100;K:=SMA(RSV,9,3);D_:=SMA(K,9,3);GZ:=CROSS(DIF,DEA) AND CROSS(K,D_);DRAWTEXT(GZ,2,'金叉'),COLOR0099FF; */M:=10;MM:=9*M;SHORT:=MM*4/3;LONG:=MM*26/9;DIF:1000*(EMA(CLOSE,SHORT)-EMA(CLOSE,LONG))/ABS(EMA(CLOSE,SHORT)); MACD:EMA(DIF,MM),COLOR58FF58;DEF:2*(DIF-MACD),COLORFFFF00,NODRAW;STICKLINE1(DEF>=0 AND DEF>=REF(DEF,1),0,DEF,6,1),COLOR6058FF;STICKLINE1(DEF>=0 AND DEF< REF(DEF,1),0,DEF,6,0),COLOR6058FF;STICKLINE1(DEF<0 AND DEF>=REF(DEF,1),0,DEF,6,1),COLORFFFF00;STICKLINE1(DEF<0 AND DEF< REF(DEF,1),0,DEF,6,0),COLORFFFF00;PARTLINE(DIF<1000,0,COLORLIGHTRED);多头趋势:=IF(DIF>=0 AND MACD>=0 OR (DIF<0 AND MACD>=0),1,0);空头趋势:=DIF<0 AND MACD<0 OR (DIF>=0 AND MACD<0);缩头:=IF(DEF>0 AND REF(DEF,1)>REF(DEF,2) AND DEF< REF(DEF,1),1,0);缩脚:=IF(DEF<0 AND REF(DEF,1)< REF(DEF,2) AND DEF>REF(DEF,1),1,0);阻力:=IF(CROSS(CLOSE,MA(CLOSE,20)) OR CROSS(CLOSE,MA(CLOSE,60)),1,0);支撑:=IF(CROSS(MA(CLOSE,20),CLOSE) OR CROSS(MA(CLOSE,60),CLOSE),1,0);做多:=IF(CROSS(MACD,DIF) AND DIF>0 AND MACD>0,1,0);放空:=IF(CROSS(DIF,MACD) AND DIF<0 AND MACD<0,1,0);PARTLINE(DIF,DIF<1000,COLORCCFFFF),LINETHICK2;PARTLINE(MACD,MACD<1000,COLOR58FF58);BV:=SUM(DEF,0);BA:=IF(MAX(BV,REF(BV,2))<REF(BV,1) OR MIN(BV,REF(BV,2))>REF(BV,1),1,0);BC:=BARSLAST(BA)+1;SMACD:=BV-REF(BV,BC);V AR3:=IF(DEF>0,HHV(ABS(DEF),BC),LLV(DEF,BC));V AR4:=(DEF)/20;//{图形比例缩小1/20,可修改}V AR5:=SMACD;DRAWTEXT(REF(V AR4,1)>0 && V AR4<=0 ,REF(V AR3,1),'+REF(VAR5,1)'),COLORGREEN; DRAWTEXT(REF(V AR4,1)<0 && V AR4>=0 ,REF(VAR3,1),'+REF(ABS(V AR5),1)'),COLORFF00FF;DRAWTEXT(BARSTA TUS=2 && V AR4<0,REF(VAR3,1),'+ABS(V AR5)'),ALIGN2,COLORFF00FF;DRAWTEXT(BARSTA TUS=2 && V AR4>0,REF(VAR3,1),'+V AR5'),ALIGN2,COLORGREEN; M1:=REF(DEF,1);JC := MACD-DIF;绿柱面积:IF (DEF<0,SUM(DEF,BARSLAST(JC<0)),0),NODRAW,COLORGREEN;红柱面积:IF (DEF>0,SUM(DEF,BARSLAST(JC>0)),0),NODRAW,COLORRED;。

文华财经软件指标源码公式最准不漂移指标公式源码

文华财经软件指标源码公式最准不漂移指标公式源码

/*N=9,M1=3,M2=3}RSV:=(CLOSE-LLV(LOW,N))/(HHV(HIGH,N)-LLV(LOW,N))*100;K:=SMA(RSV,M1,1),LINETHICK2,COLORWHITE;D:=SMA(K,M2,1),COLORYELLOW;量能:=3*K-2*D,LINETHICK2;RSIE:=EMA(量能,3);DIFF : EMA(RSIE,12) - EMA(RSIE,26);BBDIFF:=DIFF-REF(DIFF,1);DEA : EMA(DIFF,9);BBDEA:=DEA-REF(DEA,1);MACD : 2*(DIFF-DEA), COLORSTICK;STICKLINE(MACD<REF(MACD,1)AND MACD>0,0,MACD,2,0),COLORFFFF00; STICKLINE(MACD<REF(MACD,1)AND MACD<0,0,MACD,2,0),COLOR00FF00; STICKLINE(MACD>REF(MACD,1)AND MACD<0,0,MACD,2,0),COLOR0099FF; STICKLINE(MACD>REF(MACD,1)AND MACD>0,0,MACD,2,0),COLORRED; 0,COLORFF8855,LINETHICK2;IF(DIFF>DEA,DIFF,DRAWNULL),COLORRED,LINETHICK2;IF(DEA>REF(DEA,1),DEA,DRAWNULL),COLORMAGENTA;DRAWICON(CROSS(DIFF,DEA),DEA,1);DRAWICON(CROSS(DEA,DIFF),DEA,2);DRAWBAND(DIFF,RGB(255,105,180),DEA,RGB(34,139,34));低位金叉:=CROSS(DIFF,DEA) AND DIFF<-0.1;STICKLINE(低位金叉,0,-1.5,2,0),COLORFFFF00;DRAWTEXT(低位金叉,-1.5,' 低位金叉'),COLORFFFF00;JCCOUNT:=COUNT(CROSS(DIFF,DEA),BARSLAST(DEA>=0));二次金叉:=CROSS(DIFF,DEA) AND DEA<0 AND COUNT(JCCOUNT=2,21)=1; STICKLINE(二次金叉,0,-1,5,0),COLORFF00FF;DRAWICON(二次金叉,DEA*1.2,11) ;VAR3:=(2*CLOSE+HIGH+LOW)/4;VAR4:=LLV(LOW,34);VAR5:=HHV(HIGH,34);QYYJ:=EMA((VAR3-VAR4)/(VAR5-VAR4)*100,13);RQQ:=EMA(0.667*REF(QYYJ,1)+0.333*QYYJ,2);DRAWTEXT(CROSS(QYYJ,RQQ) AND QYYJ<10,L-0.2,'低吸'),COLORCYAN;AR26R:=(CLOSE-LLV(LOW,27))/(HHV(HIGH,27)-LLV(LOW,27))*100;VAR28R:=SMA(VAR26R,3,1);TTWWW:= SMA(VAR28R,3,1);KUIO:= SMA(TTWWW,3,1);DRAWTEXT(TTWWW<7 AND KUIO<7 AND TTWWW>REF(TTWWW,1),L-1,'底买'),COLORGREEN;VARU:=((CLOSE-MA(CLOSE,6))/MA(CLOSE,6)*100+(CLOSE-MA(CLOSE,24))/MA(CLOSE,2 4)*100+(CLOSE-MA(CLOSE,32))/MACLOSE,32)*100)/3;DRAWTEXT(VARU<-22 AND VARU> REF(VARU,1),L,'大底'),COLORYELLOW;VAR2TX:=(CLOSE-LLV(LOW,9))/(HHV(HIGH,9)-LLV(LOW,9))*100;VAR3TX:=SMA(VAR2TX,4,1);VAR4TX:=SMA(VAR3TX,2,1);VAR5TX:=SMA(VAR4TX,2,1);DRAWTEXT(CROSS(VAR4TX,VAR5TX) AND VAR4TX<25 AND REF(C<O,1),L-0.1,'短波'),COLORWHITE;VAR01F:=(CLOSE-LLV(LOW,36))/(HHV(HIGH,36)-LLV(LOW,36))*100;VAR02F:=SMA(VAR01F,3,1);VAR03F:=SMA(VAR02F,3,1);VAR04F:=SMA(VAR03F,3,1);VAR06F:=CROSS(VAR03F,VAR04F) AND VAR03F<25;VAR07F:=VAR06F AND VOL>REF(VOL,1)*2 AND VOL>REF(MA(VOL,5),1)*2; DRAWTEXT(VAR07F,L-0.2,'波段短线'),COLORYELLOW;DRAWTEXT(二次金叉,-1,' 二次金叉'),COLORFF00FF;A1:=BARSLAST(REF(CROSS(DIFF,DEA),1));底背离:=REF(CLOSE,A1+1)>CLOSE AND DIFF>REF(DIFF,A1+1) AND CROSS(DIFF,DEA);STICKLINE(底背离,0,1.5,3,0),COLOR00FF00;DRAWLINE(A1=0,DEA,底背离,DEA,0),COLORRED,LINETHICK2; DRAWTEXT(底背离,2,' 底背离'),COLOR00FF00;A2:=BARSLAST(REF(CROSS(DEA,DIFF),1));顶背离:=REF(CLOSE,A2+1)<CLOSE AND REF(DIFF,A2+1)>DIFF AND CROSS(DEA,DIFF);STICKLINE(顶背离,0,2,3,0),COLORFF8855;DRAWLINE(A2=0,DEA,顶背离,DEA,0),COLORFF8855,*/DIF1:=EMA(CLOSE,12) - EMA(CLOSE,26);DEA1:=EMA(DIF1,9);MACD1:=2*(DIF1-DEA1),STICK;MACD2:=EMA(MACD1,3);STICKLINE1(MACD1>MACD2 AND MACD1>0,0,MACD1,1,0),COLORRED;STICKLINE1(MACD1>MACD2 AND MACD1<0,0,MACD1,1,0),COLORGREEN;STICKLINE1(MACD1<MACD2,0,MACD1,1,0),COLORCBCBC0;STICKLINE1(MACD1>=0 OR MACD1<=0,0,0,50,1),COLORWHITE;DIF:DIF1,COLOR33FF33;DEA:DEA1,COLORYELLOW;MACD:MACD1,NODRAW,COLORMAGENTA;RSV:=(CLOSE-LLV(LOW,9))/(HHV(HIGH,9)-LLV(LOW,9))*100;K:=SMA(RSV,3,1),COLORWHITE;D:=SMA(K,3,1),COLORYELLOW;J:=3*K-2*D,COLORFF00FF;MM:=IF(MACD< 0,MACD,0);JJ:=MM> REF(MM,1);ZZ:=REF(JJ,1)=1;准备:=(JJ AND ZZ)*DEA;JH:=HHV(MAX(K,MAX(D,J)),250);DH:=HHV(MAX(DIF,DEA),250);SH:=INTPART(JH/DH)/2;DIFF50:=SH*DIF+50,COLORFFFF00;DEA50:=SH*DEA+50,COLORBLUE;缩头:=IF(1.5*(DIFF50-DEA50)>0 AND REF(1.5*(DIFF50-DEA50),1)>REF(1.5*(DIFF50-DEA50),2) AND 1.5*(DIFF50-DEA50)< REF(1.5*(DIFF50-DEA50),1),1,0);缩脚:=IF(1.5*(DIFF50-DEA50)<0 AND REF(1.5*(DIFF50-DEA50),1)< REF(1.5*(DIFF50-DEA50),2) AND 1.5*(DIFF50-DEA50)>REF(1.5*(DIFF50-DEA50),1),1,0);杀多:=IF(1.5*(DIFF50-DEA50)<0 AND REF(1.5*(DIFF50-DEA50),1)> REF(1.5*(DIFF50-DEA50),2) AND 1.5*(DIFF50-DEA50)<REF(1.5*(DIFF50-DEA50),1),1,0);诱空:=IF(1.5*(DIFF50-DEA50)>0 AND REF(1.5*(DIFF50-DEA50),1)< REF(1.5*(DIFF50-DEA50),2) AND 1.5*(DIFF50-DEA50)>REF(1.5*(DIFF50-DEA50),1),1,0);阻力:=IF(CROSS(C,MA(C,20)) OR CROSS(C,MA(C,60)),10,0);DRAWTEXT(FILTER(杀多,3) AND 杀多,MACD+0.1,'杀多'),COLORFF00FF;DRAWTEXT(FILTER(缩头,3) AND 缩头,MACD+0.1,'卖'),COLORFF00FF;DRAWTEXT(FILTER(诱空,3) AND 诱空,MACD+0.1,'?洗'),COLOR00FF00;DRAWTEXT(FILTER(缩脚,3) AND 缩脚,MACD-0.1,'买'),COLOR00FF00;IF(MACD>=REF(MACD,1),DIF1,NULL),COLORRED,LINETHICK2;。

文华财经指标公式源码文华财经指标突破顶底出击

文华财经指标公式源码文华财经指标突破顶底出击

/*{-----主图资金模块-----}超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)-(超S+大S),COLORRED,NODRAW;净流入:=(超B+大B+中B+小B)-(超S+大S+中S+小S);大宗进:=(超B)+(大B);大宗出:=(超S)+(大S);非大宗进:=(中B)+(小B);非大宗出:=(中S)+(小S);主力买力度:=LARGEINTRDVOL*100/VOL,NODRAW;主力卖力度:=LARGEOUTTRDVOL*100/VOL,NODRAW; DRAWRECTREL(0,530,235,999.2,IF(120,RGB(0,10,47),0)); DAZHIV:=CONST(MAX(ABS(大宗进),MAX(ABS(大宗出),MAX(ABS(非大宗进),ABS(非大宗出))))),NODRAW;{DAZHIV:=CONST(MAX(ABS(净流入),MAX(ABS(大宗进),MAX(ABS(大宗出),MAX(ABS(非大宗进),ABS(非大宗出))))));} DRAWRECTREL(10,CONST(950-(ABS(净流入)*250/DAZHIV)),40,950,IF(CONST(净流入>0),RGB(250,0,0),RGB(0,250,0)));DRAWRECTREL(55,CONST(950-(ABS(大宗进)*250/DAZHIV)),80,950,IF(CONST(大宗进>0),RGB(255,0,255),RGB(0,0,50)));DRAWRECTREL(84,CONST(950-(ABS(大宗出)*250/DAZHIV)),109,950,IF(CONST(大宗出>0),RGB(50,50,255),RGB(255,0,0)));DRAWRECTREL(120,CONST(950-(ABS(非大宗进)*250/DAZHIV)),145,950,IF(CONST(非大宗进>0),RGB(250,0,250),RGB(0,0,50)));DRAWRECTREL(149,CONST(950-(ABS(非大宗出)*250/DAZHIV)),174,950,IF(CONST(非大宗出>0),RGB(50,50,250),RGB(255,0,0)));DRAWTEXT_FIX(CURRBARSCOUNT=1,0.00,1,0,'资金驱动主力进出散户进出'),COLORWHITE;DRAWTEXT_FIX(CURRBARSCOUNT=1,0.008,0.68,0,'净流入'),COLORRED;DRAWNUMBER_FIX(CURRBARSCOUNT=1,0.008,0.82,0,INTPART(净流入)),COLORWHITE;DRAWNUMBER_FIX(CURRBARSCOUNT=1,0.052,0.88,0,INTPART(大宗进)),COLORWHITE;DRAWNUMBER_FIX(CURRBARSCOUNT=1,0.085,0.82,0,INTPART(大宗出)),COLORWHITE;DRAWNUMBER_FIX(CURRBARSCOUNT=1,0.118,0.88,0,INTPART(非大宗进)),COLORWHITE;DRAWNUMBER_FIX(CURRBARSCOUNT=1,0.146,0.82,0,INTPART(非大宗出)),COLORWHITE;主买A:=ACTINVOL,COLORRED,NODRAW;主卖A:=ACTOUTVOL,COLORGREEN,NODRAW;主买:主买A*100/(主买A+主卖A),COLORRED,NODRAW;主卖:主卖A*100/(主买A+主卖A),COLORGREEN,NODRAW; DRAWRECTREL(0,530,176,580,RGB(0,100,0)); {DRAWRECTREL(50,530,176,580,RGB(0,125,200));} DRAWRECTREL(50,530,50+CONST(主买*120/100),580,RGB(175,50,250));DRAWTEXT_FIX(1,0.00,0.53,0,STRCAT(STRCAT('买卖比:',CON2STR(主买,2)),' %')),COLORYELLOW;DRAWTEXT_FIX(1,0.12,0.53,0,STRCAT(STRCAT('',CON2STR(主卖,2)),' %')),COLORYELLOW;DRAWRECTREL(1,580,176,630,RGB(0,50,150)); DRAWRECTREL(110,580,176,630,RGB(0,200,50));DRAWRECTREL(50,580,50+CONST(主力买力度*120/100),630,RGB(200,0,50));DRAWTEXT_FIX(1,0.00,0.58,0,STRCAT(STRCAT('买卖力:',CON2STR(主力买力度,2)),' %')),COLORYELLOW; DRAWRECTREL(110,580,176-CONST(主力买力度*120/100),630,RGB(0,50,155));DRAWTEXT_FIX(1,0.12,0.58,0,STRCAT(STRCAT('',CON2STR(主力卖力度,2)),' %')),COLORYELLOW;DDX:=(LARGEINTRDVOL-LARGEOUTTRDVOL)*100000/FINANCE(7), NODRAW;DDY:=IF(TRADENUM>0,(TRADEOUTNUM-TRADEINNUM)*100/TRAD ENUM,0);DDZ:=IF(TRADENUM>0,(LARGETRDINNUM-LARGETRDOUTNUM)/TR ADENUM*100,0);DRAWRECTREL(177,530,235,580,IF(CONST(DDX)>0,RGB(255,0,0),R GB(0,150,0)));DRAWRECTREL(177,580,235,630,IF(CONST(DDX)>0,RGB(255,0,0),R GB(0,150,0)));DRAWRECTREL(177,692,235,742,IF(CONST(DDY)>0,RGB(255,0,0),R GB(0,150,0)));DRAWRECTREL(177,742,235,792,IF(CONST(DDY)>0,RGB(255,0,0),R GB(0,150,0)));DRAWRECTREL(177,842,235,892,IF(CONST(DDZ)>0,RGB(255,0,0),R GB(0,150,0)));DRAWRECTREL(177,892,235,942,IF(CONST(DDZ)>0,RGB(255,0,0),R GB(0,150,0)));DRAWTEXT_FIX(1,0.19,0.53,0,STRCAT('',CON2STR(DDX,2))),COLOR YELLOW;DRAWTEXT_FIX(1,0.19,0.69,0,STRCAT('',CON2STR(DDY,2))),COLOR YELLOW;DRAWTEXT_FIX(1,0.19,0.84,0,STRCAT('',CON2STR(DDZ,2))),COLOR YELLOW;DRAWTEXT_FIX(CURRBARSCOUNT=1,0.180,0.64,0,'大单动向'),COLORWHITE;DRAWTEXT_FIX(CURRBARSCOUNT=1,0.180,0.80,0,'涨跌动因'),COLORWHITE;DRAWTEXT_FIX(CURRBARSCOUNT=1,0.180,0.95,0,'大单差分'),COLORWHITE;T1:=IF (DDX>0 AND REF(DDX,1)<0,1,0);T2:=IF (DDX>0 AND REF(DDX,1)>0 AND REF(DDX,2)<0,2,T1);*/高1:=REF(HHV(H,150),3);低1:=REF(LLV(L,150),3);H1:=高1-(高1-低1)*0.191;H2:=高1-(高1-低1)*0.382;H3:=高1-(高1-低1)*0.5;H4:=高1-(高1-低1)*0.618;H5:=高1-(高1-低1)*0.809;突破:REF(EMA(C,14),1),COLORMAGENTA,LINETHICK2;顶:REFX1(高1,10000),POINTDOT,COLORWHITE;A1X:=(EMA(C,14)-突破)/突破*100;出击:IF(A1X>=0,REF(EMA(C,14),BARSLAST(CROSS(A1X,0))+1),NULL),COLORRED,LINET HICK2;休假:IF(A1X<0,REF(EMA(C,14),BARSLAST(CROSS(0,A1X))+1),NULL),COLORGREEN,LINE THICK2;STICKLINE1(A1X>=0,出击,突破,0,-1),COLORRED;STICKLINE1(A1X<0,休假,突破,0,-1),COLORGREEN;STICKLINE1(CROSS(A1X,0),C,O,2,0),COLORYELLOW;STICKLINE1(CROSS(0,A1X),C,O,2,0),COLORGREEN;趋势分界线:IF(A1X<0,突破,NULL),COLORGREEN,LINETHICK2;。

文华财经软件-期货界最准确指标公式源码

文华财经软件-期货界最准确指标公式源码

文华财经软件-期货界最准确指标公式源码概述文华财经软件是一款广泛应用于期货市场的专业分析工具,其包含了丰富的技术指标和公式,以帮助投资者做出更精准的交易决策。

本文档将详细介绍文华财经软件中一些被认为是最准确的指标公式源码,旨在为专业投资者和分析师提供深度的技术分析能力。

指标公式概览以下是一些在文华财经软件中应用广泛的指标公式源码,它们为用户提供了多角度的市场分析。

移动平均线(MA)移动平均线是最常用的技术指标之一,它通过计算一定时间段内的平均价格来展示市场趋势。

常用源码示例def calculate_ma(prices, window_size):return sum(prices[-window_size:]) / window_size使用示例prices = [关闭价格1, 关闭价格2, ..., 关闭价格N]window_size = 10 # 例如,使用10日移动平均线ma = calculate_ma(prices, window_size)相对强弱指数(RSI)相对强弱指数是一个动量指标,用来评估股票或其他资产过度买入或过度卖出的情况。

RSI计算的简化版源码示例def calculate_rsi(price_changes, window_size):计算平均变化avg_gain = sum(change for change in price_changes if change > 0) / window_sizeavg_loss = sum(abs(change) for change in price_changes if change < 0) / window_size计算RSrs = avg_gain / avg_loss if avg_loss != 0 else 0计算RSIrsi = 100 - (100 / (1 + rs))return rsi使用示例price_changes = [价格变化1, 价格变化2, ..., 价格变化N]window_size = 14 # 例如,使用14日RSIrsi_value = calculate_rsi(price_changes, window_size)布林带(Bollinger Bands)布林带是由标准差定义的通道,它围绕移动平均线,可以用来衡量市场的波动性。

文华财经期货指标公式源码极高胜率交易系统公式源码

文华财经期货指标公式源码极高胜率交易系统公式源码

/*VAR1:=(H+L+O+3*C)/6;WLT:=EMA(VAR1,3);WLTA:=EMA(WLT,1),COLORFFFFFF;空:HHV(MA(H,3),2),LINETHICK2,COLOR00DD00;多:LLV(MA(H,3),1),LINETHICK2,COLOR0000DD;JCBT:=LAST(多<空,9,1) AND 多=空;STICKLINE(JCBT,O,(O+C)/2,4,0),COLOR0000FF;DRAWTEXT(JCBT,L*0.98,'短B'),COLOR0000FF;{超跌反弹买点}VARA:=(C-REF(O,21))/REF(O,21)*100;VARB:=EMA(0.667*REF(VARA,1)+0.333*VARA,5);WLBT1:=V>=1.3*MA(V,5) AND REF(L,1)=LLV(L,55) AND VARA>=VARB AND VARA<-6.18; WLBT2:=V>=1.3*MA(V,5) AND CROSS(VARA,VARB) AND VARA<-10.18;WLBT:=WLBT1 OR WLBT2;DRAWTEXT(WLBT,L*0.98,'反弹'),COLOR00FFFF;STICKLINE(WLBT,C,O,3,0),COLOR00FFFF;{卖点设置}S1:=EMA(EMA(EMA(C,8),13),55);S2:=(REF(H,1)+REF(L,1))/2;S3:=MA(C,21)+2*STD(C,21);ST11:=CROSS(S2,S3);S4:=REF(C,1);S5:=SMA(MAX(C-S4,0),7,1)/SMA(ABS(C-S4),7,1)*100;S6:=CROSS(80,S5);ST2:=FILTER(S6,5);V1:=EMA(EMA(EMA(C,8),13),55);V2:=(REF(H,1)+REF(L,1))/2;V3:=MA(C,21)+2*STD(C,21);V4:=REF(C,1);V5:=SMA(MAX(C-V4,0),7,1)/SMA(ABS(C-V4),7,1)*100;V6:=CROSS(80,V5);ST:=FILTER(V6,5);DRAWICON(ST11,H*1.030,19);DRAWICON(ST2,HIGH*1.033,12);DRAWTEXT(ST OR CROSS(V2,V3),HIGH*1.02,'卖'),COLORGREEN;{乖离共振买点}BIAS6:=(C-MA(C,6))/MA(C,6)*100;BIAS12:=(C-MA(C,12))/MA(C,12)*100;BIAS24:=(C-MA(C,24))/MA(C,24)*100;TJ1:=BIAS6<=-8;TJ2:=BIAS12<=-12;TJ3:=BIAS24<=-18;BBT:=(TJ1 AND TJ2 AND TJ3) OR (TJ1 AND TJ2 ) OR (TJ1 AND TJ3);BTJ5:=CROSS(BIAS6,-10);BTJ6:=CROSS(BIAS6,-6.2);BIASXG:=FILTER(BBT OR BTJ5 OR BTJ6,3);STICKLINE(BIASXG,C,O,0.11,0),COLOR0078FF;DRAWTEXT(BIASXG,L*0.98,'BIAS'),COLOR0078FF;{以上3组信号综合或共振买点}WLTBT:=COUNT(WLBT OR JCBT OR BIASXG,2);XG1:=WLTBT>=2;XG:=FILTER(XG1,3);DRAWTEXT(XG,L*0.99,'金牛'),COLOR00FFFF;{选股及成功率统计}年选股:SUM(XG,250),NODRAW;设定利润:=REF(XG,20) AND HHV(H,20)>=REF(C,20)*1.15;{20个交易日内涨15%} 成功数:SUM(设定利润,250),NODRAW;成功率%:成功数/年选股*100,NODRAW;{基本面技术面数据解盘}套牢盘%:=100*(1-WINNER(C));获利盘%:=100*WINNER(C);集中度90%:=(COST(95)-COST(5))/(COST(100))*100;集中度70%:=(COST(85)-COST(15))/(COST(100))*100;平均成本:=COST(50);主力成本:=COST(5);最高:=HHV(H,21);最低:=LLV(L,21);PT:=REF(HIGH,1)-REF(LOW,1);中价:=(H+L+C)/3;近高:=2*中价-LOW;近低:=2*中价-HIGH;短期压力:=中价+PT;短期支撑:=中价-PT;DRAWTEXT_FIX(1,0.02,0.00,0,'【获利盘%】'),COLORRED;DRAWTEXT_FIX(1,0.02,0.06,0,'【套牢盘%】'),COLOR00FF00;DRAWTEXT_FIX(1,0.02,0.12,0,'【90%成本】'),COLORYELLOW;DRAWTEXT_FIX(1,0.02,0.18,0,'【70%成本】'),COLOR008FFF;DRAWTEXT_FIX(1,0.02,0.24,0,'【平均成本】'),COLORFF99FF;DRAWTEXT_FIX(1,0.02,0.30,0,'【主力成本】'),COLORFF00FF;DRAWTEXT_FIX(1,0.02,0.36,0,'【短期压力】'),COLORFFFFBF;DRAWTEXT_FIX(1,0.02,0.42,0,'【短期支撑】'),COLORF0F000;DRAWTEXT_FIX(1,0.3,0.00,0,'【中价】'),COLORWHITE;DRAWTEXT_FIX(1,0.3,0.06,0,'【近高】'),COLORFFFFBF;DRAWTEXT_FIX(1,0.3,0.12,0,'【近低】'),COLORF0F000;DRAWTEXT_FIX(1,0.3,0.18,0,'【最高】'),COLORFF99FF;DRAWTEXT_FIX(1,0.3,0.24,0,'【最低】'),COLORFF00FF;DRAWNUMBER_FIX(1,0.16,0.00,0,CONST(获利盘%)),COLORRED;DRAWNUMBER_FIX(1,0.16,0.06,0,CONST(套牢盘%)),COLOR00FF00; DRAWNUMBER_FIX(1,0.16,0.12,0,CONST(集中度90%)),COLORYELLOW; DRAWNUMBER_FIX(1,0.16,0.18,0,CONST(集中度70%)),COLOR008FFF; DRAWNUMBER_FIX(1,0.16,0.24,0,CONST(平均成本)),COLORFF99FF; DRAWNUMBER_FIX(1,0.16,0.30,0,CONST(主力成本)),COLORFF00FF; DRAWNUMBER_FIX(1,0.16,0.36,0,CONST(短期压力)),COLORFFFFBF; DRAWNUMBER_FIX(1,0.16,0.42,0,CONST(短期支撑)),COLORF0F000; DRAWNUMBER_FIX(1,0.38,0.00,0,CONST(中价)),COLORWHITE;DRAWNUMBER_FIX(1,0.38,0.06,0,CONST(近高)),COLORFFFFBF;DRAWNUMBER_FIX(1,0.38,0.12,0,CONST(近低)),COLORF0F000;DRAWNUMBER_FIX(1,0.38,0.18,0,CONST(最高)),COLORFF99FF;DRAWNUMBER_FIX(1,0.38,0.24,0,CONST(最低)),COLORFF00FF;DRAWTEXT_FIX(1,0.5,0.0,0,'【每股收益 (元)】:'),COLOR0000FF;DRAWNUMBER_FIX(1,0.63,0.00,0,FINANCE(33)),COLOR0000FF;DRAWTEXT_FIX(1,0.5,0.06,0,'【每股净资产(元)】:'),COLOR00FFFF; DRAWNUMBER_FIX(1,0.63,0.06,0,FINANCE(34)),COLOR00FFFF;BHD:=(AMOUNT/C)/HHV((AMOUNT/C),26)*100;DRAWTEXT_FIX(1,0.5,0.12,0,'【量能饱和度℅】:'),COLORFF00FF;DRAWNUMBER_FIX(1,0.63,0.12,0,CONST(BHD)),COLORFF00FF;PSY:=COUNT(C>REF(C,1),34)/34*100;DRAWTEXT_FIX(1,0.5,0.18,0,'【心理乐观度℅】:')COLOR00FF00;DRAWNUMBER_FIX(1,0.63,0.18,0,CONST(PSY)),COLOR00FF00;{五里头操作理念}DRAWTEXT_FIX(1,0.0,0.98,0,'★五里理念★:改掉恶习,严守纪律,趋势为先,波段操作;安全第一,坚决止损! ★:本指标依据:多空转化→【短B】、超跌反弹→【反弹】、*/ MID:=(2.97*CLOSE+LOW+OPEN+HIGH)/6;主力:(20*MID+19*REF(MID,1)+18*REF(MID,2)+17*REF(MID,3)+16*REF(MID,4)+15*REF(MID,5)+14*REF(MID,6)+13*REF(MID,7)+12*REF(MID,8)+11*REF(MID,9)+10*REF(MID,10)+9*REF(MID,11)+8*REF(MID,12)+7*REF(MID,13)+6*REF(MID,14)+5*REF(MID,15)+4*REF(MID,16)+3*REF(MID,17)+2*REF(MID,18)+REF(MID,20))/210,COLORRED,LINETHICK2; DRAWCOLORLINE(主力>REF(主力,1),主力,COLORRED,COLORGREEN),LINETHICK2;。

文华财经指标公式源码文华财经指标强势区弱势区方向线

文华财经指标公式源码文华财经指标强势区弱势区方向线

/* REF(ZIG(3,51),2)>=REF(ZIG(3,51),3);VAR17:=ZIG(3,72)>REF(ZIG(3,72),1) ANDREF(ZIG(3,72),1)<=REF(ZIG(3,72),2) ANDREF(ZIG(3,72),2)<=REF(ZIG(3,72),3);VAR18:=ZIG(3,72)<REF(ZIG(3,72),1) ANDREF(ZIG(3,72),1)>=REF(ZIG(3,72),2) ANDREF(ZIG(3,72),2)>=REF(ZIG(3,72),3);VAR19:=EMA(CLOSE,2)-EMA(CLOSE,150);VAR1A:=EMA(VAR19,100);VAR1B:=2*(VAR19-VAR1A);VAR1C:=POW(VAR1B,3)*0.1+POW(VAR1B,1); VAR1D:=SQRT(SQRT(LOW*HIGH*OPEN*CLOSE)); VAR1E:=EMA(VAR1D*0.97,3);VAR1F:=(HIGH+LOW+CLOSE)/3;VAR20:=(VAR1F-MA(VAR1F,14))/(0.015*AVEDEV(VAR1F,14));VAR21:=CROSS(VAR1E,LOW);买点一:=VAR10;买点二:=(VAR11+VAR13+VAR15+VAR17);卖点一:=(VAR12+VAR14+VAR16+VAR18);VAR22:=买点一 AND VARF AND VARC AND VAR21 AND VAR4<0 AND VAR5=0 AND VAR6=0 AND VAR20<(-110);VAR1:=MA(CLOSE,6);VAR2:=MA(CLOSE,18);VAR31:=MA(CLOSE,30);VARB1:=SUM(CLOSE*VOL*100,28)/SUM(VOL*100,28);VARC1:=INTPART(VARB1*100)/100;VARD1:=EMA(CLOSE,5)-EMA(CLOSE,10);VARE1:=EMA(VARD1,9);VAR131:=REF(VARE1,1);VAR141:=VARE1;VAR151:=VAR141-VAR131;VAR161:=REF(VARD1,1);VAR171:=VARD1;VAR181:=VAR171-VAR161;VAR191:=OPEN;VAR1A1:=CLOSE;DRAWTEXT(买点一>0,LOW-0.01,'▲买!'),COLORRED; DRAWTEXT(买点二>0,LOW-0.01,'▲买涨'),COLORYELLOW; DRAWTEXT(卖点一>0,HIGH+0.1,'▼卖跌'), COLORWHITE;A1:=BARSCOUNT(CLOSE);AH:=HHV(HIGH,72);AL:=LLV(LOW,72);A0:=(AH-AL)/21;B1:=LOW-A0;DRAWTEXT((A1+0)/15=FLOOR((A1+0)/15),B1-2.5*A0,'▲时窗'),COLORWHITE;VAR51:=HHVBARS(ZIG(3, 19)>REF(ZIG(3,19),1)AND REF(ZIG(3,19), 1)<REF(ZIG(3,19), 2),0);STICKLINE(VAR51=2,LOW*0.95,LOW*0.98,8,0),COLOR0000FF; DRAWTEXT(VAR51=2,LOW*0.95,'3天'),COLORWHITE; STICKLINE(VAR51=4,HIGH*1.05,HIGH*1.02,8,0),COLOR9966FF; DRAWTEXT(VAR51=4,HIGH*1.06,'5天'),COLORWHITE; STICKLINE(VAR51=7,LOW*0.95,LOW*0.98,8,0),COLOR00FFFF; DRAWTEXT(VAR51=7,LOW*0.95,'8天'),COLORWHITE; STICKLINE(VAR51=12,HIGH*1.05,HIGH*1.02,8,0),COLORFF33FF; DRAWTEXT(VAR51=12,HIGH*1.06,'13天'),COLORWHITE; STICKLINE(VAR51=20,LOW*0.95,LOW*0.98,8,0),COLOR0066FF; DRAWTEXT(VAR51=20,LOW*0.95,'21天'),COLORWHITE;STICKLINE(VAR51=33,HIGH*1.05,HIGH*1.02,8,0),COLORFFFF00; DRAWTEXT(VAR51=33,HIGH*1.06,'34天'),COLORWHITE; STICKLINE(VAR51=54,LOW*0.95,LOW*0.98,8,0),COLORWHITE; DRAWTEXT(VAR51=54,LOW*0.95,'55天'),COLORWHITE; STICKLINE(VAR51=88,HIGH*1.05,HIGH*1.02,8,0),COLOR00FF00; DRAWTEXT(VAR51=88,HIGH*1.06,'89天'),COLORWHITE; STICKLINE(VAR51=143,LOW*0.95,LOW*0.98,8,0),COLORCCFFFF; DRAWTEXT(VAR51=143,LOW*0.95,'144天'),COLORWHITE; STICKLINE(VAR51=232 ,HIGH*1.05,HIGH*1.02,8,0),COLORFF0033; DRAWTEXT(VAR51=232,HIGH*1.06,'233天'),COLORWHITE; STICKLINE(VAR51=376,LOW*0.95,LOW*0.98,8,0),COLORFF9966; DRAWTEXT(VAR51=376,LOW*0.95,'377天'),COLORWHITE;立春:=FILTER(MONTH=2 AND (DAY=3 OR DAY=5 ),2);雨水:=FILTER(MONTH=2 AND (DAY=18 OR DAY=20),2);惊蛰:=FILTER(MONTH=3 AND (DAY=5 OR DAY=7 ),2);春分:=FILTER(MONTH=3 AND (DAY=20 OR DAY=22),2);清明:=FILTER(MONTH=4 AND (DAY=3 OR DAY=6 ),2);谷雨:=FILTER(MONTH=4 AND (DAY=19 OR DAY=21),2);立夏:=FILTER(MONTH=5 AND (DAY=6 OR DAY=8 ),2);小满:=FILTER(MONTH=5 AND (DAY=20 OR DAY=22),2);芒种:=FILTER(MONTH=6 AND (DAY=5 OR DAY=7 ),2);夏至:=FILTER(MONTH=6 AND (DAY=20 OR DAY=22),2);小暑:=FILTER(MONTH=7 AND (DAY=6 OR DAY=8 ),2);大署:=FILTER(MONTH=7 AND (DAY=22 OR DAY=24),2); 立秋:=FILTER(MONTH=8 AND (DAY=7 OR DAY=9 ),2);处暑:=FILTER(MONTH=8 AND (DAY=22 OR DAY=24),2); 白露:=FILTER(MONTH=9 AND (DAY=7 OR DAY=9 ),2);秋分:=FILTER(MONTH=9 AND (DAY=22 OR DAY=24),2); 寒露:=FILTER(MONTH=10 AND (DAY=7 OR DAY=9 ),2); 霜降:=FILTER(MONTH=10 AND (DAY=22 OR DAY=24),2); 立冬:=FILTER(MONTH=11 AND (DAY=7 OR DAY=9 ),2); 小雪:=FILTER(MONTH=11 AND (DAY=22 OR DAY=24),2); 大雪:=FILTER(MONTH=12 AND (DAY=6 OR DAY=8 ),2); 冬至:=FILTER(MONTH=12 AND (DAY=21 OR DAY=23),2); 小寒:=FILTER(MONTH=1 AND (DAY=5 OR DAY=7 ),2);大寒:=FILTER(MONTH=1 AND (DAY=19 OR DAY=21),2); GET:ZIG(3,5),COLORWHITE,LINETHICK1;*/N:=90;M:=3;低:=REF(LLV(L,N),M);低点:=REFX1(低,10000);RRF:低点=L AND ((C-L)>(O-C) OR (O-L)>(C-O)),STICK;STICKLINE1(IF(RRF,-120,0),+12,0,4,0),COLOR000088;STICKLINE1(IF(RRF,-120,0),+12,0,3,0),COLOR0000AA;STICKLINE1(IF(RRF,-120,0),+12,0,2,0),COLOR0000CC;STICKLINE1(IF(RRF,-120,0),+12,0,1.4,0),COLOR0000EE;STICKLINE1(IF(RRF,-120,0),+12,0,0.9,0),COLOR0000EE;STICKLINE1(IF(RRF,-120,0),+12,0,0.3,0),COLORMAGENTA; STICKLINE1(IF(RRF,-120,0),+9,0,7,0),COLOR770077; STICKLINE1(IF(RRF,-120,0),+9,0,6,0),COLOR990099; STICKLINE1(IF(RRF,-120,0),+9,0,5,0),COLORBB00BB; STICKLINE1(IF(RRF,-120,0),+9,0,4,0),COLORDD00DD; STICKLINE1(IF(RRF,-120,0),+9,0,3,0),COLORFF00FF; STICKLINE1(IF(RRF,-120,0),+9,0,2,0),COLORDD00DD; STICKLINE1(IF(RRF,-120,0),+6,0,7,0),COLOR003300; STICKLINE1(IF(RRF,-120,0),+6,0,6,0),COLOR005500; STICKLINE1(IF(RRF,-120,0),+6,0,5,0),COLOR007700; STICKLINE1(IF(RRF,-120,0),+6,0,3.5,0),COLOR009900; STICKLINE1(IF(RRF,-120,0),+6,0,2,0),COLOR00CC00; STICKLINE1(IF(RRF,-120,0),+3,0,7,0),COLOR666666; STICKLINE1(IF(RRF,-120,0),+3,0,6,0),COLOR777777; STICKLINE1(IF(RRF,-120,0),+3,0,5,0),COLOR888888; STICKLINE1(IF(RRF,-120,0),+3,0,4,0),COLOR999999; STICKLINE1(IF(RRF,-120,0),+3,0,3,0),COLORDDDDDD; STICKLINE1(IF(RRF,-120,0),+3,0,2,0),COLORFFFFFF; STICKLINE1(IF(RRF,-120,0),-3,0,7,0),COLOR000044; STICKLINE1(IF(RRF,-120,0),-3,0,6,0),COLOR000033; STICKLINE1(IF(RRF,-120,0),-3,0,5,0),COLOR000055; STICKLINE1(IF(RRF,-120,0),-3,0,4,0),COLOR000077; STICKLINE1(IF(RRF,-120,0),-3,0,3,0),COLOR000099; STICKLINE1(IF(RRF,-120,0),-3,0,2,0),COLORMAGENTA; DRAWTEXT(RRF,10.5,''),COLORYELLOW;DRAWTEXT(RRF,7.5,'翻'),COLORYELLOW;DRAWTEXT(RRF,4.5,'天'),COLORRED;DRAWTEXT(RRF,1.5,'印'),COLORRED;DRAWTEXT(RRF,-1.5,''),COLORYELLOW;V AR1:=(2*CLOSE+HIGH+LOW)/4;V AR2:=EMA(EMA(EMA(V AR1,4),4),4);J: (V AR2-REF(V AR2,1))/REF(V AR2,1)*100, COLORSTICK; D: MA(J,3);K: MA(J,1);DRAWICON(CROSS(D,J),J,5);DRAWICON(CROSS(J,D),D,4);BUYHAOGU:0;。

文华财经指标公式源码文华财经指标 笑脸哭脸

文华财经指标公式源码文华财经指标 笑脸哭脸

/*AR5S:=HHV(HIGH,4);散户:=EMA((VAR2S-VAR4S)/(VAR5S-VAR4S)*100,4)*VAR3S; 庄家:=EMA(0.667*REF(散户,1)+0.333*散户,2)*VAR3S; DRAWTEXT(CROSS(散户,庄家) AND 散户<30,L-0.05,'←吸'),COLORRED;{神秘心理指标}均价:=(OPEN+HIGH+LOW+CLOSE*2)/5,NODRAW;突破:均价+HIGH-LOW,NODRAW;阻力:均价*2-LOW,NODRAW;支撑:=均价*2-HIGH,NODRAW;下降:=均价-HIGH+LOW,NODRAW;心理:=(均价+突破+阻力+支撑+下降)/5,NODRAW,COLORRED;m1 1 60 3m2 1 60 19趋势:=EXPMA(CLOSE,12),NODRAW,COLORYELLOW;{涨停不破价}ZT:=C/REF(C,1)>1.097;ZTBPJ:=REF(C,BARSLAST(ZT)+1)*0.98;{涨停不破价}ZTBP:=BARSLAST(ZT)<30 AND (LLV(C,BARSLAST(ZT))>=ZTBPJ OR LLV(C,BARSLAST(ZT))=ZTBPJ);{涨停不破价}STICKLINE(ZTBP,REF(C,BARSLAST(ZT)+1)-REF(C,BARSLAST(ZT)+1) *0.001,REF(C,BARSLAST(ZT)+1),1,0),COLORYELLOW;不破价:=REF(L,BARSLAST(ZT));LS0:=BARSLAST(ZT);LS11:=IF(2,LS0=2,ZT);LS21:=IF(2,LLV(L,2)>REF(L,2),1);ZT不破2:=LS11 AND LS21;DRAWTEXT(ZT不破2,不破价-不破价*0.02,'3'),COLORGREEN;LS14:=IF(4,LS0=4,ZT);LS24:=IF(4,LLV(L,4)>REF(L,4),1);ZT不破4:=LS14 AND LS24;DRAWTEXT(ZT不破4,不破价-不破价*0.02,'5'),COLORGREEN;LS17:=IF(7,LS0=7,ZT);LS27:=IF(7,LLV(L,7)>REF(L,7),1);ZT不破7:=LS17 AND LS27;DRAWTEXT(ZT不破7,不破价-不破价*0.02,'8'),COLORGREEN;LS22:=IF(12,LS0=12,ZT);LS32:=IF(12,LLV(L,12)>REF(L,12),1);ZT不破12:=LS22 AND LS32;DRAWTEXT(ZT不破12,不破价-不破价*0.02,'13'),COLORGREEN; XH:=FILTER(ZT,13);BH:=BARSLAST(ZT);CZ:=REF(H,BH)-REF(L,BH);迫线:=C>O AND V>REF(V,1) AND L>REF(C,1) AND REF(ZT,1);小阳:=C>O AND V>REF(V,1) AND REF(ZT,1);起爆:=REF(HHV(V,8),1)/V>=1.97 AND REF(HHV(小阳,8),1) AND C>O; STICKLINE(ZT,REF(O,BH),REF(C,BH),2,0),COLORYELLOW; STICKLINE(迫线,O,C,2,0),COLORMAGENTA;盘整天数:=5;{盘整天数自己调,以5--7日为最佳}下探幅度:=5;上冲幅度:=25;涨停:=(C-REF(C,1))/REF(C,1)>0.09;{涨幅大于9个点}缩量:=HHV(VOL,盘整天数-2)<REF(VOL,盘整天数-1) ANDSUM(VOL, 盘整天数)>2* SUM(VOL, 盘整天数-2);七伤拳:=缩量 AND REF(涨停,盘整天数) AND COUNT(涨停,盘整天数+1)=1 AND (HHV(H,盘整天数)-REF(C,盘整天数))/REF(C,盘整天数)*100<上冲幅度 AND (LLV(L,盘整天数)-REF(C,盘整天数))/REF(C,盘整天数)*100>(下探幅度*-1);DRAWTEXT(七伤拳,LOW*0.98,'七伤拳'),COLORRED;*/G:=MA(C,5);DY:=MA(C,10);NNH:=BARSLAST(H=HHV(H,7)) ,NODRAW;NNL:=BARSLAST(L=LLV(L,7)) ,NODRAW;NN:=IF(REF(G,NNH)>REF(DY,NNH) AND NNH<=4,NNH,IF(REF(G,NNL)<REF(DY,NNL) AND NNL<=4,NNL,5)) ,NODRAW;YN:=IF(ISLASTBAR AND NN>0,NN,5) ,NODRAW;HHY:=REF(H,YN)=HHV(H,6);LL Y:=REF(L,YN)=LLV(L,6);FG01:=BACKSET(HHY,YN+1)>BACKSET(HHY,YN),NODRAW;//只设置前面第6个FD01:=BACKSET(LL Y,YN+1)>BACKSET(LL Y,YN) ,NODRAW;FG02:=FG01=FD01 AND G>DY,NODRAW;FD02:=FG01=FD01 AND G<DY,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,BARSLAST(FD01)))) AND FD02=0 ,NODRAW;FD0:=FD01 AND IF(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 ANDREFX(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(DY,BARSLAST(L=LLV(L,7))),BARSLAST(L=LL V(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(DY,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;XX:=BACKSET(ISLASTBAR,SUMBARS(HHH,3));ZZ:=BACKSET(ISLASTBAR,SUMBARS(LLL,3));Q:=BACKSET(ISLASTBAR,SUMBARS(HHH,1));W:=BACKSET(ISLASTBAR,SUMBARS(LLL,1));DRAWLINE1(HHH&&XX,H,HHH&&Q,H,1);DRAWLINE1(LLL&&ZZ,L,LLL&&W,L,1);N:=2;//N是调整标注的距离的,需要根据加载的合约自行修改DRAWICON(HHH,H+N*MINPRICE,'ICO17');DRAWICON(LLL,L-N*MINPRICE,'ICO16'),VALIGN0;。

文华财经指标公式源码MACD共振公式源码

文华财经指标公式源码MACD共振公式源码

/*LC:=REF(CLOSE,1);RSI5:=((SMA(MAX((CLOSE - LC),0),5,1) / SMA(ABS((CLOSE - LC)),5,1)) * 100);TR1:=SUM(MAX(MAX((HIGH - LOW),ABS((HIGH - REF(CLOSE,1)))),ABS((LOW - REF(CLOSE,1)))),10);HD:=(HIGH - REF(HIGH,1));LD:=(REF(LOW,1) - LOW);DMP:=SUM(IF(((HD > 0) AND (HD > LD)),HD,0),10);DMM:=SUM(IF(((LD > 0) AND (LD > HD)),LD,0),10);PDI:=((DMP * 100) / TR1);MDI:=((DMM * 100) / TR1);ADX:=MA(((ABS((MDI - PDI)) / (MDI + PDI)) * 100),5);AV:=(RSI5 + ADX);DXR:=(((ADX + REF(ADX,5)) / 2) + RSI5);0,COLORFF00FF;WR10:=((100 * (HHV(HIGH,10) - CLOSE)) / (HHV(HIGH,13) - LLV(LOW,13))); NEWVOL:=(RSI5 - WR10);阶段底部:=(AV + NEWVOL);一本:=LLV(阶段底部,1);STICKLINE(CROSS(阶段底部,0),0,-10,0.1,1),LINETHICK6,COLORRED;STICKLINE((一本 >193 ),100,90,0.1,1),LINETHICK6,COLORGREEN;Y1:=LLV(L,17);Y2:=SMA(ABS(L-REF(L,1)),17,1);Y3:=SMA(MAX(L-REF(L,1),0),17,2);Q:=-(EMA(IF(L<=Y1,Y2/Y3,-3),1));STICKLINE(CROSS(Q,0),15,0,4,0), , COLORYELLOW;强拉升: IF(CROSS(Q,0),1,0),COLORYELLOW;Q1:= (CLOSE-MA(CLOSE,40))/MA(CLOSE,40)*100, , COLOR00FF00,LINETHICK2; STICKLINE(CROSS(Q1,-24),20,0,4,0), , COLORMAGENTA;加强拉升:=IF(CROSS(Q1,-24),1,0),COLORMAGENTA;VAR1:=EMA(EMA(CLOSE,9),9);控盘:=(VAR1-REF(VAR1,1))/REF(VAR1,1)*1000;LOWV:=LLV(LOW,9);HIGHV:=HHV(HIGH,9);RSV:=EMA((CLOSE-LOWV)/(HIGHV-LOWV)*100,3);K:=EMA(RSV,3);D:=MA(K,3);STICKLINE(K>D , K,D ,1.1,0),COLORRED,LINETHICK2;STICKLINE(D>K,K,D,1.1,0),COLORGREEN,LINETHICK2;逃顶线:90,COLORGREEN;一枪光:=147,COLORCYAN;抄底线:=10,COLORGREEN;R1:=1;R2:=((((2*CLOSE)+HIGH)+LOW) / 4);R4:=LLV(LOW,5);R5:=HHV(HIGH,4);C1:=(EMA((((R2-R4)/(R5-R4))*100),4)*R1),COLORFF00FF,LINETHICK2;C2:=(EMA(((0.667*REF(C1,1))+(0.333*C1)),2)*R1),COLORFFFFFF,LINETHICK2; 条:=CROSS(C1,C2) AND C1<40;STICKLINE(条,0,-10,2,0),COLORRED;*/DIF15:=EMA(CLOSE*100,6)-EMA(CLOSE*100,13);DEA15:=EMA(DIF15,9);MACD0015:=(DIF15-DEA15)*2,COLORSTICK;做多15:=DIF15>REF(DIF15,1);做多16:=DEA15>REF(DEA15,1);DIF30:=EMA(CLOSE*100,12)-EMA(CLOSE*100,26);DEA30:=EMA(DIF30,9);MACD0030:=(DIF30-DEA30)*2,COLORSTICK;做多30:=DIF30>REF(DIF30,1);做多31:=DEA30>REF(DEA30,1);DIF60:=EMA(CLOSE*100,24)-EMA(CLOSE*100,52);DEA60:=EMA(DIF60,9);MACD0060:=(DIF60-DEA60)*2,COLORSTICK;做多60:=DIF60>REF(DIF60,1);做多61:=DEA60>REF(DEA60,1);DIF日:=EMA(CLOSE*100,77)-EMA(CLOSE*100,208); DEA日:=EMA(DIF日,32);MACD00日:=(DIF日-DEA日)*2,COLORSTICK;做多日:=DIF日>REF(DIF日,1);做多日1:=DEA日>REF(DEA日,1);DIF周:=EMA(CLOSE*100,480)-EMA(CLOSE*100,1040); DEA周:=EMA(DIF周,66);MACD00周:=(DIF周-DEA周)*2,COLORSTICK;做多周:=DIF周>REF(DIF周,1);做多周1:=DEA周>REF(DEA周,1);MACD15:50,COLORGRAY,LINETHICK2;MACD30:40,COLORGRAY,LINETHICK2;MACD60:30,COLORGRAY,LINETHICK2;MACD日:20,COLORGRAY,LINETHICK2;MACD周:10,COLORGRAY,LINETHICK2;57,COLOR222222;3,COLOR222222;IF(做多15,MACD15,NULL),COLORRED,LINETHICK7;IF(做多30,MACD30,NULL),COLORRED,LINETHICK7;IF(做多60,MACD60,NULL),COLOR0066CC,LINETHICK7; IF(做多日,MACD日,NULL),COLOR0066CC,LINETHICK7; IF(做多周,MACD周,NULL),COLOR0066CC,LINETHICK7;。

文华财经指标公式源码MACD绿柱面积红柱面积公式源码

文华财经指标公式源码MACD绿柱面积红柱面积公式源码

/*3.3,COLOR555555;0.45,COLOR555555;R0:=1;MA5:=MA(R0,5);最小值:=LLV(LOW,10);最大值:=HHV(HIGH,25);波动线:=EMA((CLOSE-最小值)/(最大值-最小值)*4,4);平均线:EMA(波动线,3);主力攻击:=R0-(ABS(REF(R0,1))+ABS(REF(R0,2))+ABS(REF(R0,3))+ABS(REF(R0,4))+ABS(REF( R0,5))/2)>0 AND 平均线>=REF(平均线,1) AND REF(平均线,1)<REF(平均线,2);主力撤退:=R0+(ABS(REF(R0,1))+ABS(REF(R0,2))+ABS(REF(R0,3))+ABS(REF(R0,4))+ABS(REF( R0,5))/2)<0 AND 平均线<=REF(平均线,1) AND REF(平均线,1)>REF(平均线,2); DRAWTEXT(主力攻击>0,1.5,'主进'),colorred;DRAWTEXT(主力撤退<0,2.8,'主退'),colorgreen;信息:=平均线>=REF(平均线,1);走强:=CLOSE>MA(CLOSE,20)AND CLOSE>MA(CLOSE,5);走弱:=CLOSE<MA(CLOSE,10)AND CLOSE<MA(CLOSE,5);量:=VOL>MA(VOL,5);STICKLINE(平均线>=REF(平均线,1),波动线,REF(波动线,1),6,0),colorred;STICKLINE(平均线<REF(平均线,1),波动线 ,REF(波动线,1),6,0),colorgreen;D:=信息=1 AND REF(信息,1)=0 AND (REF(信息,2)+REF(信息,3)=0) AND 平均线<0.5; S:=信息=1 AND REF(信息,1)=0 AND (REF(信息,2)+REF(信息,3)=0) AND 走强=1 AND REF(走强,1)=0 AND 量=1;DD:=平均线>2 AND (信息=0 AND REF(信息,1)=1) AND (REF(信息,2)+REF(信息,3)=2); TZ:=(信息=0 AND REF(信息,1)=1) AND (REF(信息,2)+REF(信息,3)=2) AND MA5<0AND 走弱=1 AND 平均线>1;DRAWTEXT(D=1,1.75,'极底'),colorred;DRAWTEXT(S=1,平均线,'升');DRAWTEXT(DD=1,平均线,'顶');DRAWTEXT(TZ=1,平均线,'下');IF(平均线>=REF(平均线,1),平均线,DRAWNULL),colorred,LINETHICK2;IF(平均线<REF(平均线,1),平均线,DRAWNULL),colorgreen,LINETHICK2;LC:=REF(CLOSE,1);RSI5:=((SMA(MAX((CLOSE - LC),0),5,1) / SMA(ABS((CLOSE - LC)),5,1)) * 100);TR1:=SUM(MAX(MAX((HIGH - LOW),ABS((HIGH - REF(CLOSE,1)))),ABS((LOW - REF(CLOSE,1)))),10);HD:=(HIGH - REF(HIGH,1));LD:=(REF(LOW,1) - LOW);DMP:=SUM(IF(((HD > 0) AND (HD > LD)),HD,0),10);DMM:=SUM(IF(((LD > 0) AND (LD > HD)),LD,0),10);PDI:=((DMP * 100) / TR1);MDI:=((DMM * 100) / TR1);ADX:=MA(((ABS((MDI - PDI)) / (MDI + PDI)) * 100),5);AV:=(RSI5 + ADX);WR10:=((100 * (HHV(HIGH,10) - CLOSE)) / (HHV(HIGH,10) - LLV(LOW,10)));ZCJL:=(RSI5 - WR10);最佳买入:=(AV + ZCJL);最佳买入选股:=IF(CROSS(最佳买入,0),1,0);VAR5:=SMA(最佳买入选股,3,1);VAR6:=SMA(VAR5,3,1);VAR7:=SMA(VAR6,3,1);建仓买点:=IF(CROSS(VAR6,VAR7) AND (VAR6<40),5,0);DRAWTEXT(建仓买点,0.75,'建仓'),colorred;VAR8:=REF(CLOSE,2);会员:=SMA(MAX(CLOSE-VAR8,0),7,1)/SMA(ABS(CLOSE-VAR8),7,1)*100;逃亡:=IF(会员< REF(会员,1) AND 会员>79,会员,0);DRAWTEXT(逃亡,3.1,'逃'),coloryellow;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,1,'见底'),colorlired;DRAWTEXT(C-O>=0 AND O/L>1.05 AND L<=LLV(L,20),1,'绝底'),colorred;VAR11:=REF(LOW,1);VAR12:=SMA(ABS(LOW-VAR11),3,1)/SMA(MAX(LOW-VAR11,0),3,1)*100;VAR13:=EMA(IF(CLOSE*1.2,VAR12*10,VAR12/10),3);VAR14:=LLV(LOW,38);VAR15:=HHV(VAR13,38);VAR16:=IF(LLV(LOW,90),1,0);VAR17:=EMA(IF(LOW<=VAR14,(VAR13+VAR15*2)/2,0),3)/618*VAR16;CDXS:=HHV(VAR17,0)/2.6;STICKLINE(VAR17,0.53,VAR17/CDXS+0.53,0.6,0),colorwhite;HUA:=(CLOSE - LLV(LOW,14)) / (HHV(HIGH,14) - LLV(LOW,14)) * 1.2 * CLOSE;NV1:=EMA(HUA,4);NV2:=EMA(HUA,8);DRAWICON(CROSS(NV1,NV2) AND CLOSE/OPEN>1.05,0.5,1);DRAWICON(CROSS(NV2,NV1) AND COUNT(CROSS(NV1,NV2) AND CLOSE/OPEN>1.05 ,20) ,3.2,2);HUA2:=SMA(MAX(CLOSE-REF(CLOSE,1),0),16,2)/SMA(ABS(CLOSE/REF(CLOSE,1)),16,2)* 100;XIAN:=SMA(HUA2,3,1);NV3:=SMA(XIAN,3,1);XINV:=3*XIAN-2*NV3;买入条件:=CROSS(XINV,NV3);卖出条件:=CROSS(NV3,XINV);DRAWICON( 卖出条件,3.3,2),coloryellow;DRAWICON(买入条件,0.4,222),colorwhite;HXN:=IF(CLOSE/REF(CLOSE,1)>1.05 AND HIGH/CLOSE<1.01 AND IF(CLOSE>REF(CLOSE,1),88,0)>0, 91, 0);DRAWTEXT(HXN>90 AND VOL>REF(VOL,1) AND CLOSE>REF(CLOSE,1) AND COUNT(HXN>90,30)=1,平均线-0.25, '见涨'),,colorlired;HXJZ:=MA((2*CLOSE+HIGH+LOW)/4,5);BZTD:=HXJZ*89/100;DRAWTEXT(CROSS(LOW,BZTD),1.25,'必涨'),colorred;花:=EMA(SLOPE(1,1)+C,3),colorred;女:=EMA(SLOPE(1,1)+C,7),colorblue;STICKLINE(花>女 ,0.5,0.53,6,0) ,colorred;STICKLINE(花<=女 ,0.5,0.53,6,0),colorgreen;RJ:=1;{好}RSI_1:=SMA(MAX(CLOSE-LC,0),3,1)/SMA(ABS(CLOSE-LC),3,1)*100;RSI_2:=SMA(MAX(CLOSE-LC,0),5,1)/SMA(ABS(CLOSE-LC),5,1)*100;RSI_3:=SMA(MAX(CLOSE-LC,0),8,1)/SMA(ABS(CLOSE-LC),8,1)*100;相对强弱:=0.5*RSI_1+0.31*RSI_2+0.19*RSI_3;WAVE_1:=SMA(100*(CLOSE-LLV(LOW,8))/(HHV(HIGH,8)-LLV(LOW,8)),3,1);WAVE_2:=SMA(100*(CLOSE-LLV(LOW,8))/(HHV(HIGH,8)-LLV(LOW,8)),5,1);WAVE_3:=SMA(100*(CLOSE-LLV(LOW,8))/(HHV(HIGH,8)-LLV(LOW,8)),8,1);短线波段:=0.5*WAVE_1+0.31*WAVE_2+0.19*WAVE_3;风险系数:=0.5*相对强弱+0.5*短线波段,coloryellow;CD1:=IF(风险系数<20 AND CLOSE>OPEN AND RJ>0,1,0);CD2:=IF(风险系数<20 AND LOW>=REF(LOW,1) AND CLOSE>LOW AND RJ>0,1,0);CD3:=IF(REF(风险系数,1)<20 AND 风险系数>REF(风险系数,1),1,0);SIGNALBUY:=(CD1=1 OR CD2=1 OR CD3=1);CD:=(SIGNALBUY AND COUNT(SIGNALBUY,3)=1);DRAWTEXT(CD,0.5,'抄底'),COLOR0099FF;DIF:=(EMA(CLOSE,12)-EMA(CLOSE,26))*100;DEA:=EMA(DIF,9);RSV:=(CLOSE-LLV(LOW,9))/(HHV(HIGH,9)-LLV(LOW,9))*100;K:=SMA(RSV,9,3);D_:=SMA(K,9,3);GZ:=CROSS(DIF,DEA) AND CROSS(K,D_);DRAWTEXT(GZ,2,'金叉'),COLOR0099FF; */M:=10;MM:=9*M;SHORT:=MM*4/3;LONG:=MM*26/9;DIF:1000*(EMA(CLOSE,SHORT)-EMA(CLOSE,LONG))/ABS(EMA(CLOSE,SHORT)); MACD:EMA(DIF,MM),COLOR58FF58;DEF:2*(DIF-MACD),COLORFFFF00,NODRAW;STICKLINE1(DEF>=0 AND DEF>=REF(DEF,1),0,DEF,6,1),COLOR6058FF;STICKLINE1(DEF>=0 AND DEF< REF(DEF,1),0,DEF,6,0),COLOR6058FF;STICKLINE1(DEF<0 AND DEF>=REF(DEF,1),0,DEF,6,1),COLORFFFF00;STICKLINE1(DEF<0 AND DEF< REF(DEF,1),0,DEF,6,0),COLORFFFF00;PARTLINE(DIF<1000,0,COLORLIGHTRED);多头趋势:=IF(DIF>=0 AND MACD>=0 OR (DIF<0 AND MACD>=0),1,0);空头趋势:=DIF<0 AND MACD<0 OR (DIF>=0 AND MACD<0);缩头:=IF(DEF>0 AND REF(DEF,1)>REF(DEF,2) AND DEF< REF(DEF,1),1,0);缩脚:=IF(DEF<0 AND REF(DEF,1)< REF(DEF,2) AND DEF>REF(DEF,1),1,0);阻力:=IF(CROSS(CLOSE,MA(CLOSE,20)) OR CROSS(CLOSE,MA(CLOSE,60)),1,0);支撑:=IF(CROSS(MA(CLOSE,20),CLOSE) OR CROSS(MA(CLOSE,60),CLOSE),1,0);做多:=IF(CROSS(MACD,DIF) AND DIF>0 AND MACD>0,1,0);放空:=IF(CROSS(DIF,MACD) AND DIF<0 AND MACD<0,1,0);PARTLINE(DIF,DIF<1000,COLORCCFFFF),LINETHICK2;PARTLINE(MACD,MACD<1000,COLOR58FF58);BV:=SUM(DEF,0);BA:=IF(MAX(BV,REF(BV,2))<REF(BV,1) OR MIN(BV,REF(BV,2))>REF(BV,1),1,0);BC:=BARSLAST(BA)+1;SMACD:=BV-REF(BV,BC);V AR3:=IF(DEF>0,HHV(ABS(DEF),BC),LLV(DEF,BC));V AR4:=(DEF)/20;//{图形比例缩小1/20,可修改}V AR5:=SMACD;DRAWTEXT(REF(V AR4,1)>0 && V AR4<=0 ,REF(V AR3,1),'+REF(VAR5,1)'),COLORGREEN; DRAWTEXT(REF(V AR4,1)<0 && V AR4>=0 ,REF(VAR3,1),'+REF(ABS(V AR5),1)'),COLORFF00FF;DRAWTEXT(BARSTA TUS=2 && V AR4<0,REF(VAR3,1),'+ABS(V AR5)'),ALIGN2,COLORFF00FF;DRAWTEXT(BARSTA TUS=2 && V AR4>0,REF(VAR3,1),'+V AR5'),ALIGN2,COLORGREEN; M1:=REF(DEF,1);JC := MACD-DIF;绿柱面积:IF (DEF<0,SUM(DEF,BARSLAST(JC<0)),0),NODRAW,COLORGREEN;红柱面积:IF (DEF>0,SUM(DEF,BARSLAST(JC>0)),0),NODRAW,COLORRED;。

文华财经指标公式源码箱体指标

文华财经指标公式源码箱体指标

AMOUNT:=A VPRICE*V;CAPITAL:=GETPRICE1('流通股本');INDEXL:="999001$L";INDEXC:="999001$C";INDEXH:="999001$H"; CURRBARSCOUNT:=DA TACOUNT-BARPOS+1;KK:=IF(H=HHV(H,3),H,L);KK0:=REFX1(MAX(TROUGHBARS(KK,15,1,1),PEAKBARS(KK,15,1,1)),10000);前期大箱顶:IF(CURRBARSCOUNT<KK0+2,REFX1((PEAK(KK,15,1,1)),10000),NULL),COLORRED; 前期大箱底:IF(CURRBARSCOUNT<KK0+2,REFX1((TROUGH(KK,15,1,1)),10000),NULL),COLORCY AN,LINETHICK1;STICKLINE1(CURRBARSCOUNT<KK0+2,前期大箱顶,前期大箱底,5,0),COLOR00AA99; N:=13;BC:=(H*0.382+L*0.618+O*0.382+C*0.618)/2;LJ:=IF(INDEXC=C,BC,(BC+AMOUNT/(V*100))/2),COLORGRAY;HT:=REF((HHV(LJ,N*0.691)+HHV(LJ,N)+HHV(LJ,N*1.309))/3,1),LINETHICK1,COLORRE D;LT:=REF((LLV(LJ,N*0.691)+LLV(LJ,N)+LLV(LJ,N*1.309))/3,1),LINETHICK1,COLORGREE N;ZT:=(HT+LT)/2,LINETHICK1,COLORYELLOW;STICKLINE1(ISLASTBAR=1 AND LJ<ZT,HT,LT,N*8,0),COLORBLUE;STICKLINE1(ISLASTBAR=1 AND LJ=ZT,HT,LT,N*8,0),COLORGRAY;STICKLINE1(ISLASTBAR=1 AND LJ>ZT,HT,LT,N*8,1),COLOR6600FF;STICKLINE1(ISLASTBAR=1,ZT,ZT,N*8,0),COLORGRAY;箱顶:HT,COLORGREEN,NODRAW,LINETHICK1;箱中:ZT,COLORGRAY,NODRAW,LINETHICK1;箱底:LT,COLORA943FF,NODRAW,LINETHICK1;DRAWKLINE1(H,O,L,C);ZKP:=IF(C>REF(C,1),REF(C,1),NULL);ZSP:=IF(C>REF(C,1),C,NULL);DKP:=IF(C<=REF(C,1),REF(C,1),NULL);DSP:=IF(C<=REF(C,1),C,NULL);DRAWKLINE1(H,DKP,L,DSP);STICKLINE1(C<=REF(C,1),DKP,DSP,2.4,0),COLORBLUE;STICKLINE1(C<=REF(C,1),DKP,DSP,1.8,0),COLORFF7700;STICKLINE1(C<=REF(C,1),DKP,DSP,1.2,0),COLORFF9900;STICKLINE1(C<=REF(C,1),DKP,DSP,0.6,0),COLORFFBB00;DRAWKLINE1(H,ZKP,L,ZSP);STICKLINE1(C>REF(C,1),ZKP,ZSP,2.4,0),COLOR000099;STICKLINE1(C>REF(C,1),ZKP,ZSP,1.8,0),COLOR0000CC;STICKLINE1(C>REF(C,1),ZKP,ZSP,1.2,0),COLOR0000FF;STICKLINE1(C>REF(C,1),ZKP,ZSP,0.6,0),COLORCC66FF;STICKLINE1(V/REF(V,1)>2 AND CLOSE>=OPEN,ZKP,ZSP,0.8,0),COLORYELLOW;三日不破:=MIN(MIN(L,REF(L,1)),REF(L,2))>=REF(L,3);三日量缩:=(MAX(MAX(V,REF(V,1)),REF(V,2))<REF(V,3));三日价涨A:=C>=REF(C,1);三日价涨B:=C<REF(C,1);三日价涨C:=MIN(MIN(C,REF(C,1)),REF(C,2))>=REF(L,3);TIM:=IF(DATE<331231,1,0);倍量柱:=C>REF(C,1)*1.04 AND (VOL>=1.9*REF(VOL,1))*TIM;四日前倍量柱:=(REF(VOL,3)>1.9*REF(VOL,4))*TIM;四日前高量柱:=(REF(VOL,3)>=REF(VOL,4) AND REF(VOL,3)<1.9*REF(VOL,4) AND 三日量缩)*TIM;前三引用不成立:=COUNT(REF(四日前倍量柱,1) AND (REF(三日不破,1) OR REF(三日价涨C,1)),3)=0 AND COUNT(REF(四日前高量柱,1) AND (REF(三日不破,1) OR REF(三日价涨C,1)),3)=0;倍量黄金柱:=四日前倍量柱AND 三日量缩AND 三日不破AND 三日价涨A AND 前三引用不成立;高量黄金柱:=四日前高量柱AND 三日量缩AND 三日不破AND 三日价涨A AND 前三引用不成立;黄金柱:=倍量黄金柱OR 高量黄金柱;次倍量黄金柱:=NOT(黄金柱) AND 四日前倍量柱AND 三日量缩AND 三日不破AND 三日价涨B AND 前三引用不成立;次高量黄金柱:=NOT(黄金柱) AND 四日前高量柱AND 三日量缩AND 三日不破AND 三日价涨B AND 前三引用不成立;次黄金柱:=次倍量黄金柱OR 次高量黄金柱;准倍量黄金柱:=NOT(黄金柱OR 次黄金柱) AND 四日前倍量柱AND ((三日量缩AND 三日价涨C) OR (COUNT(倍量柱,3)>=1 AND 三日不破)) AND 前三引用不成立;准高量黄金柱:=NOT(黄金柱OR 次黄金柱) AND 四日前高量柱AND (三日量缩AND 三日价涨C) AND 前三引用不成立;准黄金柱:=准倍量黄金柱OR 准高量黄金柱;倍量将军柱:=NOT(黄金柱OR 次黄金柱OR 准黄金柱) AND 四日前倍量柱AND 三日不破AND 三日价涨A AND 前三引用不成立;高量将军柱:=NOT(黄金柱OR 次黄金柱OR 准黄金柱) AND 四日前高量柱AND 三日不破AND 三日价涨A AND 前三引用不成立;将军柱:=倍量将军柱OR 高量将军柱;BACKSET101:=BACKSET(黄金柱,4);FILTER101:=FILTER(BACKSET101,3);BACKSET104:=BACKSET(将军柱,4);FILTER104:=FILTER(BACKSET104,3);K1:=SUMBARS(FILTER104,1);STICKLINE1(K1,REF(L,K1-2),REF(L,K1-2),0.506,0),COLORWHITE;K2:=SUMBARS(FILTER101,1);STICKLINE1(K2,REF(L,K2-2),REF(L,K2-2),0.506,0),COLORWHITE;DRAWNUMBER(ISLASTBAR,REF(L,K1-2)*0.99,REF(L,K1-2),2,COLORRED),LINETHICK1 ;DRAWNUMBER(ISLASTBAR,REF(L,K2-2)*0.99,REF(L,K2-2),2,COLORGREEN),LINETHIC K1;。

文华财经指标源码

文华财经指标源码

文华财经指标源码最高价连线与最低价连线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,OPEN,CLOSE,COLORCYAN,0);STICKLINE(TMP<=0,OPEN,CLOSE,COLORRED,1);A:HHV(HIGH,10);B:LLV(LOW,10);自编KDJRSV:=(CLOSE-LLV(LOW,N))/(HHV(HIGH,N)-LLV(LOW,N))*100; BACKGROUNDSTYLE(1);K1:SMA(RSV,M1,1);D1:SMA(K1,M2,1);J1:3*K1-2*D1;KDR:MAX((K1-D1)/ABS(K1-D1),0)*90 5;RSV4:=(CLOSE-LLV(LOW,N*4))/(HHV(HIGH,N*4)-LLV(LOW,N*4))*100; K4:SMA(RSV4,12,1);D4:SMA(K4,12,1);庄家终结者HH:=HHV(HIGH,N);LL:=LLV(LOW,N);HH1:=BARSLAST((HH > REF(HH,1)));LL1:=BARSLAST((LL < REF(LL,1)));PARTLINE((HH1 < LL1),LL,COLORYELLOW);PARTLINE((HH1 > LL1),HH,COLORBLUE);STICKLINE((HH1 < LL1),CLOSE,OPEN,COLORRED,0);DRAWLINE((HH1 < LL1),HIGH,(HH1 < LL1),LOW,COLORRED); STICKLINE((HH1 > LL1),CLOSE,OPEN,COLORGREEN,0); DRAWLINE((HH1 > LL1),HIGH,(HH1 > LL1),LOW,COLORGREEN);DRAWTEXT(CROSS(HH1,LL1),HH,'空');DRAWTEXT(CROSS(LL1,HH1),LL,'多');DRAWTEXT(((HH1 < REF(HH1,1)) && (HH1 < LL1)),LOW,'♂加多'); DRAWTEXT(((LL1 < REF(LL1,1)) && (HH1 > LL1)),HIGH,'♀加空');亦步已趋X:=EMA(((SLOPE(CLOSE,21) * 20) + CLOSE),68);Y:=EMA(CLOSE,10);LL:=REF(CLOSE,2);MM:=((SMA(MAX((CLOSE - LL),0),6,1) / SMA(ABS((CLOSE - LL)),6,1)) * 100); DB:=IFELSE(((MM < REF(MM,1))&& (MM > 80)),MM,0);DRAWTEXT(CROSS(Y,X),L,'加'),COLORYELLOW;DRAWTEXT(DB,H+5,'卖'),COLORGREEN;VAR1:=LLV(LOW,21);VAR2:=HHV(HIGH,21);AK1:=EMA((((CLOSE - VAR1) / (VAR2 - VAR1)) * 100),5);AK:=EMA((((CLOSE - VAR1) / (VAR2 - VAR1)) * 50),13);DD:=EMA(((0.667 * REF(AK1,1)) + (0.333 * AK1)),2);VAR3:=LLV(LOW,55);VAR4:=HHV(HIGH,34);VAR5:=EMA((((CLOSE - VAR3) / (VAR4 - VAR3)) * 100),3);VAR6:=((AK + VAR5) / 2);VAR7:=EMA(((0.667 * REF(VAR5,1)) + (0.333 * AK1)),2);VAR8:=EMA(VAR6,5);BB:=EMA(((0.667 * REF(VAR8,1)) + (0.333 * VAR8)),2);AB:=CROSS(AK1,AK);BB1:=(CROSS(AK1,BB) && (BB < 30));DRAWLINE(C>=O,H,C>=O,L,COLORYELLOW); STICKLINE(C<=O,C,O,COLORBLUE,0); DRAWLINE(C<=O,H,C<=O,L,COLORWHITE);。

文华财经指标源码

文华财经指标源码

文华财经指标源码阳光心情MA1:EMA(CLOSE,6),COLORWHITE;MA2:EMA(CLOSE,25),COLORRED ;STICKLINE(MA1>MA2,MA1,MA2,COLORMAGENTA,0) ;STICKLINE(MA2>MA1,MA1,MA2,COLORGREEN,0); DRAWTEXT(MA2-MA1>0&&MA1/LOW>1.15,LOW,'?');DRAWTEXT(MA1-MA2>0&&HIGH/MA1>1.15,HIGH,'?');无敌MACD文华版DIFF : EMA(CLOSE,12) - EMA(CLOSE,26); DEA : EMA(DIFF,9);2*(DIFF-DEA),COLORSTICK;L1:=(EMA(CLOSE,8) - EMA(CLOSE,13)); L2:=EMA(L1,13);DRAWTEXT(CROSS(L1,L2),DIFF ,'买'),COLORRED;DRAWTEXT(CROSS(L2,L1),DIFF ,'卖'),COLORGREEN;稳坐钓鱼台ZJX:MA(C,61)-2*STD(C,71),COLORRED;CJX:MA(C,125)-2*STD(C,145),COLORMAGENTA;A:(EMA(C,13)+MA(C,26)+MA(C,52))/3,COLORYELLOW;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,OPEN,CLOSE,COLORCYAN,0);STICKLINE(TMP<=0,OPEN,CLOSE,COLORRED,1);稳赢趋势HH:=HHV(HIGH,13);LL:=LLV(LOW,13);HH1:=BARSLAST((HH>REF(HH,1)));LL1:=BARSLAST((LL<REF(LL,1)));A:=IFELSE((HH1 < LL1),1,IFELSE((HH1 > LL1),-1,0));AA:IFELSE(A>=0,LL,HH),COLORYELLOW;DRAWTEXT(CROSS(HH1,LL1),HH,'开空');DRAWTEXT(CROSS(LL1,HH1),LL,'开多');DRAWLINE(HH1>LL1,HIGH,HH1>LL1,OPEN,COLORCYAN);DRAWLINE(HH1>LL1,LOW,HH1>LL1,CLOSE,COLORCYAN);DRAWLINE(HH1<=LL1,HIGH,HH1<=LL1,CLOSE,COLORRED);DRAWLINE(HH1<=LL1,LOW,HH1<=LL1,OPEN,COLORRED);STICKLINE(HH1>LL1,OPEN,CLOSE,COLORCYAN,0);STICKLINE(HH1<=LL1,OPEN,CLOSE,COLORRED,1);天机均线VV:=(3*C+H+L+O)/6;DUAN:(8*VV+7*REF(VV,1)+6*REF(VV,2)+5*REF(VV,3)+4*REF(VV,4)+3*REF(VV, 5)+2*REF(VV,6)+REF(VV,7))/36,COLORWHITE;ZONG:(LLV(DUAN,3)+LLV(DUAN,5)+LLV(DUAN,8))/3,COLORYELLOW;顺势有位PARTLINE(CLOSE>0,MA(CLOSE,5),COLORWHITE);PARTLINE(CLOSE>0,MA(CLOSE,6),COLORWHITE);PARTLINE(CLOSE>0,MA(CLOSE,7),COLORWHITE);PARTLINE(CLOSE>0,MA(CLOSE,8),COLORWHITE);PARTLINE(CLOSE>0,MA(CLOSE,9),COLORWHITE);PARTLINE(CLOSE>0,MA(CLOSE,10),COLORWHITE);PARTLINE(CLOSE>0,MA(CLOSE,25),COLORRED);PARTLINE(CLOSE>0,MA(CLOSE,26),COLORRED);PARTLINE(CLOSE>0,MA(CLOSE,27),COLORRED);PARTLINE(CLOSE>0,MA(CLOSE,28),COLORRED);PARTLINE(CLOSE>0,MA(CLOSE,29),COLORRED);PARTLINE(CLOSE>0,MA(CLOSE,30),COLORRED);拾金图STICKLINE((EMA(CLOSE,13) >= EMA(CLOSE,34)),LOW,HIGH,COLORRED,0); STICKLINE((EMA(CLOSE,13) >= EMA(CLOSE,34)),OPEN,CLOSE,COLORRED,0); STICKLINE((EMA(CLOSE,13) < EMA(CLOSE,34)),LOW,HIGH,COLORGREEN,0); STICKLINE((EMA(CLOSE,13) < EMA(CLOSE,34)),OPEN,CLOSE,COLORGREEN,0); LL1:=EMA(CLOSE,N);HH1:=EMA(CLOSE,N1);T:=IFELSE(HH1>LL1,1,-1);G:=IFELSE(HH1>LL1,HH1,LL1);DRAWLINE(T=1&&REF(T,1)=1,G,T=1&&REF(T,1)=1,REF(G,1),COLORGREEN); DRAWLINE(T=-1&&REF(T,1)=-1,G,T=-1&&REF(T,1)=-1,REF(G,1),COLORRED); DRAWSL(T=1,G,0,1,0,COLORGREEN);DRAWSL(T=-1,G,0,1,0,COLORRED);DRAWTEXT(CROSS(EMA(CLOSE,34),EMA(CLOSE,13)),HIGH,'S');DRAWTEXT(CROSS(EMA(CLOSE,13),EMA(CLOSE,34)),LOW,'B');DRAWNUMBER(CROSS(EMA(CLOSE,34),EMA(CLOSE,13)),LOW,CLOSE,0,COLORGREEN);DRAWNUMBER(CROSS(EMA(CLOSE,13),EMA(CLOSE,34)),HIGH,CLOSE,0,COLORRED);上帝主图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,OPEN,CLOSE,COLORCYAN,0);STICKLINE(TMP<=0,OPEN,CLOSE,COLORRED,1);A1:=(LOW+HIGH+CLOSE)/3;B1:MA(A1,3),COLORWHITE;C1:HHV(B1,5),COLORGREEN;D1:HHV(B1,15),COLORMAGENTA;E1:LLV(B1,5),COLORYELLOW;F1:LLV(B1,15),COLORCYAN;。

文华财经指标源码

文华财经指标源码

文华财经指标源码下面是一个示例的文华财经指标源码,用于计算移动平均线(MA)指标。

该指标适用于股票等金融数据的分析和预测。

```pythonimport numpy as np#计算移动平均线def calculate_ma(data, period):ma = np.zeros(len(data))for i in range(len(data)):if i < period:ma[i] = np.mean(data[:i+1])else:ma[i] = np.mean(data[i-period+1:i+1])return ma#示例输入数据data = [10, 12, 15, 14, 13, 11, 9, 10]#计算5日移动平均线ma_5 = calculate_ma(data, 5)print("5日移动平均线:", ma_5)#计算10日移动平均线ma_10 = calculate_ma(data, 10)print("10日移动平均线:", ma_10)#计算20日移动平均线ma_20 = calculate_ma(data, 20)print("20日移动平均线:", ma_20)```说明:1. 首先,我们定义了一个`calculate_ma`函数,该函数接受两个参数:`data`为输入数据,`period`为移动平均线的周期。

该函数通过遍历数据并计算平均值来计算移动平均线。

返回一个包含移动平均线数值的NumPy数组。

2. 我们定义了一个示例的输入数据`data`,其中包含了8个价格数据。

3. 接下来,我们使用`calculate_ma`函数计算了5日、10日和20日的移动平均线。

4.最后,我们将计算得到的每个移动平均线打印出来。

这只是一个示例的源码,你可以根据自己的需求进行修改和扩展。

文华财经提供了丰富的金融指标计算工具,可以根据你的需要进行选取和应用。

文华财经期货软件指标公式源码赢顺云指标macd kdj rsi cci boll dmi ddx ddy ddz

文华财经期货软件指标公式源码赢顺云指标macd kdj rsi cci boll dmi ddx ddy ddz

AF1:=REF(O,1);AF2:=ABS((REF(C,1)-AF1)/AF1);AF3:=ABS((REF(H,1)-AF1)/AF1);AF4:=ABS((REF(L,1)-AF1)/AF1);BF1:=ABS((AF2+AF3+AF4)/3);BF2:=O*BF1;预测低一:=O-BF2;预测高一:=O+BF2;今日保护价:=(REF(C,2)+REF(C,1)+O)/3 ,COLOR4080FF,NODRAW; 开盘价1:=OPEN;开盘价2:=REF(OPEN,1);最高价1:=HIGH;最高价2:=REF(HIGH,1);最低价1:=LOW;最低价2:=REF(LOW,1);收盘价1:=CLOSE;收盘价2:=REF(CLOSE,1);AAF:=最高价2;BBF:=最低价2;CCF:=开盘价2;DDF:=收盘价2;EEF:=(AAF+BBF+CCF+2*DDF)/5;AAAF:=EEF+(AAF-BBF);BBBF:=2*EEF-BBF;CCCF:=2*EEF-AAF;DDDF:=EEF-(AAF-BBF);上升突破价:=AAAF;上升阻力价:=BBBF;下跌支撑价:=CCCF;下跌反转价:=DDDF;E:=(HIGH+LOW+OPEN+2*CLOSE)/5;阻力:=E+(HIGH-LOW);支撑:=E-(HIGH-LOW);EEE:=(EEF+上升突破价+上升阻力价+下跌支撑价+下跌反转价)/5;心理价:=EEE;FFF:=(EEE+开盘价1)/2;GGG:=(预测低一+FFF)/2;预测低二:MIN(GGG,支撑),NODRAW;预测高二:MAX(MA(REF(HIGH,1)/REF(CLOSE,2),27)*REF(CLOSE,1),阻力),NODRAW;DIFF := EMA(CLOSE,12) - EMA(CLOSE,26);//短周期与长周期的收盘价的指数平滑移动平均值做差。

文华财经各种顶底背离主图源码

文华财经各种顶底背离主图源码

DIFELSEF := EMA(CLOSE,12) - EMA(CLOSE,26);DEA:= EMA(DIFELSEF,9);LC := REF(CLOSE,1);RSI1:=SMA(MAX(CLOSE-LC,0),6,1)/SMA(ABS(CLOSE-LC),6,1)*100; RSI2:=SMA(MAX(CLOSE-LC,0),12,1)/SMA(ABS(CLOSE-LC),12,1)*100; 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;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(IFELSE(HD>0 && HD>LD,HD,0),14);MDM:= SUM(IFELSE(LD>0 && LD>HD,LD,0),14);PDI:= PDM*100/TR;MDI:= MDM*100/TR;A1:=BARSLAST(REF(CROSS(DIFELSEF,DEA),1));B1:=REF(CLOSE,A1+1)>CLOSE && REF(DIFELSEF,A1+1)A2:=BARSLAST(REF(CROSS(K,D),1));B2:=REF(CLOSE,A2+1)>CLOSE && REF(K,A2+1)A3:=BARSLAST(REF(CROSS(RSI1,RSI2),1));B3:=REF(CLOSE,A3+1)>CLOSE && REF(RSI1,A3+1)C1:=BARSLAST(REF(CROSS(DEA,DIFELSEF),1));D1:=REF(CLOSE,C1+1)>DIFELSEF && CROSS(DEA,DIFELSEF);C2:=BARSLAST(REF(CROSS(D,K),1));D2:=REF(CLOSE,C2+1)K && CROSS(D,K);C3:=BARSLAST(REF(CROSS(RSI2,RSI1),1));D3:=REF(CLOSE,C3+1)>RSI1 && CROSS(RSI2,RSI1);C4:=BARSLAST(REF(CROSS(MDI,PDI),1));D4:=REF(CLOSE,C4+1)MDI && CROSS(MDI,PDI); A4:=BARSLAST(REF(CROSS(PDI,MDI),1));B4:=REF(CLOSE,A4+1)>CLOSE && REF(PDI,A4+1) STICKLINE(B4,LOW,LOW-0.06,COLORBLUE,0); DRAWTEXT(B4,LOW-20,'D底'); PLAYSOUND(CROSSUP(B4,LOW),'F'); STICKLINE(D4,HIGH,HIGH+0.06,COLORWHITE,0); DRAWTEXT(D4,HIGH+20,'D顶'); PLAYSOUND(CROSSDOWN(D4,HIGH),'E');STICKLINE(B1,LOW,LOW-0.06,COLORGREEN,0); DRAWTEXT(B1,LOW-10,'M底');PLAYSOUND(CROSSUP(B1,LOW),'F');STICKLINE(B2,LOW,LOW-0.06,COLORYELLOW,0); DRAWTEXT(B2,LOW-6,'K底');PLAYSOUND(CROSSUP(B2,LOW),'F');STICKLINE(B3,LOW,LOW-0.04,COLORRED,0); DRAWTEXT(B3,LOW-16,'R底');PLAYSOUND(CROSSUP(B3,LOW),'F');STICKLINE(D1,HIGH,HIGH+0.06,COLORMAGENTA,0); DRAWTEXT(D1,HIGH+10,'M顶');PLAYSOUND(CROSSDOWN(D1,HIGH),'E'); STICKLINE(D2,HIGH,HIGH+0.06,COLORLIGHTRED,0); DRAWTEXT(D2,HIGH+6,'K顶');PLAYSOUND(CROSSDOWN(D2,HIGH),'E'); STICKLINE(D3,HIGH,HIGH+0.06,COLORLIGHTGREEN,0); DRAWTEXT(D3,HIGH+16,'R顶');PLAYSOUND(CROSSDOWN(D3,HIGH),'E');MA13:=MA(CLOSE,13),COLORWHITE;VLL:=CROSS(MA(CLOSE,13),MA(CLOSE,21)); DRAWTEXT(VLL,MA13-10,'圆底');PLAYSOUND(CROSSUP(VLL,MA13),'F');。

  1. 1、下载文档前请自行甄别文档内容的完整性,平台不提供额外的编辑、内容补充、找答案等附加服务。
  2. 2、"仅部分预览"的文档,不可在线预览部分如存在完整性等问题,可反馈申请退款(可完整预览的文档不适用该条件!)。
  3. 3、如文档侵犯您的权益,请联系客服反馈,我们会尽快为您处理(人工客服工作时间:9:00-18:30)。
相关文档
最新文档