文华财经指标源码
文华财经指标公式源码顶底卖出买入趋势线公式源码
XQ:=进出线<REF(进出线,1);
SQS:=BACKSET(BARSLAST(NOT(SQ))>=5,BARSLAST(NOT(SQ))),LINETHICK;
XQS:=BACKSET(BARSLAST(NOT(XQ))>=5,BARSLAST(NOT(XQ))),LINETHICK;
DRAWTEXT(ISLASTBAR,顶,'*'),COLORGREEN;
DRAWTEXT(ISLASTBAR,底,'*'),COLORRED;
DRAWTEXT(ISLASTBAR,中,'中'),COLORWHITE;
多空线:=(MA1+ma2+maF)/3;
MA3c:=(EMA(c,(3*8))+EMA(c,26)+EMA(c,(4*7)))/3;
MA3h:=(EMA(h,(3*8))+EMA(h,26)+EMA(h,(4*7)))/3;
MA3l:=(EMA(l,(3*8))+EMA(l,26)+EMA(l,(4*7)))/3;
趋势线:EMA(V11,3),LINETHICK1,COLORGRAY;
V12:=(趋势线-REF(趋势线,1))/REF(趋势线,1)*100;
//STICKLINE1(趋势线<11,趋势线,11,5,0),COLORYELLOW;
AA:=(趋势线<11) AND FILTER((趋势线<=11),15) AND C<中线;
/*bc:=((H*0.5+L*0.5)*0.382+(O*0.382+C*0.618)*0.618);
文华财经期货软件指标公式源码精品CCI指标
文华财经期货软件指标公式源码精品CCI指标CCI指标的计算步骤如下:1.计算典型价格(TP):TP=(最高价+最低价+收盘价)/32.计算平均价(MA):MA=TP的n日简单移动平均3.计算平均绝对偏差(MD):MD=TP与MA之差的绝对值的n日简单移动平均4.计算CCI值(CCI):CCI=(TP-MA)/(0.015*MD)根据CCI值的大小,可以判断市场是超买、超卖还是处于区间内:1.当CCI值大于100时,表示市场超买,价格可能会回落;2.当CCI值小于-100时,表示市场超卖,价格可能会反弹;3.当CCI值在-100至100之间时,表示市场处于区间内,没有明显的超买超卖情况。
下面是一个经过优化的CCI指标的Python源码示例:```pythonimport pandas as pdimport numpy as npdef cci(data, n):tp = (data['high'] + data['low'] + data['close']) / 3ma = tp.rolling(n).meanmd = np.abs(tp - ma).rolling(n).meancci = (tp - ma) / (0.015 * md)return cci# 读取数据,例如从csv文件中读取data = pd.read_csv('data.csv')cci_values = cci(data, 20)#打印CCI值print(cci_values)```在以上代码中,`data`是包含股价或期货价格数据的DataFrame,其中包含`high`(最高价)、`low`(最低价)、`close`(收盘价)等字段。
函数`cci`接受数据和时间周期`n`作为输入,返回计算得到的CCI值。
最后,使用示例数据调用`cci`函数并打印CCI值。
文华财经指标公式源码最神奇的主图买卖指标公式源码
/* 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;。
文华财经指标公式源码 文华obv指标
CAPITAL:=GETPRICE1('流通股本');N:=BARSLAST(DATE<>REF(DATE,1))+1;CURRBARSCOUNT:=REFX1(BARPOS,10000)-BARPOS+1;HH:=REFX1(MA(H,125),125/2);LL:=REFX1(MA(L,125),125/2);金牛:=(REFX1(MA(HH,125),125/2)-REFX1(MA(LL,125),125/2))*1+REFX1(MA(HH,125),125/2),DOT,LINE THICK5,COLORYELLOW;金牛金牛:=(REFX1(MA(LL,125),125/2)-REFX1(MA(HH,125),125/2))*1+REFX1(MA(LL,125),125/2),DOT,LINET HICK5,COLORRED;(金牛+金牛金牛)/2,DOT;金钻趋势:REFX1(MA(LL,125),125/2)-(REFX1(MA(HH,125),125/2)-REFX1(MA(LL,125),125/2))*1,LINETHICK1 ,COLORRED,NODRAW;金牛2:EMA(金钻趋势,125),COLORCYAN,LINETHICK1,NODRAW;金牛21:=EMA(金牛,125),COLORCYAN,LINETHICK1,NODRAW;//FILLRGN(金钻趋势>金牛2,金钻趋势,金牛2,RGB(55,0,0));//FILLRGN(金钻趋势<金牛2,金钻趋势,金牛2,RGB(0,91,0));DRAWKLINE1(H,O,L,C);/*STICKLINE1(金钻趋势>LOW AND 金钻趋势<HIGH,金钻趋势,MIN(MIN(OPEN,CLOSE),金钻趋势),2,0),COLORYELLOW;STICKLINE1(金钻趋势>MIN(C,O) AND 金钻趋势<MAX(C,O),金钻趋势,MIN(OPEN,CLOSE),2,0),COLORYELLOW;STICKLINE1(金钻趋势>HIGH,OPEN,CLOSE,2,0),COLORYELLOW;STICKLINE1(金钻趋势>HIGH,HIGH,LOW,0,0),COLORYELLOW;STICKLINE1(金牛<H AND 金牛>L,金牛,MAX(MAX(OPEN,CLOSE),金牛),2,0),COLORBLUE; STICKLINE1(金牛<MAX(C,O) AND 金牛>MIN(C,O),金牛,MAX(OPEN,CLOSE),2,0),COLORBLUE; STICKLINE1(金牛<L,OPEN,CLOSE,2,0),COLORBLUE;STICKLINE1(金牛<L,HIGH,LOW,0,0),COLORBLUE;*/CC1:=REFX1(MA(C-REF(C,1),6),6/2);CC2:=REFX1(MA(ABS(C-REF(C,1)),6),6/2);VAR23:=100*REFX1(MA(CC1,6),6/2)/REFX1(MA(CC2,6),6/2);回调买:=LLV(VAR23,2)=LLV(VAR23,7) AND COUNT(VAR23<0,2) AND CROSS(VAR23,MA(VAR23,2)); XG:=金钻趋势>HIGH AND 回调买AND L<=金钻趋势;//DRAWTEXT(XG,L,'▲买入'),COLORRED;JJ:=(HIGH+LOW+CLOSE)/3;QJ0:=VOL/IF(HIGH=LOW,4,HIGH-LOW);QJ1:=IF(CAPITAL=0,QJ0*(JJ-MIN(CLOSE,OPEN)),QJ0*IF(HIGH=LOW,1,(MIN(OPEN,CLOSE)-LOW))); QJ2:=IF(CAPITAL=0,QJ0*(MIN(OPEN,CLOSE)-LOW),QJ0*IF(HIGH=LOW,1,(JJ-MIN(CLOSE,OPEN)))); QJ3:=IF(CAPITAL=0,QJ0*(HIGH-MAX(OPEN,CLOSE)),QJ0*IF(HIGH=LOW,1,(HIGH-MAX(OPEN,CLOSE ))));QJ4:=IF(CAPITAL=0,QJ0*(MAX(CLOSE,OPEN)-JJ),QJ0*IF(HIGH=LOW,1,(MAX(CLOSE,OPEN)-JJ))); FROMOPEN:=IF(HOUR<12,60*(HOUR-9)-30+MINUTE,120+60*(HOUR-13)+MINUTE);DDX:=((QJ1+QJ2)-(QJ3+QJ4))/IF(CAPITAL=0,10000,10000),COLOR00AAAA,LINETHICK1;V2:=SMA(IF(C>=REF(C,1),DDX,-DDX/100),2,1);V5:=SMA(V2*120/FROMOPEN*5,2,1);V10:=SMA(V5,5,1);V20:=SMA(V10,5,1);DY:=CURRBARSCOUNT=1 AND C<REF(C,1);DY2:=REF(V2,1)-DY;XG2:=C>O AND DY2<0.02 AND MA(C,5)>MA(C,60) AND C/REF(C,1)>=1.02 AND H<金牛;//DRAWTEXT(XG2,L,'▲抓牛'),COLORYELLOW;//DRAWTEXT(XG2 AND L<金钻趋势,L,'↖金钻起涨'),COLORMAGENTA;昨前:=5;高1:=REF(HHV(H,DAYBARPOS),DAYBARPOS);低1:=REF(LLV(L,DAYBARPOS),DAYBARPOS);H11:=高1-(高1-低1)*0.191;H21:=高1-(高1-低1)*0.382;H31:=高1-(高1-低1)*0.5;H41:=高1-(高1-低1)*0.618;H51:=高1-(高1-低1)*0.809;顶:=REFX1(高1,10000),LINETHICK3,COLORRED;低:=REFX1(低1,10000), LINETHICK3,COLORRED;HH1:=IFELSE(H<REF(H,1)&&REF(H,1)<REF(H,2),REF(H,2),0);LL1:=IFELSE(L>REF(L,1)&&REF(L,1)>REF(L,2),REF(L,2),0);HH2:=VALUEWHEN(HH1>0,HH1);LL2:=VALUEWHEN(LL1>0,LL1);K1:=IFELSE(CLOSE>HH2,-3,IFELSE(CLOSE<LL2,1,0));K2:=VALUEWHEN(K1<>0,K1);G:=IFELSE(K2=1,HH2,LL2);G1:=VALUEWHEN(ISLASTBAR,G);DRAWNUMBER(L>0,G1,G1,0,COLORCYAN);W1:=K2;W2:=OPEN-CLOSE;HT:=IFELSE(OPEN>CLOSE,OPEN,CLOSE);LT:=IFELSE(OPEN<CLOSE,OPEN,CLOSE);//DRAWLINE(W1=1,HIGH,W1=1,HT,COLORCYAN);//DRAWLINE(W1=1,LOW,W1=1,LT,COLORCYAN);//DRAWLINE(W1=-3,HIGH,W1=-3,HT,COLORRED);//DRAWLINE(W1=-3,LOW,W1=-3,LT,COLORRED);//STICKLINE(W1>0,OPEN,CLOSE,COLORCYAN,1);//STICKLINE(W1<=0,OPEN,CLOSE,COLORRED,1);//STICKLINE(W2>0&&W1<=0,OPEN,CLOSE,COLORRED,0);//STICKLINE(W2>0&&W1>0,OPEN,CLOSE,COLORCYAN,0);//DRAWLINE(W1=1&&REF(W1,1)=1,G,W1=1&&REF(W1,1)=1,REF(G,1),COLORGREEN),LINETHICK4 ;//DRAWLINE(W1=-3&&REF(W1,1)=-3,G,W1=-3&&REF(W1,1)=-3,REF(G,1),COLORYELLOW),LINETH ICK4;//DRAWSL(K2=1,G,0,1,0,COLORGREEN),LINETHICK4;//DRAWSL(K2=-3,G,0,1,0,COLORYELLOW),LINETHICK4;VERTLINE( K2=-3&&REF(K2=1,1)&&C<(金牛+金牛金牛)/2,COLORRED),LINETHICK2; VERTLINE( K2=1&&REF(K2=-3,1)&&C>(金牛+金牛金牛)/2,COLORGREEN),LINETHICK2;。
文华财经指标公式源码期货波段王指标
JJ:=(CLOSE+HIGH+LOW)/3;A:=EMA(JJ,5);B:=REF(A,1);//持股:STICKLINE1(A>B,A,B,4,0),COLOR00FFFF;//弃股:STICKLINE1(A<=B,A,B,4,0),COLORA00000;走势线:ZIGZAG(C,3,1);G:=MA(走势线,2);DRAWTEXT(CROSS(走势线,G),L,'买'),COLORRED;DRAWTEXT(CROSS(G,走势线),H,'卖' ),COLORGREEN;支撑位:IF((走势线-REF(走势线,1))/REF(走势线,1)*100>=0,REF(走势线,BARSLAST(CROSS((走势线-REF(走势线,1))/REF(走势线,1)*100,0))+1),NULL),COLORRED,LINETHICK2;阻力位:IF((走势线-REF(走势线,1))/REF(走势线,1)*100<0,REF(走势线,BARSLAST(CROSS(0,(走势线-REF(走势线,1))/REF(走势线,1)*100))+1),NULL),COLORBLUE,LINETHICK2;买卖价格位:MA(C,3);头部:=PEAKBARS(C,3,1,1)=0;底部:=TROUGHBARS(C,3,1,1)=0;DRAWTEXT(头部,H,'-----------有阻力'),COLORGREEN;DRAWTEXT(底部,L,'+++++++++有支撑'),COLORRED;JRH:=HHV(C,2);JRL:=LLV(C,2);YTSL:=(3*C+L+O+H)/6;Z1D:=C>=REF(C,1);Z1X:=C<=REF(C,1);Z2D:=C>=REF(C,2);Z2X:=C<=REF(C,2);X1D2:=Z1X AND Z2D;D1X2:=Z1D AND Z2X;R1:=Z1D AND Z2D;R2:=REF(R1,1) AND X1D2;R3:=REF(R2,1) AND D1X2;R4:=REF(R3,1) AND X1D2;R5:=REF(R4,1) AND D1X2;R6:=REF(R5,1) AND X1D2;R7:=REF(R6,1) AND D1X2;R8:=REF(R7,1) AND X1D2;R9:=REF(R8,1) AND D1X2;RA:=REF(R9,1) AND X1D2;RB:=REF(RA,1) AND D1X2;RC:=REF(RB,1) AND X1D2;RD:=Z1X AND Z2X;RE:=REF(RD,1) AND D1X2;RF:=REF(RE,1) AND X1D2;R10:=REF(RF,1) AND D1X2;R11:=REF(R10,1) AND X1D2;R12:=REF(R11,1) AND D1X2;R13:=REF(R12,1) AND X1D2;R14:=REF(R13,1) AND D1X2;R15:=REF(R14,1) AND X1D2;R16:=REF(R15,1) AND D1X2;R17:=REF(R16,1) AND X1D2;R18:=REF(R17,1) AND D1X2;R19:=((REF(RD OR RE OR RF OR R10 OR R11 OR R12 OR R13 OR R14 OR R15 OR R16 OR R17 OR R18,1)) AND R1);R1A:=((REF(R1 OR R2 OR R3 OR R4 OR R5 OR R6 OR R7 OR R8 OR R9 OR RA OR RB OR RC,1)) AND RD);红色持股:=R1 OR R2 OR R3 OR R4 OR R5 OR R6 OR R7 OR R8 OR R9 OR RA OR RB OR RC,COLOR0000FF,NODRAW;离场:=IF(红色持股,JRL,NULL);明离场价:=离场,COLORFF99FF,NODRAW;今离场价:REF(离场,1),COLORGREEN,NODRAW;青色观望:=RD OR RE OR RF OR R10 OR R11 OR R12 OR R13 OR R14 OR R15 OR R16 OR R17 OR R18,COLORFFFF00,NODRAW;进:=IF(青色观望,JRH,NULL);明进场价:=进,COLOR33AACC,NODRAW;今进场价:REF(明进场价,1),COLORRED,NODRAW;短买:R19,COLORRED,NODRAW;STICKLINE1(ISLASTBAR AND (红色持股OR REF(红色持股,1)=1),今离场价,今离场价,30,1),COLOR0000FF;STICKLINE1(ISLASTBAR AND (青色观望OR REF(青色观望,1)=1),今进场价,今进场价,30,1),COLOR00FF00;QLIFE:=(EMA(CLOSE,60)+EMA(CLOSE,90))/2,POINTDOT,COLORGREEN,LINETHICK4; FROMOPEN:=IF(HOUR<12,60*(HOUR-9)-30+MINUTE,120+60*(HOUR-13)+MINUTE);TT:=240/FROMOPEN;比:=TT;J12:=(HIGH - ((HIGH - LOW) / 3));J23:=(LOW + ((HIGH - LOW) / 3));AAA:=REFX1(HHV(H,90),10000);BBB:=REFX1(LLV(L,100),10000);DRAWKLINE1(H,O,L,C);PL5:=ZIGZAG(C,5,1);EN1:=ZIGZAG(C,5,1)>REF(ZIGZAG(C,5,1),1) AND REF(ZIGZAG(C,5,1),1)<=REF(ZIGZAG(C,5,1),2) AND REF(ZIGZAG(C,5,1),2)<=REF(ZIGZAG(C,5,1),3);EX1:=ZIGZAG(C,5,1)<REF(ZIGZAG(C,5,1),1) AND REF(ZIGZAG(C,5,1),1)>=REF(ZIGZAG(C,5,1),2) AND REF(ZIGZAG(C,5,1),2)>=REF(ZIGZAG(C,5,1),3);PL10:=ZIGZAG(C,10,1);EN2:=ZIGZAG(C,10,1)>REF(ZIGZAG(C,10,1),1) AND REF(ZIGZAG(C,10,1),1)<=REF(ZIGZAG(C,10,1),2) AND REF(ZIGZAG(C,10,1),2)<=REF(ZIGZAG(C,10,1),3);EX2:=ZIGZAG(C,10,1)<REF(ZIGZAG(C,10,1),1) AND REF(ZIGZAG(C,10,1),1)>=REF(ZIGZAG(C,10,1),2) AND REF(ZIGZAG(C,10,1),2)>=REF(ZIGZAG(C,10,1),3);PL20:=ZIGZAG(C,20,1);EN3:=ZIGZAG(C,20,1)>REF(ZIGZAG(C,20,1),1) AND REF(ZIGZAG(C,20,1),1)<=REF(ZIGZAG(C,20,1),2) AND REF(ZIGZAG(C,20,1),2)<=REF(ZIGZAG(C,20,1),3);EX3:=ZIGZAG(C,20,1)<REF(ZIGZAG(C,20,1),1) AND REF(ZIGZAG(C,20,1),1)>=REF(ZIGZAG(C,20,1),2) AND REF(ZIGZAG(C,20,1),2)>=REF(ZIGZAG(C,20,1),3);PL40:=ZIGZAG(C,40,1);走强1:=BARSLAST(PL5<REF(PL5,1));走弱1:=BARSLAST(PL5>REF(PL5,1));走强2:=BARSLAST(PL10<REF(PL10,1));走弱2:=BARSLAST(PL10>REF(PL10,1));走强3:=BARSLAST(PL20<REF(PL20,1));走弱3:=BARSLAST(PL20>REF(PL20,1));ZTJZ5:=IF(PL10>REF(PL10,1),COUNT(EN1,走强2),0);ZTJD5:=IF(PL10>REF(PL10,1),COUNT(EX1,走强2),0);DTJZ5:=IF(PL10<REF(PL10,1),COUNT(EN1,走弱2),0);DTJD5:=IF(PL10<REF(PL10,1),COUNT(EX1,走弱2),0);ZTJZ10:=IF(PL20>REF(PL20,1),COUNT(EN2,走强3),0);ZTJD10:=IF(PL20>REF(PL20,1),COUNT(EX2,走强3),0);DTJZ10:=IF(PL20<REF(PL20,1),COUNT(EN2,走弱3),0);DTJD10:=IF(PL20<REF(PL20,1),COUNT(EX2,走弱3),0);DRAWTEXT(EN1 AND DTJZ5=1,L*0.95,'A浪进'),COLORGREEN;DRAWTEXT(EX1 AND DTJD5=2,H*1.02,'B浪出'),COLORGREEN;DRAWTEXT(EN2 AND ZTJZ5=1,L*0.95,'C浪进'),COLORGREEN;DRAWTEXT(EX1 AND PL10>REF(PL10,1) AND ZTJD5=1,H*1.02,'⑴空出'),COLORYELLOW; DRAWTEXT(EN1 AND PL10>REF(PL10,1) AND ZTJZ5=2,L*0.98,'⑵多进'),COLORYELLOW; DRAWTEXT(EX1 AND PL10>REF(PL10,1) AND ZTJZ5=2,H*1.02,'⑶空出'),COLORYELLOW; DRAWTEXT(EN1 AND PL10>REF(PL10,1) AND ZTJZ5=3,L*0.98,'⑷多进'),COLORYELLOW; DRAWTEXT(EX2 AND PL20>REF(PL20,1) AND ZTJD10=1,H*1.02,'⑸空出'),COLORYELLOW; DRAWTEXT(EN2 AND DTJZ10=1,L*0.93,'Ⅰ多'),COLORFF00FF;DRAWTEXT(EX2 AND DTJD10=2,H*1.01,'Ⅱ空'),COLORFF00FF;DRAWTEXT(EN3 AND ZTJZ10=1,L*0.93,'Ⅲ多进'),COLORFF00FF;DRAWTEXT(EX2 AND PL20>REF(PL20,1) AND ZTJD10=1,H*1.06,'①空进'),LINETHICK3,COLOR00FFFF;DRAWTEXT(EN2 AND PL20>REF(PL20,1) AND ZTJZ10=2,L*0.94,'②多买补仓'),LINETHICK3,COLOR00FFFF;DRAWTEXT(EX2 AND PL20>REF(PL20,1) AND ZTJD10=2 OR (ZTJD10=0 OR ZTJD10=2) AND EX2,H*1.06,'③空进'),LINETHICK3,COLOR00FFFF;DRAWTEXT(EN2 AND PL20>REF(PL20,1) AND ZTJZ10=3,L*0.94,'④多补仓持有'),LINETHICK3,COLOR00FFFF;BUY1:=ZIGZAG(C,10,1);SELL1:=MA(BUY1,2);DRAWICON(CROSS(BUY1,SELL1),L-0.3,7);DRAWICON(CROSS(SELL1,BUY1),H+0.2,8);STICKLINE1(BUY1>SELL1 AND O>=C,C,O,-1,0),COLORRED;STICKLINE1(BUY1>SELL1 AND O>=C,L,H,0,0),COLORRED;STICKLINE1(BUY1<SELL1 AND O<=C,O,C,-1,1),COLORCYAN;STICKLINE1(BUY1<SELL1 AND O<=C,O,L,0,1),COLORCYAN;STICKLINE1(BUY1<SELL1 AND O<=C,C,H,0,1),COLORCYAN;AMOUNT:=AVPRICE*V;SAT:=(AMOUNT/C)/(HHV(AMOUNT,20)/HHV(C,20));量能饱和:=IF(SAT>1,1,SAT)*100,NODRAW;获利筹码:=WINNER(C)*100,NODRAW;N:=5;LC:=REF(CLOSE,1);RSI值:=SMA(MAX(CLOSE-LC,0),6,1)/SMA(ABS(CLOSE-LC),6,1)*100;WR10:=(HHV(HIGH,3)-CLOSE)/(HHV(HIGH,3)-LLV(LOW,3))*100;活跃:=(RSI值-WR10);活跃度比:=IF(活跃>=0,(活跃+100)/2,100-ABS((活跃-100)/2)),NODRAW;A1:=BACKSET(ISLASTBAR,PEAKBARS(C,N,1,1)+1);A2:=A1>REF(A1,1);B1:=BACKSET(ISLASTBAR,PEAKBARS(C,N,2,1)+1);B2:=B1>REF(B1,1);C1:=BACKSET(ISLASTBAR,PEAKBARS(C,N,3,1)+1);C2:=C1>REF(C1,1);A11:=BACKSET(ISLASTBAR,TROUGHBARS(C,N,1,1)+1);A21:=A11>REF(A11,1);B11:=BACKSET(ISLASTBAR,TROUGHBARS(C,N,2,1)+1);B21:=B11>REF(B11,1);C11:=BACKSET(ISLASTBAR,TROUGHBARS(C,N,3,1)+1);C21:=C11>REF(C11,1);//高辅线:DRAWLINE1(B2,H,A2,H,1),COLORBLUE;//低辅线:DRAWLINE1(B21,L,A21,L,1),COLOR0000FF;KU1:=IF(HIGH=HHV(HIGH,3),1,0);KD1:=IF(LOW=LLV(LOW,3),1,0);UL:=IF(REF(KU1,2)=1 AND REF(KU1,1)=0AND KU1=0,REF(HIGH,2),REF(HIGH,2+BARSLAST(REF(KU1,2)=1AND REF(KU1,1)=0 AND KU1=0)));DL:=IF(REF(KD1,2)=1 AND REF(KD1,1)=0 AND KD1=0,REF(LOW,2),REF(LOW,2+BARSLAST(REF(KD1,2)=1AND REF(KD1,1)=0 AND KD1=0)));HV0:=H>UL AND H>REF(H,1) ;LV0:=L<DL AND L<REF(L,1) ;GP:=BARSLAST(HV0);DP:=BARSLAST(LV0);IP:=IF(GP=0,DP,GP)>3;HV1:=HV0 AND IP AND H>=HHV(H,BARSLAST(LV0));LV1:=LV0 AND IP AND L<=LLV(L,BARSLAST(HV0));DRAWLINE(LV1,LOW,HV1, HIGH,0),COLORYELLOW,LINETHICK2;DRAWLINE(HV1,HIGH,LV1, LOW,0),COLORMAGENTA,LINETHICK2;N1:=10;N2:=10;DISP:=2;。
文华财经软件指标源码公式最准不漂移指标公式源码
/*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;。
文华财经软件-期货界最准确指标公式源码
文华财经软件-期货界最准确指标公式源码简介本文档提供了文华财经软件中期货界最准确指标的源码。
这些指标公式经过独立决策而非用户协助,旨在发挥我作为法律硕士的优势,并遵循简单策略,避免法律复杂性。
所有引用内容均可确认。
目标本文档的目标是提供文华财经软件中期货界最准确指标的源码,以便用户能够使用这些源码进行技术分析和预测。
源码以下是文华财经软件中几个期货界最准确指标的源码示例:1. 移动平均线指标def moving_average(data, period):return data.rolling(window=period).mean()2. 相对强弱指标(RSI)def rsi(data, period):delta = data.diff()up, down = delta.copy(), delta.copy()up[up < 0] = 0down[down > 0] = 0average_gain = up.rolling(window=period).mean()average_loss = abs(down.rolling(window=period).mean())rs = average_gain / average_lossrsi = 100 - (100 / (1 + rs))return rsi3. 布林带指标def bollinger_bands(data, period, std):mid_band = data.rolling(window=period).mean()upper_band = mid_band + std * data.rolling(window=period).std() lower_band = mid_band - std * data.rolling(window=period).std() return mid_band, upper_band, lower_band4. 随机指标(KDJ)def kdj(data, period):lowest_low = data.rolling(window=period).min()highest_high = data.rolling(window=period).max()rsv = (data - lowest_low) / (highest_high - lowest_low) * 100k = rsv.rolling(window=3).mean()d = k.rolling(window=3).mean()j = 3 * k - 2 * dreturn k, d, j请注意,以上仅是示例源码,实际使用时需要适应具体的数据来源和参数设置。
文华财经精品-最准期货指标公式源码
文华财经精品-最准期货指标公式源码文华财经精品是一款专业的财经软件,提供了丰富的期货指标公式源码。
这些指标公式是通过大量的数据分析和实践验证得出的,具有较高的准确性和可靠性。
本文将介绍一些最准期货指标公式的源码,帮助用户更好地利用文华财经精品进行期货交易分析。
1. 移动平均线(Moving Average)移动平均线是一种常用的趋势指标,能够有效地反映出期货价格的变动趋势。
以下是计算简单移动平均线的源码:def moving_average(data, period):ma = []for i in range(period, len(data)):ma.append(sum(data[i-period:i]) / period)return ma2. 相对强弱指标(Relative Strength Index)相对强弱指标是一种衡量期货价格强弱程度的指标,可用于判断市场的超买超卖情况。
以下是计算相对强弱指标的源码:def relative_strength_index(data, period):rsi = []for i in range(period, len(data)):up_sum = 0down_sum = 0for j in range(i-period, i):diff = data[j+1] - data[j]if diff > 0:up_sum += diffelse:down_sum += abs(diff)rs = up_sum / down_sum if down_sum != 0 else 0rsi.append(100 - (100 / (1 + rs)))return rsi3. 随机指标(Stochastic Oscillator)随机指标是一种衡量期货价格高低位的指标,可用于判断市场的超买超卖情况。
以下是计算随机指标的源码:def stochastic_oscillator(data, period):stoch = []for i in range(period, len(data)):highest_high = max(data[i-period:i])lowest_low = min(data[i-period:i])stoch.append((data[i] - lowest_low) / (highest_high - lowest_low) * 100)return stoch以上是文华财经精品中一些最准期货指标的源码示例。
文华财经期货软件指标公式源码RSI顶底背离KDJ背离
文华财经期货软件指标公式源码RSI顶底背离KDJ背离以下是文华财经期货软件中两个常用指标的计算方法和代码实现:RSI(相对强弱指标)和KDJ(随机指标)。
1.RSI(相对强弱指标):RSI指标是一种衡量市场当前价格的涨跌力量的指标,可以用于判断市场的超买和超卖情况。
下面是RSI指标的计算公式:RSI(n)=100-(100/(1+RS))RS=平均上升价格动量/平均下降价格动量其中,n表示计算RSI的周期数。
一般来说,常用的周期数是14下面是用Python实现RSI指标计算的代码:```pythondef rsi(prices, n=14):deltas = np.diff(prices)seed = deltas[:n+1]up = seed[seed >= 0].sum( / ndown = -seed[seed < 0].sum( / nrs = up / downrsi = np.zeros_like(prices)rsi[:n] = 100. - 100. / (1. + rs)for i in range(n, len(prices)):delta = deltas[i - 1]if delta > 0:upval = deltaelse:downval = -deltaup = (up * (n - 1) + upval) / ndown = (down * (n - 1) + downval) / nrs = up / downrsi[i] = 100. - 100. / (1. + rs)return rsi```2.KDJ(随机指标):KDJ指标是一种以价格波动和流动性为基础的技术分析指标,常用于判断股票和期货的超买和超卖情况。
下面是KDJ指标的计算公式:K=(2/3)*上一期K值+(1/3)*当期RSVD=(2/3)*上一期D值+(1/3)*当期KJ=3*D-2*K其中,RSV表示(当期收盘价-最近n个周期最低价)/(最近n个周期最高价-最近n个周期最低价)*100。
文华财经指标公式源码文华期货软件指标公式公式源码
/*拉升力:=(CLOSE-LLV(LOW,28))/(HHV(HIGH,30)-LLV(LOW,36))*0.6*CLOSE; 拉升力A:=SMA(拉升力,6.3,1);波峰波谷:SMA(拉升力A,3,1),COLORFF00FF;拉升力B:=3*拉升力A-2.1*波峰波谷;空方:=3*波峰波谷-1* 拉升力A;做空:IF(空方>拉升力B,拉升力B,空方),LINETHICK2,COLOR00FF00;做空周期:HHV(做空,21),COLORBLUE,LINETHICK2;多头:IF(做空>=REF(做空,1) ,做空,DRAWNULL),COLORRED,LINETHICK3; DRAWICON(做空>=REF(做空,1) AND REF(做空,1)<REF(做空,2),做空,23);空头:IF(做空<REF(做空,1),做空,DRAWNULL),COLORGREEN,LINETHICK3; {DRAWICON(做空<=REF(做空,1) AND REF(做空,1)>REF(做空,2),做空,19);} 短线:(CLOSE-MA(CLOSE,13))/MA(CLOSE,13)*20,LINETHICK0,COLORWHITE; 中线:(CLOSE-MA(CLOSE,4))/MA(CLOSE,4)*20,LINETHICK0,COLORYELLOW;红柱:SMA(短线,3,1),LINETHICK0,COLOR0000FF;蓝柱:SMA(中线,3,1),COLORSTICK,COLORFFFF00;{红柱}STICKLINE(红柱<REF(红柱,1)AND 红柱>0,0,红柱,2,0),COLOR888800; STICKLINE(红柱<REF(红柱,1)AND 红柱>0,0,红柱,1.5,0),COLORAAAA00; STICKLINE(红柱<REF(红柱,1)AND 红柱>0,0,红柱,0.8,0),COLORDDDD00; STICKLINE(红柱<REF(红柱,1)AND 红柱>0,0,红柱,0.3,0),COLORFFFF00; STICKLINE(红柱>REF(红柱,1)AND 红柱>0,0,红柱,2,0),COLOR000088; STICKLINE(红柱>REF(红柱,1)AND 红柱>0,0,红柱,1.5,0),COLOR0000AA; STICKLINE(红柱>REF(红柱,1)AND 红柱>0,0,红柱,0.8,0),COLOR0000DD; STICKLINE(红柱>REF(红柱,1)AND 红柱>0,0,红柱,0.3,0),COLOR0000FF; STICKLINE(蓝柱<REF(蓝柱,1) AND 蓝柱>0,0,蓝柱,2,0),COLOR008800; STICKLINE(蓝柱<REF(蓝柱,1) AND 蓝柱>0,0,蓝柱,1,0),COLOR00AA00; STICKLINE(蓝柱<REF(蓝柱,1) AND 蓝柱>0,0,蓝柱,0.8,0),COLOR00DD00; STICKLINE(蓝柱<REF(蓝柱,1) AND 蓝柱>0,0,蓝柱,0.3,0),COLOR00FF00;{蓝柱}STICKLINE(红柱>REF(红柱,1)AND 红柱<0,0,红柱,2,0),COLOR880088;STICKLINE(红柱>REF(红柱,1)AND 红柱<0,0,红柱,1.5,0),COLORAA00AA; STICKLINE(红柱>REF(红柱,1)AND 红柱<0,0,红柱,0.8,0),COLORDD00DD; STICKLINE(红柱>REF(红柱,1)AND 红柱<0,0,红柱,0.3,0),COLORFF00FF; STICKLINE(红柱<REF(红柱,1)AND 红柱<0,0,红柱,2,0),COLOR888800; STICKLINE(红柱<REF(红柱,1)AND 红柱<0,0,红柱,1.5,0),COLORAAAA00; STICKLINE(红柱<REF(红柱,1)AND 红柱<0,0,红柱,0.8,0),COLORDDDD00; STICKLINE(红柱<REF(红柱,1)AND 红柱<0,0,红柱,0.3,0),COLORFFFF00; STICKLINE(蓝柱>REF(蓝柱,1)AND 蓝柱<0,0,蓝柱,2,0),COLOR009999; STICKLINE(蓝柱>REF(蓝柱,1)AND 蓝柱<0,0,蓝柱,1.5,0),COLOR00BBBB; STICKLINE(蓝柱>REF(蓝柱,1)AND 蓝柱<0,0,蓝柱,0.8,0),COLOR00DDDD; STICKLINE(蓝柱>REF(蓝柱,1)AND 蓝柱<0,0,蓝柱,0.3,0),COLOR00FFFF;VAR200:=(CLOSE-LLV(LOW,20))/(HHV(HIGH,20)-LLV(LOW,20))*100;VAR300:=SMA(SMA(VAR200,3,1),3,1)/28.57;VAR400:=EMA(VAR300,5);B1:=(CLOSE-MA(CLOSE,6))/MA(CLOSE,6)*100;B2:=(CLOSE-MA(CLOSE,13))/MA(CLOSE,13)*100;B3:=(CLOSE-MA(CLOSE,20))/MA(CLOSE,20)*100;B4:=(CLOSE-MA(CLOSE,30))/MA(CLOSE,30)*100;M:=(LOW+HIGH+CLOSE)/3;HD:=(HIGH - REF(HIGH,1));LD:=(REF(LOW,1) - LOW);DMP:=(SUM(IF(((HD>0) AND (HD>LD)),HD,0),5) );DMM:=SUM(IF(((LD>0) AND (LD>HD)),LD,0),5);STX:=(((DMP)*100)/TR);FZX:=((DMM*100)/TR);XXX:=(MA(((ABS((FZX-STX))/(FZX+STX)) * 100),3));WJDB:=IF(((XXX>88) AND (STX<5.8)),25,0);DRAWICON(WJDB=25,-5,9);STICKLINE(B1<-7,5,0,3,0),COLOR0099FF;STICKLINE(B2<-9,10,0,2.2,0),COLOR0066FF;STICKLINE(B3<-11,15,0,1.4,0),COLOR0033FF;STICKLINE(B4<-13,20,0,0.6,0),COLOR0000FF;DRAWTEXT(B1<-7 AND B2<-9 AND B3<-11 AND B4<-13,18,'超跌'),COLORYELLOW; STICKLINE(B1>10,0,-5,3,0),COLORFFFF33;STICKLINE(B2>15,0,-10,2.2,0),COLORFFCC00;STICKLINE(B3>20,0,-15,1.4,0),COLORFF9933;STICKLINE(B4>25,0,-20,0.6,0),COLORFF6633;DRAWTEXT(B1>10 AND B2>15 AND B3>20 AND B4>25,-18,'预警'),COLORYELLOW; BL:(B1+B2+B3+B4)/2,LINETHICK2,COLORFF00FF;BLMA:MA(BL,6),LINETHICK2,COLORCC0000;DRAWTEXT(BL>50,BL-2,'◆谨慎'),COLORYELLOW;DRAWTEXT(BL<-35,BL+2,'◆关注'),COLORYELLOW;操盘:=3*VAR300-2*VAR400;A1:=CROSS(操盘,VAR300) AND VAR300<2.1 AND C>O;STICKLINE(A1,5,0,4,0),COLOR770077;STICKLINE(A1,5,0,3,0),COLOR990099;STICKLINE(A1,5,0,2,0),COLORBB00BB;STICKLINE(A1,5,0,1,0),COLORDD00DD;STICKLINE(A1,5,0,0.3,0),COLORFF00FF;DRAWTEXT(A1,5.2,'全仓买入'),COLORRED;*/S:=CROSS(CLOSE,EMA(HIGH,30));X:=CROSS(EMA(LOW,30),CLOSE);WS:=BARSLAST(S)+1;WX:=BARSLAST(X)+1;SS:=CROSS(SUM(S,WX),0.5);XX:=CROSS(SUM(X,WS),0.5);STICKLINE1(CLOSE>EMA(HIGH,30),EMA(HIGH,30),EMA(LOW,30),1,1),COLORRED; STICKLINE1(CLOSE<EMA(LOW,30),EMA(LOW,30),EMA(HIGH,30),1,1),COLORGREEN; STICKLINE1(CLOSE>EMA(HIGH,150),EMA(HIGH,150),EMA(LOW,150),1,1),COLORMAGENTA; STICKLINE1(CLOSE<EMA(LOW,150),EMA(LOW,150),EMA(HIGH,150),1,1),COLORBLUE; PARTLINE1(CLOSE>EMA(HIGH,30),EMA(HIGH,30)),COLORRED;PARTLINE1(CLOSE<EMA(HIGH,30),EMA(HIGH,30)),COLORGREEN;PARTLINE1(CLOSE>EMA(LOW,30),EMA(LOW,30)),COLORRED;PARTLINE1(CLOSE<EMA(LOW,30),EMA(LOW,30)),COLORGREEN;PARTLINE1(CLOSE>EMA(HIGH,150),EMA(HIGH,150)),COLORMAGENTA;PARTLINE1(CLOSE<EMA(HIGH,150),EMA(HIGH,150)),COLORBLUE;PARTLINE1(CLOSE>EMA(LOW,150),EMA(LOW,150)),COLORMAGENTA;PARTLINE1(CLOSE<EMA(LOW,150),EMA(LOW,150)),COLORBLUE;DRAWTEXT(SS,LOW*0.965,'B'),COLORRED;DRAWICON(SS,LOW*0.98,8);DRAWTEXT(XX,HIGH*1.035,'S'),COLORGREEN;DRAWICON(XX,HIGH*1.02,9);。
文华财经指标源码
文华财经指标源码阳光心情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;。
文华财经指标公式源码文华财经指标MACD低位金叉二次金叉指标
/*{M1=5 M2=13 M3=34 M4=55 M5=89 M6=144 M7=233}涨停:STICKLINE(C>REF(C,1)*1.099,C,O,3,0),COLORCC00CC; 跌停:STICKLINE(REF(C,1)*0.909>C,C,O,3,0),COLORGREEN; EMA5:EMA(C,M1);EMA13:EMA(C,M2);EMA21:EMA(C,M5),COLOR5CADAD;EMA34:EMA(C,M3);EMA55:EMA(C,M4),COLORRED,LINETHICK2;EMA144:EMA(C,M6),COLOR20BA22;EMA233:EMA(C,M7),COLORBLUE;X1:=EMA(EMA(CLOSE,9),9);X2:=(X1-REF(X1,1))/REF(X1,1);DRAWICON(CROSS(X2,0),L*0.97,1);DRAWNUMBER(ISLASTBAR,LOW,BARSLAST(NOT(EMA(C,M1)<REF(E MA(C,M1),1))));IF(EMA55<REF(EMA55,1),EMA55,DRAWNULL),COLORGREEN,LINETH ICK2;倍量:=VOL>=REF(V,1)*1.91 AND C>O;缩量:=REF(V,1)>=VOL*1.91 AND C<O;STICKLINE(倍量,OPEN,(C+O)*0.5,0.3,0),COLORRED; STICKLINE(缩量,OPEN,(C+O)*0.5,0.3,0),COLORBLUE;上跳:STICKLINE(LOW>REF(C,1) ,L*0.996,L*0.9925,2,0),COLORRED; 下跳:STICKLINE(H<REF(C,1) ,H*1.002,H*1.006,2,0),COLORBLUE;双线持币:HHV(MA(HIGH,(3)),2),LINETHICK1,COLOR00FF00;单线持股:LLV(MA(HIGH,(3)),1),LINETHICK1,COLOR0000FF;VAR1:=CLOSE>REF(CLOSE,1) AND CLOSE>REF(CLOSE,2);VAR2:=REF(VAR1,1) AND CLOSE<=REF(CLOSE,1) ANDCLOSE>=REF(CLOSE,2);VAR3:=REF(VAR2,1) AND CLOSE>=REF(CLOSE,1) ANDCLOSE<=REF(CLOSE,2);VAR4:=REF(VAR3,1) AND CLOSE<=REF(CLOSE,1) ANDCLOSE>=REF(CLOSE,2);VAR5:=REF(VAR4,1) AND CLOSE>=REF(CLOSE,1) ANDCLOSE<=REF(CLOSE,2);VAR6:=REF(VAR5,1) AND CLOSE<=REF(CLOSE,1) AND CLOSE>=REF(CLOSE,2);VAR7:=REF(VAR6,1) AND CLOSE>=REF(CLOSE,1) AND CLOSE<=REF(CLOSE,2);VAR8:=REF(VAR7,1) AND CLOSE<=REF(CLOSE,1) AND CLOSE>=REF(CLOSE,2);VAR9:=REF(VAR8,1) AND CLOSE>=REF(CLOSE,1) AND CLOSE<=REF(CLOSE,2);VARA:=REF(VAR9,1) AND CLOSE<=REF(CLOSE,1) AND CLOSE>=REF(CLOSE,2);VARB:=REF(VARA,1) AND CLOSE>=REF(CLOSE,1) AND CLOSE<=REF(CLOSE,2);VARC:=REF(VARB,1) AND CLOSE<=REF(CLOSE,1) AND CLOSE>=REF(CLOSE,2);VARD:=CLOSE<REF(CLOSE,1) AND CLOSE<REF(CLOSE,2); VARE:=REF(VARD,1) AND CLOSE>=REF(CLOSE,1) AND CLOSE<=REF(CLOSE,2);VARF:=REF(VARE,1) AND CLOSE<=REF(CLOSE,1) AND CLOSE>=REF(CLOSE,2);VAR10:=REF(VARF,1) AND CLOSE>=REF(CLOSE,1) AND CLOSE<=REF(CLOSE,2);VAR11:=REF(VAR10,1) AND CLOSE<=REF(CLOSE,1) ANDCLOSE>=REF(CLOSE,2);VAR12:=REF(VAR11,1) AND CLOSE>=REF(CLOSE,1) AND CLOSE<=REF(CLOSE,2);VAR13:=REF(VAR12,1) AND CLOSE<=REF(CLOSE,1) AND CLOSE>=REF(CLOSE,2);VAR14:=REF(VAR13,1) AND CLOSE>=REF(CLOSE,1) AND CLOSE<=REF(CLOSE,2);VAR15:=REF(VAR14,1) AND CLOSE<=REF(CLOSE,1) AND CLOSE>=REF(CLOSE,2);VAR16:=REF(VAR15,1) AND CLOSE>=REF(CLOSE,1) AND CLOSE<=REF(CLOSE,2);VAR17:=REF(VAR16,1) AND CLOSE<=REF(CLOSE,1) AND CLOSE>=REF(CLOSE,2);VAR18:=REF(VAR17,1) AND CLOSE>=REF(CLOSE,1) AND CLOSE<=REF(CLOSE,2);VAR19:=REF(VARD OR VARE OR VARF OR VAR10 OR VAR11 OR VAR12 OR VAR13 ORVAR14 OR VAR15 OR VAR16 OR VAR17 OR VAR18,1) AND VAR1; VAR1A:=REF(VAR1 OR VAR2 OR VAR3 OR VAR4 OR VAR5 OR VAR6 OR VAR7 ORVAR8 OR VAR9 OR VARA OR VARB OR VARC,1) AND VARD;STICKLINE(VAR1A,H*1.010,H*1.006,1,0),COLORGREEN; STICKLINE(VAR19,L*0.994,L*0.99,1,0),COLORYELLOW;AAA:=CONST(HHV(H,90));TT:=240/FROMOPEN;比:=TT;J12:=(HIGH - ((HIGH - LOW) / 3));J23:=(LOW + ((HIGH - LOW) / 3));D1{早晨之星}:=CONST(IF((REF(CLOSE,2)/REF(OPEN,2) < 0.95 AND REF(OPEN,1)< REF(CLOSE,2) ANDABS(REF(OPEN,1)-REF(CLOSE,1))/REF(CLOSE,1)<0.03 AND CLOSE/OPEN>1.05 AND CLOSE>REF(CLOSE,2)),1,0));D2{黄昏之星}:=CONST(IF((REF(CLOSE,2)/REF(OPEN,2) > 1.03 AND REF(OPEN,1)> REF(CLOSE,2) ANDABS(REF(OPEN,1)-REF(CLOSE,1))/REF(CLOSE,1)<0.02AND CLOSE/OPEN<0.97 AND CLOSE<REF(CLOSE,2)),1,0));D3{长十字}:=CONST(IF((CLOSE=OPEN AND HIGH/LOW >1.03),1,0)); D4{垂死十字}:=CONST(IF((CLOSE=OPEN AND CLOSE=LOW AND CLOSE!=HIGH),1,0));D5{早晨十字星}:=CONST(IF((REF(CLOSE,2)/REF(OPEN,2) < 0.95 AND REF(OPEN,1)< REF(CLOSE,2) AND REF(OPEN,1)=REF(CLOSE,1) ANDCLOSE/OPEN>1.05 AND CLOSE>REF(CLOSE,2)),1,0));D6{黄昏十字星}:=CONST(IF((REF(CLOSE,2)/REF(OPEN,2) > 1.05 AND REF(OPEN,1)> REF(CLOSE,2) AND REF(OPEN,1)=REF(CLOSE,1) ANDCLOSE/OPEN<0.95 AND CLOSE<REF(CLOSE,2)),1,0));D7{射击之星}:=CONST(IF((MIN(OPEN,CLOSE)=LOW ANDHIGH-LOW >3*(MAX(OPEN,CLOSE)-LOW) AND CLOSE > MA(CLOSE,5)),1,0));D8{倒转锤头}:=CONST(IF((MIN(OPEN,CLOSE)=LOW ANDHIGH-LOW >3*(MAX(OPEN,CLOSE)-LOW) AND CLOSE < MA(CLOSE,5)),1,0));D9{锤头}:=CONST(IF((HIGH = MAX(OPEN,CLOSE) ANDHIGH-LOW >3*(HIGH-MIN(OPEN,CLOSE)) AND CLOSE < MA(CLOSE,5)),1,0));D10{吊颈}:=CONST(IF((HIGH = MAX(OPEN,CLOSE) ANDHIGH-LOW >3*(HIGH-MIN(OPEN,CLOSE)) AND CLOSE>MA(CLOSE,5)),1,0));D11{穿头破脚}:=CONST(IF(((REF(CLOSE,1)/REF(OPEN,1)>1.03 AND CLOSE/OPEN<0.96AND CLOSE<REF(OPEN,1)AND OPEN>REF(CLOSE,1))OR (REF(CLOSE,1)/REF(OPEN,1)<0.97AND CLOSE/OPEN>1.04AND CLOSE>REF(OPEN,1) AND OPEN<REF(CLOSE,1))),1,0));D12{乌云盖顶}:=CONST(IF((REF(CLOSE,1)/REF(OPEN,1)>1.03 AND CLOSE/OPEN<0.97AND OPEN>REF(CLOSE,1) AND CLOSE<REF(CLOSE,1)),1,0));D13{曙光初现}:=CONST(IF((REF(CLOSE,1)/REF(OPEN,1)<0.97 AND CLOSE/OPEN>1.03AND OPEN<REF(CLOSE,1) AND CLOSE>REF(CLOSE,1)),1,0));D14{身怀六甲}:=CONST(IF((ABS(REF(CLOSE,1)-REF(OPEN,1))/REF(CLOSE,1) > 0.04AND ABS(CLOSE-OPEN)/CLOSE<0.005 ANDMAX(CLOSE,OPEN) < MAX(REF(CLOSE,1),REF(OPEN,1)) ANDMIN(CLOSE,OPEN)> MIN(REF(CLOSE,1),REF(OPEN,1))),1,0));D15{十字胎}:=CONST(IF((ABS(REF(CLOSE,1)-REF(OPEN,1))/REF(CLOSE,1) > 0.04AND CLOSE=OPEN ANDCLOSE < MAX(REF(CLOSE,1),REF(OPEN,1)) AND CLOSE >MIN(REF(CLOSE,1),REF(OPEN,1))),1,0));D16{平顶}:=CONST(IF((ABS(HIGH-REF(HIGH,1))/HIGH<0.001),1,0));D17{平底}:=CONST(IF(((ABS(LOW-REF(LOW,1))/LOW<0.001 AND ABS(REF(LOW,1)-REF(LOW,2))/REF(LOW,1)<=0.001)),1,0));D18{大阳烛}:=CONST(IF((CLOSE/OPEN>1.05 AND HIGH/LOW < CLOSE/OPEN+0.018),1,0));D19{三个白武士}:=CONST(IF((REF(CLOSE,2)>REF(OPEN,2) AND REF(CLOSE,1)>REF(OPEN,1) AND CLOSE>OPENAND REF(CLOSE,1)>REF(CLOSE,2) AND CLOSE>REF(CLOSE,1)),1,0)); D20{双飞乌鸦}:=CONST(IF((REF(CLOSE,1)<REF(OPEN,1) AND CLOSE<OPENAND CLOSE/OPEN<0.98),1,0));D21{孕育线}:=CONST(IF((REF(CLOSE,2)>REF(OPEN,2) AND(REF(CLOSE,2)-REF(OPEN,2))/REF(OPEN,2)>=2/100 ANDREF(OPEN,1)>=REF(CLOSE,1)AND (REF(OPEN,1)-REF(CLOSE,1))/REF(CLOSE,1)<=2/100 AND REF(OPEN,1)<=REF(CLOSE,2) AND REF(CLOSE,1)>=REF(OPEN,2) ANDC>=OPENAND (CLOSE-OPEN)/OPEN>=2/100 AND CLOSE>=REF(OPEN,1) AND OPEN<=REF(CLOSE,1)AND(MAX(CLOSE,REF(C,2))-MIN(CLOSE,REF(CLOSE,2)))/MIN(CLOSE,REF (CLOSE,2))*/DIFF:EMA(CLOSE,12)-EMA(CLOSE,27);DEA:EMA(DIFF,9);MACD:=2*(DIFF-DEA);STICKLINE1(MACD>=0&&MACD>REF(MACD,1),MACD,0,1,0),COLORMAGENTA; STICKLINE1(MACD>=0&&MACD<REF(MACD,1),MACD,0,1,0),COLORRED; STICKLINE1(MACD<0,0,MACD,1,0 ),COLORGREEN;STICKLINE1(MACD<0&&CROSS(MACD>REF(MACD,1),0.5),0,MACD,1,0 ),COLORYELL OW;IF(DIFF<0,DIFF,0),COLORRED,LINETHICK1;IF(DIFF<0,0,DIFF),COLORYELLOW,LINETHICK1;//IF(DIFFIF(DIFF>DEA,DEA,DEA),COLORWHITE,LINETHICK1;低位金叉:=CROSS(DIFF,DEA) && DIFF<-0.1;STICKLINE1(低位金叉,0,-0.18,6,0),COLORYELLOW;DRAWTEXT(低位金叉,-0.1,' 低位金叉'),COLORYELLOW;高位死叉:=CROSSDOWN(DIFF,DEA) && DIFF>0.1;DRAWTEXT(高位死叉,0.1,' 高位死叉'),COLORYELLOW;JCCOUNT:=COUNT(CROSS(DIFF,DEA),BARSLAST(DEA>=0));SCCOUNT:=COUNT(CROSSDOWN(DIFF,DEA),BARSLAST(DEA<0));二次金叉:=CROSS(DIFF,DEA) && DEA<0 && COUNT(JCCOUNT=2,21)=1;STICKLINE1(二次金叉,0,-0.18,6,0),COLORFF00FF;DRAWICON(二次金叉,DEA*1.04,13) ;DRAWTEXT(二次金叉,-0.1,' 二次金叉'),COLORFF00FF;二次死叉:=CROSSDOWN(DIFF,DEA) && DEA>=0 && COUNT(SCCOUNT=2,21)=1; DRAWTEXT(二次死叉,0.1,' 二次死叉'),COLORFF00FF;A1:=BARSLAST(REF(CROSS(DIFF,DEA),1));底背离:=REF(CLOSE,A1+1)>CLOSE && DIFF>REF(DIFF,A1+1) && CROSS(DIFF,DEA); STICKLINE1(底背离,0,0.13,6,0),COLOR00FF00;DRAWLINE1(A1=0,DEA,底背离,DEA,0),COLORRED,LINETHICK2;DRAWTEXT(底背离,0.1,' 底背离'),COLOR00FF00;A2:=BARSLAST(REF(CROSS(DEA,DIFF),1));顶背离:=REF(CLOSE,A2+1)<C&&DIFF<REF(DIFF,A1+2) && CROSS(DEA,DIFF); DRAWLINE1(A2=0,DEA,顶背离,DEA,0),COLORGREEN,LINETHICK2;DRAWCOLORLINE(BARSLAST(高位死叉)<BARSLAST(低位金叉),DIFF,COLORCYAN,COLORRED);。
文华财经:期货行业最准确的指标公式源码
文华财经:期货行业最准确的指标公式源码引言本文档旨在介绍文华财经所提供的期货行业最准确的指标公式源码。
这些指标公式可以帮助投资者更好地分析期货市场,做出明智的投资决策。
指标公式源码以下是文华财经提供的期货行业最准确的指标公式源码:1. 移动平均线(Moving Average):MA(n) = sum(close, n) / n其中,`close`代表收盘价,`n`代表计算的周期。
2. 相对强弱指标(Relative Strength Index,简称RSI):RSI(n) = 100 - (100 / (1 + RS))RS = avg(upward_close, n) / avg(downward_close, n)其中,`upward_close`代表收盘价上涨的部分,`downward_close`代表收盘价下跌的部分,`n`代表计算的周期。
3. 随机指标(Stochastic Oscillator):%K(n) = (close - min(low, n)) / (max(high, n) - min(low, n)) * 100 %D(n) = MA(%K, m)其中,`low`代表最低价,`high`代表最高价,`n`代表计算%K 的周期,`m`代表计算%D的周期。
4. 平均真实范围(Average True Range,简称ATR):TR(n) = max(high - low, abs(high - close_prev), abs(low -close_prev))ATR(n) = MA(TR, n)其中,`close_prev`代表前一日的收盘价,`n`代表计算的周期。
5. 动量指标(Momentum):MOM(n) = close - close_prev其中,`close_prev`代表前一日的收盘价,`n`代表计算的周期。
结论以上是文华财经所提供的期货行业最准确的指标公式源码。
文华财经指标文华财经期货软件指标压力支撑指标公式源码
/*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;。
文华财经指标文华财经期货软件指标多空线指标公式源码
/*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;。
文华财经指标公式源码文华财经指标多指标顶底背离
/*一号线:EMA(CLOSE,144);工作线:EMA(CLOSE,14),COLORRED;二号线:EMA(CLOSE,25);三号线:EMA(CLOSE,318);生命线:EMA(CLOSE,453),COLORRED,LINETHICK2;五号线:EMA(CLOSE,550);六号线:EMA(CLOSE,610);七号线:EMA(CLOSE,730);八号线:EMA(CLOSE,888);九号线:EMA(CLOSE,99),COLORGREEN;DIFF:=( EMA(CLOSE,7) - EMA(CLOSE,19));DEA:=EMA(DIFF,9);MACD:=0.90*(DIFF-DEA);TJ:=(DIFF>=DEA);TJ1:=(DIFF>=0);STICKLINE(TJ,H,L,0.5,0),COLORYELLOW;STICKLINE(TJ,O,C,4,0),COLORYELLOW;STICKLINE(TJ1 AND TJ,H,L,0.5,0),COLORF00FF0;STICKLINE(TJ1 AND TJ,O,C,4,1),COLORF00FF0;STICKLINE(DIFF<DEA,H,L,0.5,0),COLORF0F000;STICKLINE(DIFF<DEA,O,C,4,0),COLORF0F000;VAR1:=(CLOSE*2+HIGH+LOW)/4;SK:= EMA(VAR1,13)-EMA(VAR1,73);SD:= EMA(SK,2);DRAWTEXT((CROSS(SK,SD) AND SK<-0.04 AND (C-REF(C,1))/REF(C,1)>=0.03) OR (CROSS(SK,SD) AND SK<=-0.14 )OR (CROSS(SK,SD) AND SK<=0.05 AND (V/MA(V,5)>2 OR C/REF(C,1)>0.035)) ,L*0.99,'短线'),COLORGREEN;STICKLINE((CROSS(SK,SD) AND SK<-0.04 AND (C-REF(C,1))/REF(C,1)>=0.03) OR (CROSS(SK,SD) AND SK<=-0.14 )OR (CROSS(SK,SD) AND SK<=0.05 AND (V/MA(V,5)>2 OR C/REF(C,1)>0.035)),H,L,0.5,0),COLORRED;STICKLINE((CROSS(SK,SD) AND SK<-0.04 AND (C-REF(C,1))/REF(C,1)>=0.03) OR (CROSS(SK,SD) AND SK<=-0.14 )OR (CROSS(SK,SD) AND SK<=0.05 AN */DIFF :=EMA(CLOSE,12) - EMA(CLOSE,26);DEA :=EMA(DIFF,9);MACD :=(DIFF-DEA)*2;TR := SUM(MAX(MAX(HIGH-LOW,ABS(HIGH-REF(CLOSE,1))),ABS(LOW-REF(CLOSE,1))),14); HD := HIGH-REF(HIGH,1);LD := REF(LOW,1)-LOW;PDM:= SUM(IF(HD>0 AND HD>LD,HD,0),14);MDM:= SUM(IF(LD>0 AND LD>HD,LD,0),14);PDI:= PDM*100/TR;MDI:= MDM*100/TR;RSV:=(CLOSE-LLV(LOW,9))/(HHV(HIGH,9)-LLV(LOW,9))*100;K:=SMA(RSV,3,1);D:=SMA(K,3,1);J:=3*K-2*D;LC :=REF(CLOSE,6);//前一周期收盘价RSI1:=SMA(MAX(CLOSE-LC,0),12,1)/SMA(ABS(CLOSE-LC),12,1)*100;//当根K线收盘价与前一周期收盘价做差,在该差值与0之间取最大值,做N1周期移动平均。
文华财经指标源码
阳光心情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,COLORCYA N);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,COLORYELL OW;顺势有位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,COL ORRED,0);STICKLINE((EMA(CLOSE,13) >= EMA(CLOSE,34)),OPEN,CLOSE,COLORRED,0);STICKLINE((EMA(CLOSE,13) <EMA(CLOSE,34)),LOW,HIGH,COL ORGREEN,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),COLO RGREEN);DRAWLINE(T=-1&&REF(T,1)=-1,G,T=-1&&REF(T,1)=-1,REF(G,1),COLORR ED);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,CL OSE,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,COL ORWHITE);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;。
- 1、下载文档前请自行甄别文档内容的完整性,平台不提供额外的编辑、内容补充、找答案等附加服务。
- 2、"仅部分预览"的文档,不可在线预览部分如存在完整性等问题,可反馈申请退款(可完整预览的文档不适用该条件!)。
- 3、如文档侵犯您的权益,请联系客服反馈,我们会尽快为您处理(人工客服工作时间:9:00-18:30)。
最高价连线与最低价连线
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);
自编KDJ
RSV:=(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);
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));
CD:=(BB1 * 0.6);
DRAWTEXT((CD = 0.6),L,'买'),COLORLIGHTRED;
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);
一线走天下
TR:=MAX(MAX((HIGH-LOW),ABS(REF(CLOSE,1)-HIGH)),ABS(REF(CLOSE,1)-LOW)); A:=EMA(TR,13)*1.2;
B:=HHV(C-A,21);
E:=IFELSE((C>B|| C=B),C,B);
F:=IFELSE(C<B,C,B);
PARTLINE(C>0,E,COLORRED);
PARTLINE(C>0,F,COLORGREEN);
STICKLINE(C>=O,C,O,COLORRED,0);
DRAWLINE(C>=O,H,C>=O,L,COLORYELLOW);
STICKLINE(C<=O,C,O,COLORBLUE,0);
DRAWLINE(C<=O,H,C<=O,L,COLORWHITE);。