通达信【强势突围】突破重围见曙光主副图+选股指标用法详解
VAR1:=IF(BARSLAST(BACKSET(REF(H,5)=HHV(H,11),6)>BACKSET(REF(H,5)=HHV(H,11),5))=BARSLAST(BACKSET(REF(L,5)=LLV(L,11),6)>BACKSET(REF(L,5)=LLV(L,11),5)) AND MA(C,5)>MA(C,10),BACKSET(REF(H,5)=HHV(H,11),6)>BACKSET(REF(H,5)=HHV(H,11),5),IF(BARSLAST(BACKSET(REF(L,5)=LLV(L,11),6)>BACKSET(REF(L,5)=LLV(L,11),5))>BARSLAST(BACKSET(REF(H,5)=HHV(H,11),6)>BACKSET(REF(H,5)=HHV(H,11),5)),BACKSET(REF(H,5)=HHV(H,11),6)>BACKSET(REF(H,5)=HHV(H,11),5),0));
VAR2:=IF(BARSLAST(BACKSET(REF(H,5)=HHV(H,11),6)>BACKSET(REF(H,5)=HHV(H,11),5))=BARSLAST(BACKSET(REF(L,5)=LLV(L,11),6)>BACKSET(REF(L,5)=LLV(L,11),5)) AND MA(C,10)>MA(C,5),BACKSET(REF(L,5)=LLV(L,11),6)>BACKSET(REF(L,5)=LLV(L,11),5),IF(BARSLAST(BACKSET(REF(H,5)=HHV(H,11),6)>BACKSET(REF(H,5)=HHV(H,11),5))>BARSLAST(BACKSET(REF(L,5)=LLV(L,11),6)>BACKSET(REF(L,5)=LLV(L,11),5)),BACKSET(REF(L,5)=LLV(L,11),6)>BACKSET(REF(L,5)=LLV(L,11),5),0));
VAR3:=IF(REF(H,BARSLAST(VAR1 AND H=HHV(H,BARSLAST(VAR2)))+1)<REF(L,BARSLAST(VAR1 AND H=HHV(H,BARSLAST(VAR2)))),REF(L,BARSLAST(VAR1 AND H=HHV(H,BARSLAST(VAR2)))),IF(REF(L,BARSLAST(VAR1 AND H=HHV(H,BARSLAST(VAR2))))<=REF(L,BARSLAST(VAR1 AND H=HHV(H,BARSLAST(VAR2)))+1),REF(L,BARSLAST(VAR1 AND H=HHV(H,BARSLAST(VAR2)))+2),REF(L,BARSLAST(VAR1 AND H=HHV(H,BARSLAST(VAR2)))+1)));
VAR4:=IF(REF(L,BARSLAST(VAR2 AND L=LLV(L,BARSLAST(VAR1)))+1)>REF(H,BARSLAST(VAR2 AND L=LLV(L,BARSLAST(VAR1)))),REF(H,BARSLAST(VAR2 AND L=LLV(L,BARSLAST(VAR1)))),IF(REF(H,BARSLAST(VAR2 AND L=LLV(L,BARSLAST(VAR1))))>=REF(H,BARSLAST(VAR2 AND L=LLV(L,BARSLAST(VAR1)))+1),REF(H,BARSLAST(VAR2 AND L=LLV(L,BARSLAST(VAR1)))+2),REF(H,BARSLAST(VAR2 AND L=LLV(L,BARSLAST(VAR1)))+1)));
VAR5:=REF(H,BARSLAST(VAR1 AND H=HHV(H,BARSLAST(VAR2))))>VAR4 AND VAR1 AND H=HHV(H,BARSLAST(VAR2));
VAR6:=REF(L,BARSLAST(VAR2 AND L=LLV(L,BARSLAST(VAR1))))<VAR3 AND VAR2 AND L=LLV(L,BARSLAST(VAR1));
VAR7:=VAR5 AND REF(H,BARSLAST(VAR1 AND H=HHV(H,BARSLAST(VAR2))))>REF(H,BARSLAST(VAR2 AND L=LLV(L,BARSLAST(VAR1)))) AND REF(L,BARSLAST(VAR1 AND H=HHV(H,BARSLAST(VAR2))))>REF(L,BARSLAST(VAR2 AND L=LLV(L,BARSLAST(VAR1)))) AND REF(L,BARSLAST(VAR1 AND H=HHV(H,BARSLAST(VAR2)))+1)>REF(L,BARSLAST(VAR2 AND L=LLV(L,BARSLAST(VAR1))));
VAR8:=VAR6 AND REF(L,BARSLAST(VAR2 AND L=LLV(L,BARSLAST(VAR1))))<REF(L,BARSLAST(VAR1 AND H=HHV(H,BARSLAST(VAR2)))) AND REF(H,BARSLAST(VAR2 AND L=LLV(L,BARSLAST(VAR1))))<REF(H,BARSLAST(VAR1 AND H=HHV(H,BARSLAST(VAR2)))) AND REF(H,BARSLAST(VAR2 AND L=LLV(L,BARSLAST(VAR1)))+1)<REF(H,BARSLAST(VAR1 AND H=HHV(H,BARSLAST(VAR2))));
VAR9:=COUNT((H<=REF(H,1) AND L>=REF(L,1)) OR (H>=REF(H,1) AND L<=REF(L,1)),BARSLAST(VAR2 AND L=LLV(L,BARSLAST(VAR1))));
VAR10:=COUNT((H<=REF(H,1) AND L>=REF(L,1)) OR (H>=REF(H,1) AND L<=REF(L,1)),BARSLAST(VAR1 AND H=HHV(H,BARSLAST(VAR2))));
VAR11:=IF(COUNT(L>REF(H,1) AND DAY!=REF(DAY,1),BARSLAST(VAR2 AND L=LLV(L,BARSLAST(VAR1)))),IF(VAR9>0,VAR9+2,IF(VAR10,VAR10+2,3))-COUNT(L>REF(H,1) AND DAY!=REF(DAY,1),BARSLAST(VAR2 AND L=LLV(L,BARSLAST(VAR1)))),IF(COUNT(H<REF(L,1) AND DAY!=REF(DAY,1),BARSLAST(VAR1 AND H=HHV(H,BARSLAST(VAR2)))),IF(VAR9>0,VAR9+2,IF(VAR10,VAR10+2,3))-COUNT(H<REF(L,1) AND DAY!=REF(DAY,1),BARSLAST(VAR1 AND H=HHV(H,BARSLAST(VAR2)))),IF(VAR9>0,VAR9+2,IF(VAR10,VAR10+2,3))));
VAR12:=(VAR1 AND H=HHV(H,BARSLAST(VAR2)) AND REF(H,BARSLAST(VAR1 AND H=HHV(H,BARSLAST(VAR2))))>=REF(H,BARSLAST((VAR7 AND BARSLAST(VAR8)>VAR11))) AND BARSLAST((VAR8 AND BARSLAST(VAR7)>VAR11))>BARSLAST((VAR7 AND BARSLAST(VAR8)>VAR11))) OR (VAR5 AND COUNT(L>REF(H,1) AND DAY!=REF(DAY,1),BARSLAST(VAR6))>0 AND REF(H,BARSLAST(VAR5))>REF(H,BARSLAST((VAR7 AND BARSLAST(VAR8)>VAR11))));
VAR13:=(VAR2 AND L=LLV(L,BARSLAST(VAR1)) AND REF(L,BARSLAST(VAR2 AND L=LLV(L,BARSLAST(VAR1))))<=REF(L,BARSLAST((VAR8 AND BARSLAST(VAR7)>VAR11))) AND BARSLAST((VAR7 AND BARSLAST(VAR8)>VAR11))>BARSLAST((VAR8 AND BARSLAST(VAR7)>VAR11))) OR (VAR6 AND COUNT(H<REF(L,1) AND DAY!=REF(DAY,1),BARSLAST(VAR5))>0 AND REF(L,BARSLAST(VAR6))<REF(H,BARSLAST((VAR8 AND BARSLAST(VAR7)>VAR11))));
VAR14:=VAR12 AND H=HHV(IF(BARSLAST(VAR13)>BARSLAST(VAR12),REF(H,BARSLAST(VAR12)),REF(H,BARSLAST(VAR13))),BARSLAST(VAR13)+1) AND H>REF(H,1) AND BARSLAST(VAR13)>BARSLAST(VAR12);
VAR15:=VAR13 AND L=LLV(IF(BARSLAST(VAR12)>BARSLAST(VAR13),REF(L,BARSLAST(VAR13)),REF(L,BARSLAST(VAR12))),BARSLAST(VAR12)+1) AND L<REF(L,1) AND BARSLAST(VAR12)>BARSLAST(VAR13);
VAR68:=VAR14 OR (VAR1 AND H=HHV(H,BARSLAST(VAR2)) AND REF(H,BARSLAST(VAR1 AND H=HHV(H,BARSLAST(VAR2))))>REF(H,BARSLAST(VAR14)) AND BARSLAST(VAR15)>BARSLAST(VAR14));
VAR88:=VAR15 OR (VAR2 AND L=LLV(L,BARSLAST(VAR1)) AND REF(L,BARSLAST(VAR2 AND L=LLV(L,BARSLAST(VAR1))))<REF(L,BARSLAST(VAR15)) AND BARSLAST(VAR14)>BARSLAST(VAR15));
STICKLINE(VOL/REF(VOL,1)>2,OPEN,CLOSE,1,0),COLOR00FFFF;
DRAWTEXT_FIX(C>O,0,0.07,0,' 公式源码 '),COLOR333333;
趋势向上:DRAWLINE(VAR88,L,VAR68,H,0),COLORYELLOW,DOTLINE;
趋势向下:DRAWLINE(VAR68,H,VAR88,L,0),COLORWHITE,DOTLINE;
找顶线:DRAWLINE(VAR68,H,REF(VAR68,1),REF(H,1),1),COLORGREEN;
找底线:DRAWLINE(VAR88,L,REF(VAR88,1),REF(L,1),1),COLORRED;
DRAWNUMBER(VAR88,LOW*0.995,LOW);
DRAWNUMBER(VAR68,HIGH*1.01,HIGH);
XG:CROSS(C,找顶线) AND 找顶线>0 AND (SUM(IF(HIGH>LOW,(CLOSE-LOW/HIGH-LOW+CLOSE-HIGH/HIGH-LOW)*VOL,0),10)/10000) AND UPNDAY((12-26)*2,1),NODRAW;
DRAWICON(XG,LOW,1);
未来函数检测结果如下:
该公式包含未来函数:BACKSET
解密、编写股票、期货策略请联系QQ或微信同号:88652583
相关股票指标公式
原理解析:
VAR1赋值:IF(上次BACKSET(5日前的H=11日内H最高值,6距今天数>BACKSET(5日前的H=11日内H最高值,5))=BARSLAST(BACKSET(5日前的L=11日内L最低值,6)>BACKSET(5日前的L=11日内L最低值,5)) AND C的5日简单移动平均>C的10日简单移动平均,BACKSET(5日前的H=11日内H最高值,6)>BACKSET(5日前的H=11日内H最高值,5),IF(BARSLAST(BACKSET(5日前的L=11日内L最低值,6)>BACKSET(5日前的L=11日内L最低值,5))>上次BACKSET(5日前的H=11日内H最高值,6距今天数>BACKSET(5日前的H=11日内H最高值,5)),BACKSET(5日前的H=11日内H最高值,6)>BACKSET(5日前的H=11日内H最高值,5),0))
VAR2赋值:IF(上次BACKSET(5日前的H=11日内H最高值,6距今天数>BACKSET(5日前的H=11日内H最高值,5))=BARSLAST(BACKSET(5日前的L=11日内L最低值,6)>BACKSET(5日前的L=11日内L最低值,5)) AND C的10日简单移动平均>C的5日简单移动平均,BACKSET(5日前的L=11日内L最低值,6)>BACKSET(5日前的L=11日内L最低值,5),IF(上次BACKSET(5日前的H=11日内H最高值,6距今天数>BACKSET(5日前的H=11日内H最高值,5))>BARSLAST(BACKSET(5日前的L=11日内L最低值,6)>BACKSET(5日前的L=11日内L最低值,5)),BACKSET(5日前的L=11日内L最低值,6)>BACKSET(5日前的L=11日内L最低值,5),0))
VAR3赋值:IF(REF(H,上次VAR1 AND H=HHV(H,BARSLAST(VAR2距今天数))+1)[VAR4赋值:IF(REF(L,上次VAR2 AND L=LLV(L,BARSLAST(VAR1距今天数))+1)>REF(H,上次VAR2 AND L=LLV(L,BARSLAST(VAR1距今天数))),REF(H,上次VAR2 AND L=LLV(L,BARSLAST(VAR1距今天数))),IF(REF(H,上次VAR2 AND L=LLV(L,BARSLAST(VAR1距今天数)))>=REF(H,上次VAR2 AND L=LLV(L,BARSLAST(VAR1距今天数))+1),REF(H,上次VAR2 AND L=LLV(L,BARSLAST(VAR1距今天数))+2),REF(H,上次VAR2 AND L=LLV(L,BARSLAST(VAR1距今天数))+1)))]
VAR5赋值:REF(H,上次VAR1 AND H=HHV(H,BARSLAST(VAR2距今天数)))>VAR4 AND VAR1 AND H=HHV(H,BARSLAST(VAR2))
VAR6赋值:REF(L,上次VAR2 AND L=LLV(L,BARSLAST(VAR1距今天数)))VAR7赋值:VAR5 AND REF(H,上次VAR1 AND H=HHV(H,BARSLAST(VAR2距今天数)))>REF(H,BARSLAST(VAR2 AND L=LLV(L,BARSLAST(VAR1)))) AND REF(L,上次VAR1 AND H=HHV(H,BARSLAST(VAR2距今天数)))>REF(L,BARSLAST(VAR2 AND L=LLV(L,BARSLAST(VAR1)))) AND REF(L,上次VAR1 AND H=HHV(H,BARSLAST(VAR2距今天数))+1)>REF(L,BARSLAST(VAR2 AND L=LLV(L,BARSLAST(VAR1))))
VAR8赋值:VAR6 AND REF(L,上次VAR2 AND L=LLV(L,BARSLAST(VAR1距今天数)))[VAR9赋值:COUNT((H<=1日前的H AND L>=1日前的L) OR (H>=1日前的H AND L<=1日前的L),上次VAR2 AND L=LLV(L,BARSLAST(VAR1距今天数)))]
VAR10:=COUNT((H<=1日前的H AND L>=1日前的L) OR (H>=1日前的H AND L<=1日前的L),上次VAR1 AND H=HHV(H,BARSLAST(VAR2距今天数)))
VAR11:=IF(COUNT(L>1日前的H AND DAY!=1日前的DAY,上次VAR2 AND L=LLV(L,BARSLAST(VAR1距今天数))),IF(VAR9>0,VAR9+2,IF(VAR10,VAR10+2,3))-COUNT(L>1日前的H AND DAY!=1日前的DAY,上次VAR2 AND L=LLV(L,BARSLAST(VAR1距今天数))),IF(COUNT(H<1日前的L AND DAY!=1日前的DAY,BARSLAST(VAR1 AND H=HHV(H,BARSLAST(VAR2)))),IF(VAR9>0,VAR9+2,IF(VAR10,VAR10+2,3))-COUNT(H<1日前的L AND DAY!=1日前的DAY,BARSLAST(VAR1 AND H=HHV(H,BARSLAST(VAR2)))),IF(VAR9>0,VAR9+2,IF(VAR10,VAR10+2,3))))
VAR12:=(VAR1 AND H=HHV(H,上次VAR2距今天数) AND REF(H,BARSLAST(VAR1 AND H=HHV(H,上次VAR2距今天数)))>=REF(H,BARSLAST((VAR7 AND BARSLAST(VAR8)>VAR11))) AND BARSLAST((VAR8 AND BARSLAST(VAR7)>VAR11))>BARSLAST((VAR7 AND BARSLAST(VAR8)>VAR11))) OR (VAR5 AND COUNT(L>REF(H,1) AND DAY!=REF(DAY,1),BARSLAST(VAR6))>0 AND REF(H,BARSLAST(VAR5))>REF(H,BARSLAST((VAR7 AND BARSLAST(VAR8)>VAR11))))
VAR13:=(VAR2 AND L=LLV(L,上次VAR1距今天数) AND REF(L,BARSLAST(VAR2 AND L=LLV(L,上次VAR1距今天数)))<=REF(L,BARSLAST((VAR8 AND BARSLAST(VAR7)>VAR11))) AND BARSLAST((VAR7 AND BARSLAST(VAR8)>VAR11))>BARSLAST((VAR8 AND BARSLAST(VAR7)>VAR11))) OR (VAR6 AND COUNT(H[0 AND REF(L,BARSLAST(VAR6))][VAR11))))]
VAR14:=VAR12 AND H=HHV(IF(上次VAR13距今天数>BARSLAST(VAR12),REF(H,BARSLAST(VAR12)),REF(H,上次VAR13距今天数)),上次VAR13距今天数+1) AND H>REF(H,1) AND 上次VAR13距今天数>BARSLAST(VAR12)
VAR15:=VAR13 AND L=LLV(IF(上次VAR12距今天数>BARSLAST(VAR13),REF(L,BARSLAST(VAR13)),REF(L,上次VAR12距今天数)),上次VAR12距今天数+1) AND L[BARSLAST(VAR13)]
VAR68:=VAR14 OR (VAR1 AND H=HHV(H,上次VAR2距今天数) AND REF(H,BARSLAST(VAR1 AND H=HHV(H,上次VAR2距今天数)))>REF(H,BARSLAST(VAR14)) AND BARSLAST(VAR15)>BARSLAST(VAR14))
VAR88:=VAR15 OR (VAR2 AND L=LLV(L,上次VAR1距今天数) AND REF(L,BARSLAST(VAR2 AND L=LLV(L,上次VAR1距今天数)))[BARSLAST(VAR15))]
STICKLINE(成交量/1日前的成交量>2,开盘价,收盘价,1,0),COLOR00FFFF
当满足条件C>O时,在横轴0纵轴0.07位置书写文字
输出趋势向上:DRAWLINE(VAR88,L,VAR68,H,0),画黄色,DOTLINE
输出趋势向下:DRAWLINE(VAR68,H,VAR88,L,0),画白色,DOTLINE
输出找顶线:DRAWLINE(VAR68,H,1日前的VAR68,1日前的H,1),画绿色
输出找底线:DRAWLINE(VAR88,L,1日前的VAR88,1日前的L,1),画红色
DRAWNUMBER(VAR88,最低价*0.995,最低价)
DRAWNUMBER(VAR68,最高价*1.01,最高价)
输出XG:C上穿找顶线 AND 找顶线>0 AND (SUM(IF(最高价>最低价,(收盘价-最低价/最高价-最低价+收盘价-最高价/最高价-最低价)*成交量,0),10)/10000) AND UPNDAY((12-26)*2,1),NODRAW
当满足条件XG时,在最低价和1之间画图标