通达信 大牛 中牛 短牛指标源码 及选股公式源码
来源:股典钟量化炒股机器人 | 作者:股典钟量化炒股机器人 | 发布时间: 2024-07-03 | 144 次浏览 | 分享到:
出现 大牛 中牛 短牛指标信号买入,出现“卖”信号果断卖出。在没有出现卖的信号就持有待涨。

大牛信号出现可以做长线, 中牛信号出现可以做中线, 短牛信号出现可以做短线。


用法:出现 大牛 中牛 短牛指标信号买入,出现“卖”信号果断卖出。在没有出现卖的信号就持有待涨。

 大牛信号出现可以做长线, 中牛信号出现可以做中线, 短牛信号出现可以做短线。                

源码如下:          

N1:=5;N2:=10;
STICKLINE(C>0,0,10,15,0),COLOR781816;
LC:=REF(CLOSE,1);
RSI5:SMA(MAX(CLOSE-LC,0),N1,1)/SMA(ABS(CLOSE-LC),N1,1)*10,COLORFF00FF,LINETHICK1;
RSI10:SMA(MAX(CLOSE-LC,0),N2,1)/SMA(ABS(CLOSE-LC),N2,1)*10,COLOR00FFFF;
VAR1:=C-REF(C,1);
VAR2:=100*EMA(EMA(VAR1,6),6)/EMA(EMA(ABS(VAR1),6),6);
MA5:=EMA(C,5);
MA13:=EMA(C,13);
UP:=DRAWLINE(L=LLV(L,BARSLAST(CROSS(MA13,MA5)) 1),LLV(L,BARSLAST(CROSS
(MA13,MA5)) 1),H=HHV(H,BARSLAST(CROSS(MA5,MA13)) 1),HHV(H,BARSLAST(CROSS
(MA5,MA13)) 1),0),COLOR0000FF;
DOWN:=DRAWLINE(H=HHV(H,BARSLAST(CROSS(MA5,MA13)) 1),HHV(H,BARSLAST(CROSS
(MA5,MA13)) 1),L=LLV(L,BARSLAST(CROSS(MA13,MA5)) 1),LLV(L,BARSLAST(CROSS
(MA13,MA5)) 1),0),COLOR00FF00;
BT:(LLV(VAR2,2)=LLV(VAR2,7) AND COUNT(VAR2                  <0,2) AND CROSS(VAR2,MA(VAR2,2))) AND
REF(DOWN,1)REF(DOWN,1);
0,COLORFF00FF;
10,COLORFF0000;
STICKLINE(UP,0,0.2,3,0),COLOR0000FF;
STICKLINE(DOWN,0,0.2,3,0),COLOR00FF00;
STICKLINE(BT,0,3,2,0),COLOR000088;
STICKLINE(BT,0,3,1,0),COLOR0000CC;
STICKLINE(BT,0,3,0.22,0),COLOR0000FF;
DRAWTEXT(BT,3,'短牛'),COLOR0000FF;
TJ1:=REF(DOWN,1)REF(DOWN,1) AND C                      STICKLINE(TJ1,0,2,3,0),COLOR880088;
STICKLINE(TJ1,0,2,1.5,0),COLORAA00AA;
STICKLINE(TJ1,0,2,0.8,0),COLORCC00CC;
STICKLINE(TJ1,0,2,0.2,0),COLORFF00FF;
DRAWTEXT(TJ1,2,'中牛'),COLORFF00FF;
HR:=HHV(HIGH,55);
HRY:=LLV(LOW,55);
HRY11:=HR*HRY;
HRY33:=SQRT(HRY11);
TJ2:=REF(DOWN,1)REF(DOWN,1) AND C                        STICKLINE(TJ2,0,1,5,0),COLOR008888;
STICKLINE(TJ2,0,1,2,0),COLOR00AAAA;
STICKLINE(TJ2,0,1,1,0),COLOR00CCCC;
STICKLINE(TJ2,0,1,0.2,0),COLOR00FFFF;
DRAWTEXT(TJ2,1,'大牛'),COLOR00FFFF;
ST:=REF(UP,1)>REF(UP,2) AND DOWN                        STICKLINE(ST,10,9,5,0),COLOR008800;
STICKLINE(ST,10,9,2,0),COLOR00AA00;
STICKLINE(ST,10,9,1,0),COLOR00CC00;
STICKLINE(ST,10,9,0.2,0),COLOR00FF00;
DRAWTEXT(ST,9,'卖'),COLOR00FF00;


