通达信指标公式源码概况:
指标类别:通达信指标公式
授权方式:免费版
指标评级:★★★★★
指标分类:策略
画线方法:主图
相关简介:通达信精准线主图公式(最好用的主图)源码分享
用法说明:
红柱:向上红色柱,表示股价处于超跌状态信号,随时会有反弹;
黄柱:向上的黄色柱,表示股价处于底部区域信号,可择机入场买入;
绿三角:向下的绿三角信号,表示红柱、黄柱同时满足,形成指标共振,中长期底部的可能性较大。
通达信指标公式源码:
VAR1:=CLOSE>REF(CLOSE,1)ANDCLOSE>REF(CLOSE,2);
VAR2:=REF(VAR1,1)ANDCLOSE<=REF(CLOSE,1)ANDCLOSE>=REF(CLOSE,2);
VAR3:=REF(VAR2,1)ANDCLOSE>=REF(CLOSE,1)ANDCLOSE<=REF(CLOSE,2);
VAR4:=REF(VAR3,1)ANDCLOSE<=REF(CLOSE,1)ANDCLOSE>=REF(CLOSE,2);
VAR5:=REF(VAR4,1)ANDCLOSE>=REF(CLOSE,1)ANDCLOSE<=REF(CLOSE,2);
VAR6:=REF(VAR5,1)ANDCLOSE<=REF(CLOSE,1)ANDCLOSE>=REF(CLOSE,2);
VAR7:=REF(VAR6,1)ANDCLOSE>=REF(CLOSE,1)ANDCLOSE<=REF(CLOSE,2);
VAR8:=REF(VAR7,1)ANDCLOSE<=REF(CLOSE,1)ANDCLOSE>=REF(CLOSE,2);
VAR9:=REF(VAR8,1)ANDCLOSE>=REF(CLOSE,1)ANDCLOSE<=REF(CLOSE,2);
VARA:=REF(VAR9,1)ANDCLOSE<=REF(CLOSE,1)ANDCLOSE>=REF(CLOSE,2);
VARB:=REF(VARA,1)ANDCLOSE>=REF(CLOSE,1)ANDCLOSE<=REF(CLOSE,2);
VARC:=REF(VARB,1)ANDCLOSE<=REF(CLOSE,1)ANDCLOSE>=REF(CLOSE,2);
STICKLINE(VAR1ORVAR2ORVAR3ORVAR4ORVAR5ORVAR6ORVAR7OR
VAR8ORVAR9ORVARAORVARBORVARC,CLOSE,REF(CLOSE,1),3,1),COLORRED;{红1}
VARD:=CLOSE<REF(CLOSE,1)ANDCLOSE<REF(CLOSE,2);
VARE:=REF(VARD,1)ANDCLOSE>=REF(CLOSE,1)ANDCLOSE<=REF(CLOSE,2);
VARF:=REF(VARE,1)ANDCLOSE<=REF(CLOSE,1)ANDCLOSE>=REF(CLOSE,2);
VAR10:=REF(VARF,1)ANDCLOSE>=REF(CLOSE,1)ANDCLOSE<=REF(CLOSE,2);
VAR11:=REF(VAR10,1)ANDCLOSE<=REF(CLOSE,1)ANDCLOSE>=REF(CLOSE,2);
VAR12:=REF(VAR11,1)ANDCLOSE>=REF(CLOSE,1)ANDCLOSE<=REF(CLOSE,2);
VAR13:=REF(VAR12,1)ANDCLOSE<=REF(CLOSE,1)ANDCLOSE>=REF(CLOSE,2);
VAR14:=REF(VAR13,1)ANDCLOSE>=REF(CLOSE,1)ANDCLOSE<=REF(CLOSE,2);
VAR15:=REF(VAR14,1)ANDCLOSE<=REF(CLOSE,1)ANDCLOSE>=REF(CLOSE,2);
VAR16:=REF(VAR15,1)ANDCLOSE>=REF(CLOSE,1)ANDCLOSE<=REF(CLOSE,2);
VAR17:=REF(VAR16,1)ANDCLOSE<=REF(CLOSE,1)ANDCLOSE>=REF(CLOSE,2);
VAR18:=REF(VAR17,1)ANDCLOSE>=REF(CLOSE,1)ANDCLOSE<=REF(CLOSE,2);
STICKLINE(VARDORVAREORVARFORVAR10ORVAR11ORVAR12ORVAR13OR
VAR14ORVAR15ORVAR16ORVAR17ORVAR18,CLOSE,REF(CLOSE,1),3,0),COLORFFCC66;
VAR19:=REF(VARDORVAREORVARFORVAR10ORVAR11ORVAR12ORVAR13OR
VAR14ORVAR15ORVAR16ORVAR17ORVAR18,1)ANDVAR1;
STICKLINE(VAR19,REF(CLOSE,1),REF(CLOSE,2),4,1),COLORYELLOW;
VAR1A:=REF(VAR1ORVAR2ORVAR3ORVAR4ORVAR5ORVAR6ORVAR7OR
VAR8ORVAR9ORVARAORVARBORVARC,1)ANDVARD;
STICKLINE(VAR1A,REF(CLOSE,1),REF(CLOSE,2),5,2),COLOR00FF00{98FD};
STICKLINE(VAR19,REF(CLOSE,1),REF(CLOSE,2),3,0),COLOR00C8FF;
STICKLINE(VAR19,REF(CLOSE,1),REF(CLOSE,2),2,0),COLOR10ECFF;
STICKLINE(VAR19,REF(CLOSE,1),REF(CLOSE,2),2,0),COLOR10FFFF;
STICKLINE(VAR1A,REF(CLOSE,1),REF(CLOSE,2),3,0),COLOR00D900;
STICKLINE(VAR1A,REF(CLOSE,1),REF(CLOSE,2),3,0),COLORBLUE;
STICKLINE(VAR1A,REF(CLOSE,1),REF(CLOSE,2),0,0),COLOR090FF2;
PMA:MA(C,5),COLORWHITE,LINETHICK2;
IF(PMA>REF(PMA,1),PMA,DRAWNULL),COLORRED,LINETHICK2;
IF(PMA<REF(PMA,1),PMA,DRAWNULL),COLORGREEN,LINETHICK2;
X:=(3*C+L+O+H)/6;
多空线:(20*X+19*REF(X,1)+18*REF(X,2)+17*REF(X,3)+16*REF(X,4)+15*REF(X,5)+14*REF(X,6)
+13*REF(X,7)+12*REF(X,8)+11*REF(X,9)+10*REF(X,10)+9*REF(X,11)+8*REF(X,12)
+7*REF(X,13)+6*REF(X,14)+5*REF(X,15)+4*REF(X,16)+3*REF(X,17)+2*REF(X,18)+
REF(X,20))/210,COLORFF00FF,LINETHICK2;
{用法:黄托底买进,蓝压顶卖出。}
DD:=多空线<REF(多空线,1);
IF(DD,多空线,DRAWNULL),COLOR00FFFF,LINETHICK2;
A:=(PMA>多空线);
IF(A,多空线,DRAWNULL),COLOR33FF33,POINTDOT,LINETHICK4;
RSV:=(CLOSE-LLV(LOW,9))/(HHV(HIGH,9)-LLV(LOW,9))*100;
FAstK:=SMA(RSV,3,1);
K:Sma(FASTK,3,1);
D:SMA(K,5,1),colorwhite;
80,POINTDOT,linethick2;
20,POINTDOT,linethick2;
VAR1:=HHV(HIGH,9)-LLV(LOW,9);
VAR2:=HHV(HIGH,9)-CLOSE;
VAR3:=CLOSE-LLV(LOW,9);
VAR4:=VAR2/VAR1*100-70;
VAR5:=(CLOSE-LLV(LOW,60))/(HHV(HIGH,60)-LLV(LOW,60))*100;
VAR6:=(2*CLOSE+HIGH+LOW)/4;
VAR7:=SMA(VAR3/VAR1*100,3,1);
VAR8:=LLV(LOW,34);
VAR9:=SMA(VAR7,3,1)-SMA(VAR4,9,1);
VAR10:=IF(VAR9>100,VAR9-100,0);
VAR11:=HHV(HIGH,34);
VAR12:=EMA((VAR6-VAR8)/(VAR11-VAR8)*100,13);
VAR13:=EMA(0.667*REF(VAR12,1)+0.333*VAR12,2);
VAR14:=SMA(MAX(CLOSE-REF(CLOSE,1),0)/CLOSE,8,1)/SMA(Abs(INDEXC-REF
(INDEXC,1))/INDEXC,8,1)*100-25;
VAR15:=MA(Var14,3);
VAR16:=REF(VAR15,1);
STICKLINE(VAR12-VAR13>0,VAR12,VAR13,8,0),colorred;
STICKLINE(VAR12-VAR13<0,VAR12,VAR13,8,0),colorgreen;
生命线:=EMA(VAR13,5);
STICKLINE(crOSS(VAR13,VAR12)ANDVAR12>60,90,100,10,0),COLOR00ff00;
绿灯亮卖:0,color00ff00;
STICKLINE(CROSS(VAR12,VAR13)ANDVAR12>VAR13ANDVAR12<18,10,0,10,0),colorred;
红灯亮买:0,colorred;
Var21:=INDEXC;
Var22:=MA(Var21,6);
Var23:=MA(Var21,24);
Var24:=MA(Var21,32);
Var25:=MA(Var21,62);
Var26:=MA(Var21,105);
Var27:=Var25<REF(Var25,1)ANDVar26<REF(Var26,1)ANDVar25<Var26*0.98;
Var28:=Var24>Var22*1.11ANDVar23>Var22*1.095;
Var29:=Var22>Var21*0.95;
抄底一:=Var27ANDVar28ANDVar29ANDCLOSE/COST(8)<=0.8ANDCLOSE<OPEN;
STICKLINE(抄底一,40,60,1,1),colorff00ff;
Var2A:=CLOSE/MA(CLOSE,40)*100<78;
Var2B:=CLOSE/MA(CLOSE,60)*100<74;
Var2C:=HIGH>LOW*1.051;
Var2D:=Var2CANDCOUNT(Var2C,5)>1;
Var2E:=Var2DAND(Var2AORVar2B);
Var2F:=DMA(EMA(CLOSE,12),SUM(vol,5)/3/CAPITAL);
Var30:=(CLOSE-Var2F)/Var2F*100+30-(REF(HIGH,13)/CLOSE-1.35)*100;
Var31:=(CLOSE-REF(CLOSE,5))/CLOSE*100<-9;
Var32:=WINNER(CLOSE);
Var33:=EMA((INDEXC-MA(INDEXC,10))/INDEXC*100,14)<-4.9;
Var34:=(MA(VOL,5)-VOL)/CAPITAL*100<0.8;
Var35:=(VOL-MA(VOL,21))/VOL*100;
抄底二:=Var33ANDVar31ANDVar32<0.12ANDVar34ANDVar35>18;
STICKLINE(抄底二,40,60,3,1),coloryellow;
Var36:=(REF(CLOSE,1)+REF(CLOSE,2)+REF(CLOSE,3)+REF(CLOSE,4)+REF(CLOSE,5))/5;
Var37:=(REF(CLOSE,2)+REF(CLOSE,3)+REF(CLOSE,4)+REF(CLOSE,5)+REF(CLOSE,6))/5;
Var38:=(REF(CLOSE,3)+REF(CLOSE,4)+REF(CLOSE,5)+REF(CLOSE,6)+REF(CLOSE,7))/5;
Var39:=(REF(CLOSE,4)+REF(CLOSE,5)+REF(CLOSE,6)+REF(CLOSE,7)+REF(CLOSE,8))/5;
Var3A:=(REF(CLOSE,5)+REF(CLOSE,6)+REF(CLOSE,7)+REF(CLOSE,8)+REF(CLOSE,9))/5;
bias3:=(CLOSE-MA(CLOSE,24))/MA(CLOSE,24)*100;
抄底三:=(Var36/CLOSE>1.112ORVar37/CLOSE>1.123ORVar38/CLOSE>1.135ORVar39/CLOSE>1.145ORVar3A/CLOSE>1.156)ANDBIAS3<=-20ANDCOST(25)/CLOSE>=1.5ANDCLOSE<OPEN;
DRAWTEXT(抄底三,40,’注意’),color0099ff;
Var3B:=(CLOSE-MA(CLOSE,40))/MA(CLOSE,40)*100;
抄底四:=FILTER(IF(CROSS(Var3B,-28),1,0),8);
STICKLINE(CROSS(Var3B,-28),40,50,8,1),colorwhite;
Var3C:=DMA(EMA(CLOSE,13),SUM(VOL,5)/2/CAPITAL);
Var3D:=(CLOSE-Var3C)/Var3C*100;
抄底五:=REF(Var3D,1)<-35ANDVar3D>REF(Var3D,1)ANDREF(Var3D,1)<REF(Var3D,2)ANDVar3D-REF(Var3D,1)>2.5;
STICKLINE(抄底五,20,30,8,1),colorffcc66;
Var3E:=100*WINNER(REF(CLOSE,1)*1.1)-100*WINNER(REF(CLOSE,1)*0.9);
抄底六:=CLOSE>OPEN*1.06ANDVar3E<10;
STICKLINE(抄底六,10,20,8,1),colorblue;
[源码注释]通达信公式动态翻译结果
MA5赋值:收盘价的5日简单移动平均
MA10赋值:收盘价的10日简单移动平均
MA20赋值:收盘价的20日简单移动平均
MA30赋值:收盘价的30日简单移动平均
AA赋值:MA5>MA10 AND MA10>MA20 AND MA20>MA30
输出XG:最近5日一直存在AA
评论(0)