您现在的位置:程序化交易>> 股票公式>> 其他>> 其他软件公式>>正文内容

K线显示止损价公式指标源码[其他软件公式]

相关标签:

 

原理解析:

收盘赋值:收盘价
输出止损5:1日前的最高价*0.95,线宽为0,COLOR3399FF
输出止损10:1日前的最高价*0.90,线宽为0,COLOR3399FF
输出止赢:1日前的收盘价*1.10,线宽为0,COLOR3399FF
当满足条件SYSPARAM(1)=BARPOS时,在止赢位置书写文字,画黄色
当满足条件SYSPARAM(1)=BARPOS时,在止损5位置书写文字,画洋红色
当满足条件SYSPARAM(1)=BARPOS时,在止损10位置书写文字,画洋红色
当满足条件SYSPARAM(1)=BARPOS时,在收盘价位置书写文字,COLOR3399FF
A1赋值:3日前的最高价=2*3+1日内最高价的最高值
B1赋值:A1的3日过滤
C1赋值:若B1则将最近3+1周期置为1
D1赋值:C1的3日过滤
A2赋值:3日前的最低价=2*3+1日内最低价的最低值
B2赋值:A2的3日过滤
C2赋值:若B2则将最近3+1周期置为1
D2赋值:C2的3日过滤
E1赋值:(1日前的2*3日内最低价的最低值+1日前的2*3日内最高价的最高值)/2
E2赋值:(最高价+最低价)/2
H1赋值:D1 AND 取反 OR 数据位置状态=2 OR 收盘价的有效数据周期数=1
H2赋值:D1 AND 取反
L1赋值:D2 AND 取反
X1赋值:1日前的上次H1距今天数+1
F1赋值:若H1ANDCOUNT(L1,X1)>0则将最近X1日内如果L1,返回最低价,否则返回10000距今天数周期置为1
G1赋值:F1>1日前的F1
 

源码:

 

