通达信一线穿3线主图
LC:=REF(C,1);
M5:MA(C,5);
M10:MA(C,10);
M20:MA(C,20);
M30:MA(C,30),COLORFFCC00;
VAR1:=EMA(EMA(C,9),9);
控盘:=(VAR1-REF(VAR1,1))/REF(VAR1,1)*1000;
EEM8:=EMA(EMA(C,8),8);
资金:=(EEM8-REF(EEM8,1))/REF(EEM8,1)*1000;
有庄:=资金>0;
无庄:=资金<=0;
买线:=EMA(C,3);
卖线:=EMA(SLOPE(C,22)*20+C,54);
BU1:=CROSS(买线,卖线);
SEL1:=CROSS(卖线,买线);
BU2:=IFF(BU1 AND 有庄,1,IFF(COUNT(BU1 AND 无庄,BARSLAST(SEL1)+1)=1 AND CROSS(资金,0),1,0));
BU:=BU2 AND COUNT(BU2,BARSLAST(SEL1)+1)=1;
SEL:=SEL1 AND COUNT(SEL1,BARSLAST(BU)+1)=1;
止损A:=C/REF(O,BARSLAST(BU))<0.93 AND COUNT(BU,BARSLAST(BU)+1)=1 AND COUNT(SEL,BARSLAST(BU)+1)=0;
SELNEW:=IFF(止损A AND COUNT(止损A,BARSLAST(BU)+1)=1,1,IFF(SEL AND COUNT(止损A,BARSLAST(BU)+1)=0,1,0));
重买:=COUNT(止损A,BARSLAST(BU)+1)>=1 AND CROSS(C,0.965*REF(O,BARSLAST(BU)));
不一天:=(重买 AND SELNEW)=0;
BUNEW2:=(BU OR 重买) AND 不一天;
止损B:=(C/REF(O,BARSLAST(重买))<-0.06 AND COUNT(重买,BARSLAST(重买)+1)=1 AND COUNT(SEL,BARSLAST(重买)+1)=0);
重卖:=(SEL AND COUNT(重买,BARSLAST(BUNEW2)+1)=1) OR (止损B AND SUM(止损B,0)=1);
不一天2:=((重卖 AND BUNEW2)=0);{股票指标网}
SELNEW2:=((SELNEW AND COUNT(SELNEW,BARSLAST(BUNEW2)+1)=1) OR 重卖) AND 不一天2;
BUNEW3:=BUNEW2 AND COUNT(BUNEW2,BARSLAST(SELNEW2)+1)=1;
SELNEW3:=SELNEW2 AND COUNT(SELNEW2,BARSLAST(BUNEW3)+1)=1;
D:=BARSLAST(BUNEW3)+1>=1 AND COUNT(SELNEW3,BARSLAST(BUNEW3)+1)=0;
K:=BARSLAST(SELNEW3)+1>=1 AND COUNT(BUNEW3,BARSLAST(SELNEW3)+1)=0;
修正定位:=IFF(COUNT(SELNEW3,BARSCOUNT(C))=0 AND COUNT(BUNEW3,BARSCOUNT(C))=0,1,0);
修正累计:=SUM(修正定位,1000)+1;
精准修正累计:=IFF(修正累计=REF(修正累计,1) AND REF(修正累计,2)<修正累计,修正累计,0);
上市修正B:=修正定位 AND CROSS(控盘,0);
上市修正S:=修正定位 AND CROSS(0,控盘) AND COUNT(上市修正B,BARSLAST(C>0))>=1;
上市D:=COUNT(上市修正B,BARSLAST(上市修正B)+1)=1 AND COUNT(上市修正S,BARSLAST(上市修正B)+1)=0 AND COUNT (SELNEW3,BARSCOUNT(C))=0;
上市K:=COUNT(上市修正S,BARSLAST(上市修正S)+1)=1 AND COUNT(上市修正B,BARSLAST(上市修正S)+1)=0 AND COUNT
(BUNEW3,BARSCOUNT(C))=0;
SSXZBZS:=COUNT(上市修正B,BARSCOUNT(C));
SSXZSZS:=COUNT(上市修正S,BARSCOUNT(C));
QB:=IFF(修正定位,上市修正B,BUNEW3);
QS:=IFF(修正定位,上市修正S AND (SSXZBZS==SSXZSZS AND SSXZBZS>=0 AND COUNT(SELNEW3,BARSCOUNT(C))=1 AND COUNT
(BUNEW3,BARSCOUNT(C))=0)=0, SELNEW3 AND (SSXZBZS=SSXZSZS AND SSXZBZS>=0 AND COUNT(SELNEW3,BARSCOUNT(C))=1 AND COUNT
(BUNEW3,BARSCOUNT(C))=0)=0);
K补:=(COUNT(上市修正B,BARSLAST(C>0))=0 AND COUNT(QB,BARSLAST(C>0))==0)==0;
STICKLINE(D OR 上市D,H,L,0,0),COLOR0000EE;
STICKLINE(D OR 上市D,C,O,2,0),COLOR0000EE;
STICKLINE((K AND K补) OR 上市K,H,L,0,0),COLORFFBB00;
STICKLINE((K AND K补) OR 上市K,C,O,2,0),COLORFFBB00;
DRAWICON(QB,L*0.975,23);
DRAWICON(QS,H*1.02,27);
一线穿3线:IF(C>MAX(M5,MAX(M10,MIN(M20,M30))) AND LC<=(MIN(REF(M5,1),MIN(REF(M10,1),
MAX(REF(M20,1),REF(M30,1))))),L*0.985,DRAWNULL),COLOR00FFFF,LINETHICK6,CROSSDOT;
一线破3线:IF(C<MIN(M5,MIN(M10,MAX(M20,M30))) AND LC>=(MAX(REF(M5,1),MAX(REF(M10,1),
MIN(REF(M20,1),REF(M30,1))))),H*1.01,DRAWNULL),COLOR00FF00,LINETHICK6,CROSSDOT;
STICKLINE(一线穿3线=L*0.985,C,O,2,0),COLORFF00FF;
STICKLINE(一线破3线=H*1.01,C,O,2,0),COLOR00FF00;
来函数检测结果如下:
该公式没有未来函数
解密、编写股票、期货策略请联系QQ或微信同号:88652583
相关股票指标公式
原理解析:
LC赋值:1日前的C
输出
M5:C的5日简单移动平均
输出
M10:C的10日简单移动平均
输出
M20:C的20日简单移动平均
输出
M30:C的30日简单移动平均,COLORFFCC00
VAR1赋值:C的9日指数移动平均,9)
控盘赋值:(VAR1-1日前的VAR1)/1日前的VAR1*1000
EEM8赋值:C的8日指数移动平均,8)
资金赋值:(EEM8-1日前的EEM8)/1日前的EEM8*1000
有庄赋值:资金>0
无庄赋值:资金<=0
买线赋值:C的3日指数移动平均
卖线赋值:EMA(SLOPE(C,22)*20+C,54)
BU1赋值:买线上穿卖线
SEL1赋值:卖线上穿买线
BU2赋值:IFF(BU1 AND 有庄,1,IFF(COUNT(BU1 AND 无庄,上次SEL1距今天数+1)=1 AND 资金上穿0,1,0))
BU赋值:BU2 AND COUNT(BU2,上次SEL1距今天数+1)=1
SEL赋值:SEL1 AND COUNT(SEL1,上次BU距今天数+1)=1
止损A赋值:C/REF(O,上次BU距今天数)<0.93 AND COUNT(BU,上次BU距今天数+1)=1 AND COUNT(SEL,上次BU距今天数+1)=0
SELNEW:=IFF(止损A AND COUNT(止损A,上次BU距今天数+1)=1,1,IFF(SEL AND COUNT(止损A,上次BU距今天数+1)=0,1,0))
重买赋值:COUNT(止损A,上次BU距今天数+1)>=1 AND CROSS(C,0.965*REF(O,上次BU距今天数))
不一天赋值:(重买 AND SELNEW)=0
BUNEW2:=(BU OR 重买) AND 不一天
止损B赋值:(C/REF(O,上次重买距今天数)<-0.06 AND COUNT(重买,上次重买距今天数+1)=1 AND COUNT(SEL,上次重买距今天数+1)=0)
重卖赋值:(SEL AND COUNT(重买,上次BUNEW2距今天数+1)=1) OR (止损B AND 0的止损B日累和=1)
不一天2:=((重卖 AND BUNEW2)=0)
{股票指标网}
SELNEW2:=((SELNEW AND COUNT(SELNEW,上次BUNEW2距今天数+1)=1) OR 重卖) AND 不一天2
BUNEW3:=BUNEW2 AND COUNT(BUNEW2,上次SELNEW2距今天数+1)=1
SELNEW3:=SELNEW2 AND COUNT(SELNEW2,上次BUNEW3距今天数+1)=1
D赋值:上次BUNEW3距今天数+1>=1 AND COUNT(SELNEW3,上次BUNEW3距今天数+1)=0
K赋值:上次SELNEW3距今天数+1>=1 AND COUNT(BUNEW3,上次SELNEW3距今天数+1)=0
修正定位赋值:IFF(COUNT(SELNEW3,C的有效数据周期数)=0 AND COUNT(BUNEW3,C的有效数据周期数)=0,1,0)
修正累计赋值:1000的修正定位日累和+1
精准修正累计赋值:IFF(修正累计=1日前的修正累计 AND 2日前的修正累计<修正累计,修正累计,0)
上市修正B赋值:修正定位 AND 控盘上穿0
上市修正S赋值:修正定位 AND 0上穿控盘 AND COUNT(上市修正B,上次C>0距今天数)>=1
上市D赋值:COUNT(上市修正B,上次上市修正B距今天数+1)=1 AND COUNT(上市修正S,上次上市修正B距今天数+1)=0 AND COUNT (SELNEW3,C的有效数据周期数)=0
上市K赋值:COUNT(上市修正S,上次上市修正S距今天数+1)=1 AND COUNT(上市修正B,上次上市修正S距今天数+1)=0 AND COUNT
(BUNEW3,C的有效数据周期数)=0
SSXZBZS赋值:COUNT(上市修正B,C的有效数据周期数)
SSXZSZS赋值:COUNT(上市修正S,C的有效数据周期数)
QB赋值:IFF(修正定位,上市修正B,BUNEW3)
QS赋值:IFF(修正定位,上市修正S AND (SSXZBZS==SSXZSZS AND SSXZBZS>=0 AND COUNT(SELNEW3,C的有效数据周期数)=1 AND COUNT
(BUNEW3,C的有效数据周期数)=0)=0, SELNEW3 AND (SSXZBZS=SSXZSZS AND SSXZBZS>=0 AND COUNT(SELNEW3,C的有效数据周期数)=1 AND COUNT
(BUNEW3,C的有效数据周期数)=0)=0)
K补:=(COUNT(上市修正B,上次C>0距今天数)=0 AND COUNT(QB,上次C>0距今天数)==0)==0
当满足条件D OR 上市D时,在H和L之间画柱状线
当满足条件D OR 上市D时,在C和O之间画柱状线
STICKLINE((K AND K补) OR 上市K,H,L,0,0),COLORFFBB00
STICKLINE((K AND K补) OR 上市K,C,O,2,0),COLORFFBB00
当满足条件QB时,在L*0.975和23之间画图标
当满足条件QS时,在H*1.02和27之间画图标
输出
一线穿3线:IF(C>MAX(M5,MAX(M10,M20和M30的较小值)) AND LC<=(MIN(1日前的M5,MIN(1日前的M10,
MAX(1日前的M20,1日前的M30)))),L*0.985,DRAWNULL),COLOR00FFFF,LINETHICK6,CROSSDOT
输出
一线破3线:IF(C=(MAX(1日前的M5,MAX(1日前的M10,
MIN(1日前的M20,1日前的M30)))),H*1.01,DRAWNULL),COLOR00FF00,LINETHICK6,CROSSDOT
当满足条件一线穿3线=L*0.985时,在C和O之间画柱状线
当满足条件一线破3线=H*1.01时,在C和O之间画柱状线