{已通过测试}
下面的是选股公式:可以三个选股公式一齐加在条件选股里面选!
{短牛选股公式源码}
MA5:=EMA(C,5);
MA13:=EMA(C,13);
VAR1:=C-REF(C,1);
VAR2:=100*EMA(EMA(VAR1,6),6)/EMA(EMA(ABS(VAR1),6),6);
UP:=DRAWLINE(L=LLV(L,BARSLAST(CROSS(MA13,MA5)) 1),LLV(L,BARSLAST(CROSS
(MA13,MA5)) 1),H=HHV(H,BARSLAST(CROSS(MA5,MA13)) 1),HHV(H,BARSLAST(CROSS
(MA5,MA13)) 1),0);
DOWN:=DRAWLINE(H=HHV(H,BARSLAST(CROSS(MA5,MA13)) 1),HHV(H,BARSLAST(CROSS
(MA5,MA13)) 1),L=LLV(L,BARSLAST(CROSS(MA13,MA5)) 1),LLV(L,BARSLAST(CROSS
(MA13,MA5)) 1),0);
短牛买:(LLV(VAR2,2)=LLV(VAR2,7) AND COUNT(VAR2<0,2) AND CROSS(VAR2,MA(VAR2,2))) AND
REF(DOWN,1)REF(DOWN,1);
--------------------------------------------------------------------------------------
{中牛选股公式源码}
MA5:=EMA(C,5);
MA13:=EMA(C,13);
UP:=DRAWLINE(L=LLV(L,BARSLAST(CROSS(MA13,MA5)) 1),LLV(L,BARSLAST(CROSS
(MA13,MA5)) 1),H=HHV(H,BARSLAST(CROSS(MA5,MA13)) 1),HHV(H,BARSLAST(CROSS
(MA5,MA13)) 1),0);
DOWN:=DRAWLINE(H=HHV(H,BARSLAST(CROSS(MA5,MA13)) 1),HHV(H,BARSLAST(CROSS
(MA5,MA13)) 1),L=LLV(L,BARSLAST(CROSS(MA13,MA5)) 1),LLV(L,BARSLAST(CROSS
(MA13,MA5)) 1),0);
中牛买:REF(DOWN,1)REF(DOWN,1) AND C--------------------------------------------------------------------------------------
{大牛选股公式源码:}
MA5:=EMA(C,5);
MA13:=EMA(C,13);
UP:=DRAWLINE(L=LLV(L,BARSLAST(CROSS(MA13,MA5)) 1),LLV(L,BARSLAST(CROSS
(MA13,MA5)) 1),H=HHV(H,BARSLAST(CROSS(MA5,MA13)) 1),HHV(H,BARSLAST(CROSS
(MA5,MA13)) 1),0);
DOWN:=DRAWLINE(H=HHV(H,BARSLAST(CROSS(MA5,MA13)) 1),HHV(H,BARSLAST(CROSS
(MA5,MA13)) 1),L=LLV(L,BARSLAST(CROSS(MA13,MA5)) 1),LLV(L,BARSLAST(CROSS
(MA13,MA5)) 1),0);
HR:=HHV(HIGH,55);
HRY:=LLV(LOW,55);
HRY11:=HR*HRY;
HRY33:=SQRT(HRY11);
长牛买:REF(DOWN,1)REF(DOWN,1) AND C