{K线显示止损价}
收盘:=C;
止损5:REF(H*0.95,1),LINETHICK,COLOR3399FF;
止损10:REF(H*0.90,1),LINETHICK,COLOR3399FF;
止赢:REF(CLOSE*1.10,1),LINETHICK,COLOR3399FF;
{用最高价计算,上面分别为5% 10%的止损,最后收盘价计算10%为止赢。可以附加在任意一条公式中。}
{随光标动}
DRAWTEXT(SYSPARAM(1)=BARPOS ,止赢,'--涨停'),COLORYELLOW;
DRAWTEXT(SYSPARAM(1)=BARPOS ,止损5,'--止损5%'),COLORMAGENTA;
DRAWTEXT(SYSPARAM(1)=BARPOS ,止损10,'--止损10%'),COLORMAGENTA;
DRAWTEXT(SYSPARAM(1)=BARPOS ,收盘价,'-----收盘价'),COLOR3399FF;
A1:=REF(HIGH,3)=HHV(HIGH,2*3+1);
B1:=FILTER(A1,3);
C1:=BACKSET(B1,3+1);
D1:=FILTER(C1,3);
A2:=REF(LOW,3)=LLV(LOW,2*3+1);
B2:=FILTER(A2,3);
C2:=BACKSET(B2,3+1);
D2:=FILTER(C2,3);
E1:=(REF(LLV(LOW,2*3),1)+REF(HHV(HIGH,2*3),1))/2;
E2:=(HIGH+LOW)/2;
H1:=D1 AND NOT(D2 AND E1>=E2) OR BARSTATUS=2 OR BARSCOUNT(CLOSE)=1;
H2:=D1 AND NOT(D2 AND E1>=E2);
L1:=D2 AND NOT(D1 AND E1=E2);
X1:=REF(BARSLAST(H1),1)+1;
F1:=BACKSET(H1 AND COUNT(L1,X1)>0,LLVBARS(IF(L1,LOW,10000),X1));
G1:=F1>REF(F1,1);
I1:=BACKSET(G1,2);
LD:=I1>REF(I1,1);
L2:=LD OR BARSTATUS=2 OR BARSCOUNT(CLOSE)=1;
X2:=REF(BARSLAST(L2),1)+1;
F2:=BACKSET(L2 AND COUNT(H2,X2)>0,HHVBARS(IF(H2,HIGH,0),X2));
G2:=F2>REF(F2,1);
I2:=BACKSET(G2,2);
HD:=I2>REF(I2,1);
J1:=BACKSET(BARSTATUS=2,MIN(BARSLAST(HD),BARSLAST(LD))+1);
J2:=J1>REF(J1,1);
A3:=HIGH;
B3:=REF(HIGH,REF(BARSLAST(HD),1)+1)>REF(HIGH,REF(BARSLAST(HD),1)+2+REF(BARSLAST(HD),REF(BARSLAST(HD),1)+2));
D3:=A3 AND B3 AND HD;
E3:=BACKSET(D3,REF(BARSLAST(HD),1)+2);
HH:=E3>REF(E3,1);
A4:=LOW>REF(LOW,REF(BARSLAST(LD),1)+1);
B4:=REF(LOW,REF(BARSLAST(LD),1)+1);
D4:=A4 AND B4 AND LD;
E4:=BACKSET(D4,REF(BARSLAST(LD),1)+2);
LL:=E4>REF(E4,1);
DRAWICON(HH,HIGH,5),ALIGN1;
DRAWICON(LL,LOW,4),ALIGN1;
H3:=HH OR BARSTATUS=2 OR BARSCOUNT(CLOSE)=1;
X3:=REF(BARSLAST(H3),1)+1;
F3:=BACKSET(H3 AND COUNT(LL,X3)>0,LLVBARS(IF(LL,LOW,POW(10,20)),X3));
G3:=F3>REF(F3,1);
I3:=BACKSET(G3,2);
LZ:=I3>REF(I3,1);
L4:=LZ OR BARSTATUS=2 OR BARSCOUNT(CLOSE)=1;
X4:=REF(BARSLAST(L4),1)+1;
F4:=BACKSET(L4 AND COUNT(HH,X4)>0,HHVBARS(IF(HH,HIGH,-POW(10,20)),X4));
G4:=F4>REF(F4,1);
I4:=BACKSET(G4,2);
HZ:=I4>REF(I4,1);
K1:=BACKSET(BARSTATUS=2,MIN(BARSLAST(HZ),BARSLAST(LZ))+1);
K2:=K1>REF(K1,1);
UU:=BACKSET(BARSTATUS=2,BARSLAST(LD)+1);
VV:=UU>REF(UU,1);
WW:=BACKSET(VV,REF(BARSLAST(LD),1)+2);
XX:=WW>REF(WW,1);
DRAWLINE(XX,LOW,VV,LOW,1),LINETHICK2,colorFF00FF;
UU2:=BACKSET(BARSTATUS=2,BARSLAST(HD)+1);
VV2:=UU2>REF(UU2,1);
WW2:=BACKSET(VV2,REF(BARSLAST(HD),1)+2);
XX2:=WW2>REF(WW2,1);
DRAWLINE(XX2,HIGH,VV2,HIGH,1),LINETHICK2,colorFF00FF;
前一低:REF(LOW,BARSLAST(VV)),POINTDOT,LINETHICK1,color99FF66;
前二低:REF(LOW,BARSLAST(XX)),POINTDOT,LINETHICK1,colorFF66FF;
前一高:REF(HIGH,BARSLAST(VV2)),POINTDOT,LINETHICK1,color99FF66;
前二高:REF(HIGH,BARSLAST(XX2)),POINTDOT,LINETHICK1,colorFF66FF;
{-------------------板块时间-----------------}
variable:
wday[7]:='星期六';
wday[1]:='星期日';
wday[2]:='星期一';
wday[3]:='星期二';
wday[4]:='星期三';
wday[5]:='星期四';
wday[6]:='星期五';
fy:=YEAR;
fm:=MONTH;
fd:=DAY;
lfy:=LYEAR;
lfm:=LMONTH;
lfd:=LDAY;
wd:=WEEKDAY;
p:=SYSPARAM(1);
str1:='今天是:'+NUMTOSTR(fy[p],0)+'年'+NUMTOSTR(fm[p],0)+'月'+NUMTOSTR(fd[p],0)+'日(农历:'+NUMTOSTR(lfy[p],0)+'年'+NUMTOSTR(lfm[p],0)+'月'+NUMTOSTR(lfd[p],0)+'日) '+wday[wd[p]+1]+'';
DRAWTEXT((SYSPARAM(2)=BARPOS),HIGH,str1),pxup40,ALIGN5,colorred;
DRAWTEXT((SYSPARAM(2)=BARPOS),CLOSE,'版块:'+ BLKNAME+'\n'+' '),ALIGN5,Coloryellow;

