通达信五星操盘线主图指标源码
日线锁定:=(PERIOD==5) AND (C>0) AND V>0;
引力:=(MA(C,30)+MA(C,72))/2;
下轨:=引力*0.73;
下轨75:=引力*0.75;
下轨71:=引力*0.71;
下轨68:=引力*0.68;
过滤周期:=1;
VAR1:=EMA(EMA(CLOSE,9),9);
控盘:=(VAR1-REF(VAR1,1))/REF(VAR1,1)*1000;
资金:=EMA(EMA(CLOSE,8),8);
资金抬轿:=(资金-REF(资金,1))/REF(资金,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;
BUNEW:=BU;
止损条件:=CLOSE/REF(OPEN,BARSLAST(BU))<(1-7/100) AND COUNT(BU,BARSLAST(BU)+1)==1 AND COUNT(SEL,BARSLAST(BU)+1)==0;
SELNEW:=IFF(止损条件 AND COUNT(止损条件,BARSLAST(BU)+1)==1,1,IFF(SEL AND COUNT(止损条件,BARSLAST(BU)+1)==0,1,0));
重新买入:=COUNT(止损条件,BARSLAST(BUNEW)+1)>=1 AND CROSS(C,0.965*REF(O,BARSLAST(BUNEW)));
不在同一天1:=((重新买入 AND SELNEW)==0); BUNEW2:=((BUNEW AND COUNT(SELNEW,过滤周期)==0) OR 重新买入) AND 不在同一天1;
二次止损:=(CLOSE/REF(OPEN,BARSLAST(重新买入))<(1-7/100) AND COUNT(重新买入,BARSLAST(重新买入)+1)==1 AND COUNT(SEL,BARSLAST(重
新买入)+1)==0);
重新卖出:=(SEL AND COUNT(重新买入,BARSLAST(BUNEW2)+1)==1) OR (二次止损 AND SUM(二次止损,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;
定位B68:=QB AND COUNT(L<下轨68,10)>=1;
定位B71:=QB AND COUNT(L<下轨71,10)>=1;
定位B75:=QB AND COUNT(L<下轨75,10)>=1;
定位68B:=EXIST(定位B68,BARSLAST(BUNEW)+1) AND 重新买入 AND QB;
定位71B:=EXIST(定位B71,BARSLAST(BUNEW)+1) AND 重新买入 AND QB;
定位75B:=EXIST(定位B75,BARSLAST(BUNEW)+1) AND 重新买入 AND QB;
概率1:=IFF(定位B68,5,IFF(定位B71,4,IFF(定位B75,3,0)));
概率2:=IFF(定位68B,5,IFF(定位71B,4,IFF(定位75B,3,0)));
概率:=IFF(概率1>0,概率1,概率2);
STICKLINE((D AND 日线锁定) OR (上市D AND 日线锁定),H,L,0.00,0),COLOR0000FF;
STICKLINE((D AND 日线锁定) OR (上市D AND 日线锁定),C,O,3.00,0),COLOR0000FF;
STICKLINE((K AND K补 AND 日线锁定) OR (上市K AND 日线锁定),H,L,0.00,0),COLORFFFF00;
STICKLINE((K AND K补 AND 日线锁定) OR (上市K AND 日线锁定),C,O,3.00,0),COLORFFFF00;
STICKLINE(C==O AND (D OR 上市D) AND 日线锁定,C,C,3,0),COLOR0000FF;
STICKLINE(C==O AND (K AND K补) AND 日线锁定,C,C,3,0),COLORFFFF00;
绘制多头:=(D AND 日线锁定) OR (上市D AND 日线锁定);
绘制空头:=(K AND K补 AND 日线锁定) OR (上市K AND 日线锁定);
代修复部分:=绘制多头==0 AND 绘制空头==0;
B修:=BARSLAST(QB);
S修:=BARSLAST(QS);
补充绘制:=IFF(B修<S修 AND 代修复部分,1,IFF(B修>S修 AND 代修复部分,2,0));
STICKLINE(日线锁定 AND 补充绘制==1,H,L,0.00,0),COLOR0000FF;
STICKLINE(日线锁定 AND 补充绘制==1,C,O,3.00,0),COLOR0000FF;
STICKLINE(日线锁定 AND 补充绘制==2,H,L,0.00,0),COLORFFFF00;
STICKLINE(日线锁定 AND 补充绘制==2,C,O,3,0),COLORFFFF00;
DRAWICON(QB AND 日线锁定,LOW,1);
DRAWICON(QB AND 日线锁定,LOW*0.995,7);
DRAWICON(QS AND 日线锁定,HIGH,2);
DRAWICON(QS AND 日线锁定,HIGH*1.005,8);
DRAWICON(概率==5 AND 日线锁定,L*0.97,14);
DRAWICON(概率==4 AND 日线锁定,L*0.97,13);
DRAWICON(概率==3 AND 日线锁定,L*0.97,11);
来函数检测结果如下:
该公式没有未来函数
解密、编写股票、期货策略请联系QQ或微信同号:88652583
相关股票指标公式
原理解析:
日线锁定赋值:(PERIOD==5) AND (C>0) AND V>0
引力赋值:(C的30日简单移动平均+C的72日简单移动平均)/2
下轨赋值:引力*0.73
下轨75:=引力*0.75
下轨71:=引力*0.71
下轨68:=引力*0.68
过滤周期赋值:1
VAR1赋值:收盘价的9日指数移动平均,9)
控盘赋值:(VAR1-1日前的VAR1)/1日前的VAR1*1000
资金赋值:收盘价的8日指数移动平均,8)
资金抬轿:=(资金-1日前的资金)/1日前的资金*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
BUNEW:=BU
止损条件赋值:收盘价/REF(开盘价,上次BU距今天数)<(1-7/100) AND COUNT(BU,上次BU距今天数+1)==1 AND COUNT(SEL,上次BU距今天数+1)==0
SELNEW:=IFF(止损条件 AND COUNT(止损条件,上次BU距今天数+1)==1,1,IFF(SEL AND COUNT(止损条件,上次BU距今天数+1)==0,1,0))
重新买入赋值:COUNT(止损条件,上次BUNEW距今天数+1)>=1 AND CROSS(C,0.965*REF(O,上次BUNEW距今天数))
不在同一天1赋值:((重新买入 AND SELNEW)==0)
BUNEW2赋值:((BUNEW AND 统计过滤周期日满足SELNEW的天数==0) OR 重新买入) AND 不在同一天1
二次止损赋值:(收盘价/REF(开盘价,上次重新买入距今天数)<(1-7/100) AND COUNT(重新买入,上次重新买入距今天数+1)==1 AND COUNT(SEL,BARSLAST(重
新买入)+1)==0)
重新卖出赋值:(SEL AND COUNT(重新买入,上次BUNEW2距今天数+1)==1) OR (二次止损 AND 0的二次止损日累和==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,BARSCOUNT
(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
定位B68赋值:QB AND 统计10日满足L<下轨68的天数>=1
定位B71赋值:QB AND 统计10日满足L<下轨71的天数>=1
定位B75赋值:QB AND 统计10日满足L<下轨75的天数>=1
定位68B赋值:EXIST(定位B68,上次BUNEW距今天数+1) AND 重新买入 AND QB
定位71B赋值:EXIST(定位B71,上次BUNEW距今天数+1) AND 重新买入 AND QB
定位75B赋值:EXIST(定位B75,上次BUNEW距今天数+1) AND 重新买入 AND QB
概率1赋值:IFF(定位B68,5,IFF(定位B71,4,IFF(定位B75,3,0)))
概率2赋值:IFF(定位68B,5,IFF(定位71B,4,IFF(定位75B,3,0)))
概率赋值:IFF(概率1>0,概率1,概率2)
STICKLINE((D AND 日线锁定) OR (上市D AND 日线锁定),H,L,0.00,0),COLOR0000FF
STICKLINE((D AND 日线锁定) OR (上市D AND 日线锁定),C,O,3.00,0),COLOR0000FF
STICKLINE((K AND K补 AND 日线锁定) OR (上市K AND 日线锁定),H,L,0.00,0),COLORFFFF00
STICKLINE((K AND K补 AND 日线锁定) OR (上市K AND 日线锁定),C,O,3.00,0),COLORFFFF00
STICKLINE(C==O AND (D OR 上市D) AND 日线锁定,C,C,3,0),COLOR0000FF
STICKLINE(C==O AND (K AND K补) AND 日线锁定,C,C,3,0),COLORFFFF00
绘制多头赋值:(D AND 日线锁定) OR (上市D AND 日线锁定)
绘制空头赋值:(K AND K补 AND 日线锁定) OR (上市K AND 日线锁定)
代修复部分赋值:绘制多头==0 AND 绘制空头==0
B修赋值:上次QB距今天数
S修赋值:上次QS距今天数
补充绘制赋值:IFF(B修S修 AND 代修复部分,2,0))
当满足条件日线锁定 AND 补充绘制==1时,在H和L之间画柱状线
当满足条件日线锁定 AND 补充绘制==1时,在C和O之间画柱状线
当满足条件日线锁定 AND 补充绘制==2时,在H和L之间画柱状线
当满足条件日线锁定 AND 补充绘制==2时,在C和O之间画柱状线
当满足条件QB AND 日线锁定时,在最低价和1之间画图标
当满足条件QB AND 日线锁定时,在最低价*0.995和7之间画图标
当满足条件QS AND 日线锁定时,在最高价和2之间画图标
当满足条件QS AND 日线锁定时,在最高价*1.005和8之间画图标
当满足条件概率==5 AND 日线锁定时,在L*0.97和14之间画图标
当满足条件概率==4 AND 日线锁定时,在L*0.97和13之间画图标
当满足条件概率==3 AND 日线锁定时,在L*0.97和11之间画图标