KS:=((CLOSE-MA(CLOSE,17))/(MA(CLOSE,17)))*((-100));
RKS:=REF(KS,1);
MLS:=((RKS)/(KS)>=1.23) AND (RKS>=8) AND ((CLOSE)/(REF(CLOSE,1))>=1.02);
反弹:STICKLINE((MLS=1),(LOW)*(0.95),(LOW)*(0.98),6,1),Linethick2,CoLorFF00FF; Var2:=(3*CLOSE+LOW+OPEN+HIGH)/6;
Var3:=(20*Var2+19*REF(Var2,1)+18*REF(Var2,2)+17*REF(Var2,3)+16*REF(Var2,4)+15*REF(Var2,5)+14*REF(Var2,6)+13*REF(Var2,7)+
12*REF(Var2,8)+11*REF(Var2,9)+10*REF(Var2,10)+9*REF(Var2,11)+8*REF(Var2,12)+7*REF(Var2,13)+6*REF(Var2,14)+5*REF(Var2,15)
+4*REF(Var2,16)+3*REF(Var2,17)+2*REF(Var2,18)+REF(Var2,20))/210;
Var4:=MA(Var3,13);
Var5:=EMA(MA(CLOSE,3),34);
Var6:=(MA(CLOSE,3)+MA(CLOSE,6)+MA(CLOSE,12)+MA(CLOSE,24))/4;
Var7:=MA(Var6,5);
Var8:=MA(Var6,10);
{STICKLINE(IF(Var3<Var5,Var3<=1.015*Var4,Var3<=1.005*Var4),Var3,Var4,10,1),COLOR006600 ;
STICKLINE(Var3>1.005*Var4,Var3,Var4,10,1),COLORff00ff{003366};
DRAWTEXT(FILTER(MA(Var6,10)<Var7,1),Var8,'↑'),COLORRED;
DRAWTEXT(FILTER(MA(Var6,10)>=Var6,1),Var8,'↓'),COLOR00ff00;}
『多空安全线』: Var5,circledot,COLORWHITE;
〖关注点〗: STICKLINE(COUNT(Var3>1.005*Var4 AND Var3<=REF(Var3,1),2)=2 OR
COUNT(IF(Var3<Var5,Var3<=1.015*Var4,Var3<=1.005*Var4) AND Var3>=REF(Var3,1),2)=2,Var3,Var4,10,0),COLORYELLOW;
STICKLINE(C>=O,C,O,7,0),COLORRED;
STICKLINE(C>=O,C,O,4,0),COLOR7070ff{B0B0FF};
STICKLINE(C>=O,C,O,2,0),COLORYELLOW;
STICKLINE(C>=O,H,L,0,0),COLORYELLOW;
STICKLINE(C<=O,C,O,7,0),COLORFF2020;
STICKLINE(C<=O,C,O,4,0),COLORFF6600;
STICKLINE(C<=O,C,O,2,0),{COLORCYAN;}colorffcc66;
STICKLINE(C<=O,H,L,0,0),{COLORCYAN}colorffcc66;
DRAWTEXT(REF(CROSS(Var3,Var4),2) AND Var3>1.005*Var4,Var4,'买入点'),COLORwhite;
DRAWTEXT(CROSS(Var6,Var7) AND Var7<Var8,Var3*0.95,'▲多空争夺'),COLORyellow;
DRAWTEXT(CROSS(Var7,Var6) AND Var7>Var8,Var3*1.05,'▼洗盘'),COLORwhite;
Var9:=1/WINNER(CLOSE);
VarA:=MA(CLOSE,13);
VarB:=100-ABS((CLOSE-VarA)/varA*100);
VarC:=LLV(LOW,75);
VarD:=HHV(HIGH,75);
VarE:=(VarD-VarC)/100;
VarF:=SMA((CLOSE-VarC)/varE,20,1);
Var10:=SMA((OPEN-VarC)/varE,20,1);
Var11:=3*VarF-2*SMA(VarF,15,1);
Var12:=3*Var10-2*SMA(Var10,15,1);
Var13:=100-Var12;
Var14:=100-Var11;
Var15:=MA(WINNER(CLOSE*0.95)*100,3);
Var16:=100-IF(Var9>5,IF(Var9<100,Var9,VarB-10),0);
Var17:=Var15>VarB;
Var18:=REF(LOW,1)*0.9;
Var19:=LOW*0.9;
Var1A:=(Var19*VOL+Var18*(CAPITAL-VOL))/CAPITAL;
Var1B:=EMA(Var1A,30);
Var1C:=CLOSE-REF(CLOSE,1);
Var1D:=MAX(Var1C,0);
Var1E:=ABS(Var1C);
Var1F:=SMA(Var1D,7,1)/SMA(Var1E,7,1)*100;
Var20:=SMA(Var1D,13,1)/SMA(Var1E,13,1)*100;
Var21:=BARSCOUNT(CLOSE);
Var22:=SMA(MAX(Var1C,0),6,1)/SMA(ABS(Var1C),6,1)*100;
Var23:=(-200)*(HHV(HIGH,60)-CLOSE)/(HHV(HIGH,60)-LLV(LOW,60))+100;
Var24:=(CLOSE-LLV(LOW,15))/(HHV(HIGH,15)-LLV(LOW,15))*100;
Var25:=SMA((SMA(Var24,4,1)-50)*2,3,1);
Var26:=(INDEXC-LLV(INDEXL,14))/(HHV(INDEXH,14)-LLV(INDEXL,14))*100;
Var27:=SMA(Var26,4,1);
Var28:=SMA(Var27,3,1);
Var29:=(HHV(HIGH,30)-CLOSE)/CLOSE*100;
Var2A:=Var22<=25 AND Var23<-95 AND Var29>20 AND Var25<-30 AND Var28<30 AND Var1B-CLOSE>=-0.25 AND Var1F<22 AND Var20<28
AND Var21>50;
DRAWTEXT(CROSS(Var2A,0.5) AND COUNT(Var2A=1,10)=1,Var4,'♂发射资金(超短线操作)'),COLORRED;
DRAWTEXT(CROSS(Var17,0.5) AND COUNT(Var17=1,10)=1,Var3,'激烈交锋'),COLORWHITE;
Var326:=IF(CLOSE>REF(CLOSE, 1),88,0);
Var327:=IF(CLOSE/REF(CLOSE, 1)>1.050 AND HIGH/CLOSE<1.010 AND Var326>0, 91, 0);
STICKLINE(Var327>90,L*0.99,L*0.95,4,0),COLORYELLOW;
DRAWTEXT(Var327>90,LOW*0.95,'追涨'),COLORYELLOW;

{VAR3:=(CLOSE-LLV(CLOSE,124))/(HHV(CLOSE,124)-LLV(CLOSE,124))*100;
VAR4:=LLV(HIGH,240);
VAR5:=100*(CLOSE-VAR4)/VAR4;
VAR6:=REF(LLV(CLOSE,480),1);
VAR7:=REF(HHV(CLOSE,480),1);
VAR8:=100*(CLOSE-VAR6)/(VAR7-VAR6);
VAR9:=VAR5<=0 AND VAR8<=0 AND VAR3=0;
VARA:=ABS((CLOSE-LLV(LOW,265))/LLV(LOW,265))*100;
VARB:=VARA=0 OR VARA<0.5 OR CROSS(VARA,0.002);
VARC:=MA((BARSLAST(LOW=LLV(LOW,13)))*(IF(CLOSE>OPEN,VOL,1)),3);
VARD:=VARC=0 OR VARC<0.38 OR CROSS(VARC,0.333);
VARE:=MA((BARSLAST(HIGH=HHV(HIGH,13)))*(IF(CLOSE>OPEN,VOL,1)),3);
VARF:=HHVBARS(HIGH,13)*0.622 AND "CCI"<-195;
VAR10:=REF("CCI"(10),1)>-180;
VAR11:=CROSS("KDJ.J"(9,3,3),0);
VAR12:=VAR11<15;
VAR13:="RSI.RSI1"(6,12,24);
VAR14:=VAR13<13;
VAR15:=LLV(HIGH,240);
VAR16:=100*(CLOSE-VAR15)/VAR15;
VAR17:=VAR16<-0.15 OR VAR16<0;
VAR18:=VAR3=0;
VAR19:=REF(CLOSE,1);
VAR1A:=(SMA(MAX(CLOSE-VAR19,0),6,1))/(SMA(ABS(CLOSE-VAR19),6,1))*100;
VAR1B:=IF(VAR1A<19,6,0);
VAR1C:=(CLOSE-LLV(LOW,87))/(HHV(HIGH,87)-LLV(LOW,87))*100;
VAR1D:=VAR1C=0;
VAR1E:=(HHV(HIGH,9)-CLOSE)/(HHV(HIGH,9)-LLV(LOW,9))*100;
VAR1F:=SMA(VAR1E,3,1);
VAR20:=SMA(VAR1F,3,1);
VAR21:=VAR1F>91 AND VAR20>88;
VAR22:=REF(CLOSE,1);
VAR23:=(SMA(MAX(CLOSE-VAR22,0),6,1))/(SMA(ABS(CLOSE-VAR22),6,1))*100;
VAR24:=(SMA(MAX(CLOSE-VAR22,0),14,1))/(SMA(ABS(CLOSE-VAR22),14,1))*100;
VAR25:=(SMA(MAX(CLOSE-VAR22,0),22,1))/(SMA(ABS(CLOSE-VAR22),22,1))*100;
VAR26:=MA(CLOSE,26);
VAR27:=VAR26+2.489*STD(CLOSE,26);
VAR28:=VAR26-2.489*STD(CLOSE,2);
VAR29:=(CLOSE<VAR28+0.05 AND VAR23<10 AND VAR24<16 AND VAR25<24 AND VAR21)*30;
VAR2A:=VARB AND VAR17 AND VAR18 AND VAR1B AND VAR1D*50;
VAR2B:=VAR29 AND VAR2A*80;
VAR31:=(2*CLOSE+HIGH+4*LOW)/7;
VAR32:=EMA(VAR31,3)*0.85;
VAR33:=EMA(100*(CLOSE-LLV(LOW,100))/(HHV(HIGH,100)-LLV(LOW,100)),18)/4;
VAR34:=IF(VAR33>23.16,VAR33,0);
VAR35:=VAR33<10;
VAR36:=VAR33<2;
VAR37:=VAR35 OR VAR6;}
长期趋势:ZIG(3,19),color808080;
短期趋势:ZIG(3,6.5),colorFFFF;
年线:EMA(CLOSE,250),LINETHICK0,colorFFFFFF;
半年线:EMA(CLOSE,120),LINETHICK0,color80;
MA9:EMA(CLOSE,9),LINETHICK0,colorFF0000;
MA11:EMA(CLOSE,11),LINETHICK0,colorFF00;
MA13:EMA(CLOSE,13),colorFFFF00;
MA16:EMA(CLOSE,16),LINETHICK0,colorFFFFFF;
MA72:EMA(CLOSE,72),LINETHICK0,colorFF;
分界线:MA(CLOSE,20),LINETHICK0,color408000;
{VAR38:=CROSS(MA9,MA11);
VAR39:=MA9>MA72;
VARA1:=EMA(100*(CLOSE-LLV(LOW,100))/(HHV(HIGH,100)-LLV(LOW,100)),7);
VARB1:=(VAR9 AND VARB AND VARD AND VARF AND VAR12 AND VAR10 AND VAR14)*100;
VARC1:=VARB>0;
DRAWTEXT(CROSS(ZIG(3,14),REF(ZIG(3,14),1)),LOW*1.001,'●见底'),colorFFFF;
DRAWTEXT(VARC1,CLOSE+0.011,'●地雷'),colorFFFFFF;
DRAWTEXT(CROSS(REF(ZIG(3,13),1),ZIG(3,13)),HIGH*1,''),colorFF;
VAR1:=(OPEN+LOW+HIGH+CLOSE)/4;
STICKLINE(1,VAR1,VAR1,6,0),colorFF00FF;}
{拐点:=MA(CLOSE,3);
拐点1:=MA(CLOSE,3);
GD1:=REF((COUNT(拐点<=REF(拐点,1),5))=5,1) AND 拐点>REF(拐点,1);
GD2:=REF((COUNT(拐点1<=REF(拐点1,1),5))=5,1) AND 拐点1>REF(拐点1,1);
DRAWICON(GD1,0.98*CLOSE,1);
DRAWICON(GD2,0.98*CLOSE,8);
VAR31:=HHVBARS(ZIG(3,19)>REF(ZIG(3,19),1) AND REF(ZIG(3,19),1)<REF(ZIG(3,19),2),0);
转折时间:VAR31+1,POINTDOT,LINETHICK0,colorFF00FF;
时间窗:=0;
STICKLINE(VAR31=2,LOW*0.95,LOW*0.98,8,0),colorFF;
DRAWTEXT(VAR31=2,LOW*0.95,'3天'),colorFFFF;
STICKLINE(VAR31=4,HIGH*1.05,HIGH*1.02,8,0),color9966FF;
DRAWTEXT(VAR31=4,HIGH*1.06,'5天'),colorFFFF;
STICKLINE(VAR31=7,LOW*0.95,LOW*0.98,8,0),colorFFFF;
DRAWTEXT(VAR31=7,LOW*0.95,'8天'),colorFFFF;
STICKLINE(VAR31=12,HIGH*1.05,HIGH*1.02,8,0),colorFF33FF;
DRAWTEXT(VAR31=12,HIGH*1.06,'13天'),colorFFFF;
STICKLINE(VAR31=20,LOW*0.95,LOW*0.98,8,0),color66FF;
DRAWTEXT(VAR31=20,LOW*0.95,'21天'),colorFFFF;
STICKLINE(VAR31=33,HIGH*1.05,HIGH*1.02,8,0),colorFFFF00;
DRAWTEXT(VAR31=33,HIGH*1.06,'34天'),colorFFFF;
STICKLINE(VAR31=54,LOW*0.95,LOW*0.98,8,0),color6600;
DRAWTEXT(VAR31=54,LOW*0.95,'55天'),colorFFFF;
STICKLINE(VAR31=88,HIGH*1.05,HIGH*1.02,8,0),colorFF00;
DRAWTEXT(VAR31=88,HIGH*1.06,'89天'),colorFFFF;
STICKLINE(VAR31=143,LOW*0.95,LOW*0.98,8,0),colorCCFFFF;
DRAWTEXT(VAR31=143,LOW*0.95,'144天'),colorFFFF;
STICKLINE(VAR31=232,HIGH*1.05,HIGH*1.02,8,0),colorFF0033;
DRAWTEXT(VAR31=232,HIGH*1.06,'233天'),colorFFFF;
STICKLINE(VAR31=376,LOW*0.95,LOW*0.98,8,0),colorFF9966;
DRAWTEXT(VAR31=376,LOW*0.95,'377天'),colorFFFF;
X1:=(CLOSE+LOW+HIGH)/3;
X2:=EMA(X1,6);
X3:=EMA(X2,5);
GR1:=BARSLAST(BETWEEN("BIAS.BIAS2"(6,13,24),0,5));
GR2:=EMA(X1,13)>EMA(X1,21) AND EMA(X1,21)>EMA(X1,34) AND EMA(X1,13)>REF(EMA(X1,13),1);
GR3:=COUNT("BIAS.BIAS2"(6,13,24)>10 AND HIGH=HHV(HIGH,GR1),GR1);
GR4:=HIGH=HHV(HIGH,GR1);
GR5:="MACD.MACD"(12,26,9)<REF("MACD.MACD"(12,26,9),1);
GR6:=GR2 AND GR3 AND GR4;
GR7:=GR2 AND GR3 AND GR4 AND GR5;
GR8:=GR6 AND GR7;
LC:=REF(CLOSE,1);
RSI6:=(SMA(MAX(CLOSE-LC,0),6,1))/(SMA(ABS(CLOSE-LC),6,1))*100;
BIAS5:=(CLOSE-MA(CLOSE,13))/MA(CLOSE,13)*100;
换手:=100*VOL/CAPITAL;
BB13:=(ATAN(EMA(X1,13)-REF(EMA(X1,13),1)))*3.1416*10;
EMA8:=EMA(CLOSE,8);
DRAWTEXT(FILTER(BB13>1 AND EMA(X1,13)>REF(EMA(X1,8),1),10),EMA8,'∠45上升'),colorFFFFFF;
A1:=BARSLAST(REF(CROSS("MACD.DIFF"(12,26,9),"MACD.DEA"(12,26,9)),1));
B1:=REF(CLOSE,A1+1)>CLOSE AND REF("MACD.DIFF"(12,26,9),A1+1)<"MACD.DIFF"(12,26,9) AND CROSS("MACD.DIFF"(12,26,9),"MACD.DEA"(12,26,9));
DRAWTEXT(FILTER(B1>0,5),LOW-0.01,'M 底背'),colorFF00;
A2:=BARSLAST(REF(CROSS("KDJ.K"(9,3,3),"KDJ.D"(9,3,3)),1));
B2:=REF(CLOSE,A2+1)>CLOSE AND REF("KDJ.K"(9,3,3),A2+1)<"KDJ.K"(9,3,3) AND CROSS("KDJ.K"(9,3,3),"KDJ.D"(9,3,3));
DRAWTEXT(FILTER(B2>0,5),LOW-0.25,'K 底背'),colorFFFF;
A3:=BARSLAST(REF(CROSS("RSI.RSI1"(6,12,24),"RSI.RSI2"(6,12,24)),1));
B3:=REF(CLOSE,A3+1)>CLOSE 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));
DRAWTEXT(FILTER(B3>0,5),LOW-0.4,'R 底背'),colorFFFF00;
C1:=BARSLAST(REF(CROSS("MACD.DEA"(12,26,9),"MACD.DIFF"(12,26,9)),1));
D1:=REF(CLOSE,C1+1)<CLOSE AND REF("MACD.DIFF"(12,26,9),C1+1)>"MACD.DIFF"(12,26,9) AND CROSS("MACD.DEA"(12,26,9),"MACD.DIFF"(12,26,9));
DRAWTEXT(FILTER(D1>0,5),HIGH+0.01,'M 顶背'),colorFF;
C2:=BARSLAST(REF(CROSS("KDJ.D"(9,3,3),"KDJ.K"(9,3,3)),1));
D2:=REF(CLOSE,C2+1)<CLOSE AND REF("KDJ.K"(9,3,3),C2+1)>"KDJ.K"(9,3,3) AND CROSS("KDJ.D"(9,3,3),"KDJ.K"(9,3,3));
DRAWTEXT(FILTER(D2>0,5),HIGH+0.25,'K 顶背'),color66FF;
C3:=BARSLAST(REF(CROSS("RSI.RSI2"(6,12,24),"RSI.RSI1"(6,12,24)),1));
D3:=REF(CLOSE,C3+1)<CLOSE 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));
DRAWTEXT(FILTER(D3>0,5),HIGH+0.4,'R 顶背'),colorFF00FF;
E1:=BARSCOUNT(CLOSE);
AH:=HHV(HIGH,200);
AL:=LLV(LOW,200);
B0:=(AH-AL)/40;
KB1:=HIGH+B0;
KB2:=LOW-B0;
STICKLINE((E1+0)/34=FLOOR((E1+0)/34),KB2,KB2-3*B0,2,0),LINETHICK3,colorFFFFFF;
DRAWTEXT((E1+0)/34=FLOOR((E1+0)/34),KB2-2*B0,'时间窗'),colorFFFFFF;
A:=BARSCOUNT(CLOSE);
AH:=HHV(HIGH,200);
AL:=LLV(LOW,200);
B0:=(AH-AL)/40;
QS:=ZIG(3,19);
SS:=HHVBARS(REF(QS,1)<REF(QS,2),0);
EXPLAIN(SS=1 OR CROSS(ZIG(3,19),REF(ZIG(3,19),1)),'操作时段分析:操作盲区'),colorFFFF;
EXPLAIN(SS>=2 AND SS<20 AND REF(QS,1)<QS,'操作时段分析:短线投机'),colorFF;
EXPLAIN(SS>=20 AND SS<88 AND REF(QS,1)<QS,'操作时段分析:中线波段'),colorFF33FF;
EXPLAIN(SS>=88 AND REF(QS,1)<QS,'操作时段分析:长线投资'),color66FF;
XD:=HHVBARS(QS>REF(QS,1),0);
EXPLAIN(XD=2 OR XD=1,'操作时段分析:操作盲区'),colorFFFF;
EXPLAIN(XD>=3 AND XD<21 AND REF(QS,1)>QS,'操作时段分析:短期回调'),colorFFFF;
EXPLAIN(XD>=21 AND XD<89 AND REF(QS,1)>QS,'操作时段分析:中期杀跌'),colorFFFF00;
EXPLAIN(XD>=89 AND REF(QS,1)>QS,'操作时段分析:长期盘跌'),colorFF00;
TC:=IF(CROSS(REF(ZIG(3,19),1),ZIG(3,19)),1,0);
EXPLAIN(CROSS(ZIG(3,19),REF(ZIG(3,19),1)),'价格拐点分析:相对底部'),colorFFFF;
EXPLAINEX(SS>0 AND TC<>1 AND SS<>2 AND SS<>4 AND SS<>7 AND SS<>12 AND SS<>20 AND SS<>33 AND SS<>54 AND SS<>88 AND SS<>143 AND SS<>232,'时间拐点分析:上涨天数 ',SS+1,0,0),colorCCFFFF;
EXPLAINEX(SS=2,'时间拐点分析:时间之窗 ',SS+1,0,0),colorFF;
EXPLAINEX(SS=4,'时间拐点分析:时间之窗 ',SS+1,0,0),colorFF00;
EXPLAINEX(SS=7,'时间拐点分析:时间之窗 ',SS+1,0,0),colorFF;
EXPLAINEX(SS=12,'时间拐点分析:时间之窗 ',SS+1,0,0),colorFF00;
EXPLAINEX(SS=20,'时间拐点分析:时间之窗 ',SS+1,0,0),colorFF;
EXPLAINEX(SS=33,'时间拐点分析:时间之窗 ',SS+1,0,0),colorFF00;
EXPLAINEX(SS=54,'时间拐点分析:时间之窗 ',SS+1,0,0),colorFF;
EXPLAINEX(SS=88,'时间拐点分析:时间之窗 ',SS+1,0,0),colorFF00;
EXPLAINEX(SS=143,'时间拐点分析:时间之窗 ',SS+1,0,0),colorFF;
EXPLAINEX(SS=232,'时间拐点分析:时间之窗 ',SS+1,0,0),colorFF00;
EXPLAIN(CROSS(REF(ZIG(3,19),1),ZIG(3,19)),'价格拐点分析:相对顶部'),colorFFFF;
EXPLAINEX(XD>0 AND TC<>1 AND XD<>3 AND XD<>5 AND XD<>8 AND XD<>13 AND XD<>21 AND XD<>34 AND XD<>55 AND XD<>89 AND XD<>144 AND XD<>233,'时间拐点分析:下跌天数 ',XD,0,0),colorCCFFFF;
EXPLAINEX(XD=3,'时间拐点分析:时间之窗 ',XD,0,0),colorFF;
EXPLAINEX(XD=5,'时间拐点分析:时间之窗 ',XD,0,0),colorFF00;
EXPLAINEX(XD=8,'时间拐点分析:时间之窗 ',XD,0,0),colorFF;
EXPLAINEX(XD=13,'时间拐点分析:时间之窗 ',XD,0,0),colorFF00;
EXPLAINEX(XD=21,'时间拐点分析:时间之窗 ',XD,0,0),colorFF;
EXPLAINEX(XD=34,'时间拐点分析:时间之窗 ',XD,0,0),colorFF00;
EXPLAINEX(XD=55,'时间拐点分析:时间之窗 ',XD,0,0),colorFF;
EXPLAINEX(XD=89,'时间拐点分析:时间之窗 ',XD,0,0),colorFF00;
EXPLAINEX(XD=144,'时间拐点分析:时间之窗 ',XD,0,0),colorFF;
EXPLAINEX(XD=233,'时间拐点分析:时间之窗 ',XD,0,0),colorFF00;}
ZSLIFE:=(EMA(INDEXC,60)+EMA(INDEXC,90))/2;
ZSBL:=INDEXC/ZSLIFE;
GGLIFE:=(EMA(CLOSE,60)+EMA(CLOSE,90))/2;
ZSTB:=ZSBL*GGLIFE;
EXPLAINEX(ZSTB<CLOSE,'强于大盘系数%:',(CLOSE-ZSTB)/ZSTB*100,2,0),colorFF;
EXPLAINEX(ZSTB>=CLOSE,'弱于大盘系数%:',(ABS(CLOSE-ZSTB))/ZSTB*100,2,0),colorFFFF00;
EXPLAINEX(CLOSE>0,'主力成本:',SUM(AMOUNT,13)/SUM(VOL,13)/100,2,0),colorFFFF00;
EXPLAIN(VOL=HHV(VOL,0),'量能统计:历史天量'),colorFF00FF;
ZY:=(REF(HIGH,1)-REF(LOW,1))*8/10+CLOSE;
EXPLAINEX(CLOSE>0,'明日止赢:',ZY,2,0),colorFF;
ZS:=CLOSE-(REF(HIGH,1)-REF(LOW,1))*8/20;
EXPLAINEX(CLOSE>0,'明日止损:',ZS,2,0),colorFF00;
现价:CLOSE,POINTDOT,LINETHICK2,colorFFFFFF;
现量:VOL,LINETHICK0,colorFF00;
VAR1:=BACKSET(REF(HIGH,2)=HHV(HIGH,5),3);
VAR2:=CROSS(VAR1,0.9);
VAR3:=BACKSET(REF(LOW,2)=LLV(LOW,5),3);
VAR4:=CROSS(VAR3,0.9);
STICKLINE(VAR2,HIGH,HIGH*1.01,5,0),colorE40E;
STICKLINE(VAR4,LOW,LOW*0.99,5,0),colorE40E;
VAR5:=IF(VAR2,HIGH,IF(VAR4,LOW,0));
POLYLINE(VAR5,VAR5),LINETHICK0,colorFFFFFF;
VAR6:=BACKSET(REF(HIGH,2)=HHV(HIGH,5) AND LOW<REF(LOW,1) AND HIGH<REF(HIGH,1),3);
VAR7:=BACKSET(REF(HIGH,2)=HHV(HIGH,5) AND LOW>REF(LOW,1) AND HIGH>REF(HIGH,1),3);
VAR8:=BACKSET(REF(HIGH,2)=HHV(HIGH,5) AND HIGH<REF(HIGH,1) AND LOW>REF(LOW,1) AND REF(LOW,1)>REF(LOW,2) AND REF(HIGH,1)<REF(HIGH,2),3);
VAR9:=BACKSET(REF(LOW,2)=LLV(LOW,5) AND LOW>REF(LOW,1) AND HIGH>REF(HIGH,1),3);
VARA:=BACKSET(REF(LOW,2)=LLV(LOW,5) AND LOW<REF(LOW,1) AND HIGH<REF(HIGH,1),3);
VARB:=BACKSET(REF(LOW,2)=LLV(LOW,5) AND HIGH<REF(HIGH,1) AND LOW>REF(LOW,1) AND REF(LOW,1)>REF(LOW,2) AND REF(HIGH,1)<REF(HIGH,2),3);
坚定:STICKLINE(CROSS(VAR6,0.9),HIGH,HIGH*1.01,5,0),LINETHICK0,colorFF;
STICKLINE(CROSS(VAR9,0.9),LOW,LOW*0.99,5,0),LINETHICK0,colorFF;
犹豫:STICKLINE(CROSS(VAR7,0.9),HIGH,HIGH*1.01,5,0),colorE5E9;
STICKLINE(CROSS(VARA,0.9),LOW,LOW*0.99,5,0),LINETHICK0,colorE5E9;
等待:STICKLINE(CROSS(VAR8,0.9),HIGH,HIGH*1.01,5,0),colorFF4100;
STICKLINE(CROSS(VARB,0.9),LOW,LOW*0.99,5,0),LINETHICK0,colorFF4100;
压力:REF(HIGH,BARSLAST(VAR2)),POINTDOT,colorEA91B5;
STICKLINE(CLOSE,REF(HIGH,BARSLAST(VAR2)),REF(HIGH,BARSLAST(VAR2)),5,0),LINETHICK0,colorFF00;
支撑:REF(LOW,BARSLAST(VAR4)),POINTDOT,color3791B5;
STICKLINE(CLOSE,REF(LOW,BARSLAST(VAR4)),REF(LOW,BARSLAST(VAR4)),5,0),LINETHICK0,colorFFFF;
DRAWTEXT(VAR2,HIGH+0.0818,'压力');
DRAWTEXT(VAR4,LOW-0.0818,'支撑');

 

公式导入教程: 【通达信公式源码导入方法教程】 【同花顺公式源码导入方法教程】 【大智慧新一代公式源码导入方法教程

 

 

有思路,想编写各种指标公式,交易模型,选股公式,还原公式的朋友

可联系技术人员 QQ: 262069696  点击在线交流或微信:cxhjy888 进行 有偿收费 编写!(注:由于人数限制,QQ或微信请选择方便的一个联系我们就行,加好友时请简单备注下您的需求,否则无法通过。谢谢您!)

怎么收费,代编流程等详情请点击查阅!

(注:由于人数限制,QQ或微信请选择方便的一个联系我们就行,加好友时请简单备注下您的需求,否则无法通过。谢谢您!)

 


【字体: 】【打印文章】【查看评论

相关文章

    没有相关内容