通达信稳赚系列
来源:股典钟量化炒股机器人 | 作者:股典钟量化炒股机器人 | 发布时间: 2024-08-01 | 320 次浏览 | 分享到:
通达信稳赚系列

一、趋势型

1、稳赚 MACD,短线只做红柱柱,中线只做暖色带(f副图):

DRAWGBK(1,RGB(0,0,0),RGB(0,0,0),0,'01',0);
DIF:EMA(CLOSE,12) - EMA(CLOSE,26),COLORWHITE,LINETHICK2;
DEA:EMA(DIF,9),COLORYELLOW,LINETHICK2;
MACD:2*(DIF-DEA),COLORSTICK;

DRAWBAND(DIF,RGB(158,50,50),DEA,RGB(83,123,68));

短线只做红柱柱:DIF>DEA AND MACD>REF(MACD,1),COLORCC66FF;
中线只做暖色带:MACD=0,COLORRED;

STICKLINE(MACD>0,0,MACD,1,0),COLORRED;

 STICKLINE(MACD>0 AND MACD<REF(MACD,1),0,MACD,1,0),COLORFFFF00;
 STICKLINE(MACD<0,0,MACD,1,0),COLORBROWN;
 STICKLINE(MACD<0 AND MACD>REF(MACD,1),0,MACD,1,0),COLORFF00FF;

DRAWICON(CROSS(DIF,DEA),DEA,1);
DRAWICON(CROSS(DEA,DIF),DIF,2);

DRAWICON(CROSS(DIF,0),DEA,9);
DRAWICON(CROSS(0,DIF),DIF,6);

买:=CROSS(DIF,DEA);
逃:=CROSS(DEA,DIF);

DRAWTEXT(买,DIF+0.02,'买'),COLORWHITE;
DRAWTEXT(逃,DEA+0.02,'逃'),COLORYELLOW;

2、稳赚 分时MACD,分时买卖点参考(副图)

DRAWGBK(1,RGB(0,0,0),RGB(0,0,0),0,'01',0);
DIF:EMA(CLOSE,12) - EMA(CLOSE,26),COLORWHITE,LINETHICK2;
DEA:EMA(DIF,9),COLORYELLOW,LINETHICK2;
MACD:2*(DIF-DEA),COLORSTICK;

DRAWBAND(DIF,RGB(158,50,50),DEA,RGB(83,123,68));

STICKLINE(MACD>0,0,MACD,1,0),COLORRED;

 STICKLINE(MACD>0 AND MACD<REF(MACD,1),0,MACD,1,0),COLORFFFF00;
 STICKLINE(MACD<0,0,MACD,1,0),COLORBROWN;
 STICKLINE(MACD<0 AND MACD>REF(MACD,1),0,MACD,1,0),COLORFF00FF;

DRAWICON(CROSS(DIF,DEA),DEA,1);
DRAWICON(CROSS(DEA,DIF),DIF,2);

DRAWICON(CROSS(DIF,0),DEA,9);
DRAWICON(CROSS(0,DIF),DIF,6);

买:=CROSS(DIF,DEA);
逃:=CROSS(DEA,DIF);

DRAWTEXT(买,DIF+0.00,'买'),COLORWHITE;
DRAWTEXT(逃,DEA+0.00,'逃'),COLORYELLOW;


二、均线型:

1、稳赚 主图,会创新高还有新高,直到不创新高

DRAWGBK(1,RGB(0,0,0),RGB(0,0,0),0,'01',0);
M60:=MA(C,60);
M120:=MA(C,120);

DRAWKLINE(H,O,L,C);

DRAWBAND(MA(CLOSE,5),RGB(160,0,0),MA(CLOSE,10),RGB(0,168,0));
DRAWBAND(MA(CLOSE,5),RGB(55,0,0),MA(CLOSE,20),RGB(0,91,0));

DRAWBAND(MA(CLOSE,60),RGB(155,50,50),MA(CLOSE,120),RGB(83,123,68));


变线:=EMA(MA(CLOSE,30),5),LINETHICK0;
STICKLINE(C>=变线 AND C>=O,H,L,0,0),COLORRED;
STICKLINE(C>=变线 AND C>=O,C,O,2.7,1),COLORRED;
STICKLINE(C>变线 AND C<=O,H,L,0,1),COLORCYAN;STICKLINE(C>变线 AND C<=O,C,O,3,0),COLORCYAN;
STICKLINE(C<变线 AND C<=O,H,L,0,1),COLORCYAN;STICKLINE(C<变线 AND C<=O,C,O,3,0),COLORCYAN;
STICKLINE(C<变线 AND C<=O,H,L,0,1),COLORGRAY;STICKLINE(C<变线 AND C>O,H,L,0,1),COLORGRAY;
STICKLINE(C<变线 AND C>O,C,O,3,1),COLORGRAY;STICKLINE(C<变线 AND C<=O,C,O,3,1),COLORGRAY;
PM:MA(C,5),COLORGRAY,LINETHICK1;
IF(PM<REF(PM,1),PM,DRAWNULL),COLORGRAY,LINETHICK0;
IF(PM>=REF(PM,1),PM,DRAWNULL),COLORRED,LINETHICK2;
IF(PM=REF(PM,1),PM,DRAWNULL),COLORRED,LINETHICK2;
A:=MA(CLOSE,12)+ABS(MA(CLOSE,12)-REF(MA(CLOSE,12),1));
B:=MA(CLOSE,12)+MA(CLOSE,12)-REF(MA(CLOSE,12),1);
分水岭:=IF(MA(CLOSE,12)<B,B,MA(CLOSE,12));
操作线:=分水岭-(EMA(C,3)-分水岭);
AA:=CROSS(分水岭,操作线);
STICKLINE(AA,C,O,3,0),COLOR0000AA;
STICKLINE(AA,C,O,2,0),COLOR0033CC;
STICKLINE(AA,C,O,1,0),COLOR0055EE;
STICKLINE(AA,C,O,0.3,0),COLOR0099FF;
STICKLINE(AA,H,L,0,1),COLOR0099FF;
RR:=CROSS((MA(VOL,5)),(MA(VOL,10))) AND MA(C,2)>=MA(C,4); {AND VOL>=REF(VOL,1)}
STICKLINE(RR,C,O,3,0),COLOR0000AA;
STICKLINE(RR,C,O,2,0),COLOR0033CC;
STICKLINE(RR,C,O,1,0),COLOR0055EE;
STICKLINE(RR,C,O,0.3,0),COLOR0099EE;
STICKLINE(RR,H,L,0,1),COLOR0099FF;
MA5:MA(CLOSE,5),NODRAW;
MA10:MA(CLOSE,10),COLORCC66FF;
MA20:MA(CLOSE,20),COLORFFCC66,LINETHICK2;

MA60:MA(CLOSE,60),COLOR00FF99,LINETHICK2;
MA120:MA(C,120),COLORGRAY;
MA250:MA(CLOSE,250)COLORBLUE;

DRAWTEXT(CROSS(MA60,MA120),MA60,'大牛'),COLORYELLOW,LINETHICK4;
DRAWTEXT(CROSS(MA120,MA60),MA60,'大熊'),COLORWHITE,LINETHICK2;

DRAWICON(CROSS(MA5,MA10),MA10,1); {5日上穿10日做记号}
DRAWICON(CROSS(MA10,MA20),MA20,9); {10日上穿20日做记号}
DRAWICON(CROSS(MA20,MA60),MA60,1);  {20日上穿60日做记号}
DRAWICON(CROSS(MA10,MA5),MA10,2); {5日下穿10日做记号}
DRAWICON(CROSS(MA20,MA10),MA20,6); {10日下穿20日做记号}
DRAWICON(CROSS(MA60,MA20),MA60,2); {20日下穿60日做记号}

STICKLINE(C<0.90*REF(C,1),C,O,4,0),COLORGREEN;
STICKLINE(C>1.099*REF(C,1),C,O,4,0),COLORYELLOW;

Z1:=STRCAT(HYBLOCK,' ');
Z2:=STRCAT(Z1,DYBLOCK);
Z3:=STRCAT(Z2,' ');
DRAWTEXT_FIX(ISLASTBAR,0,0,0,STRCAT(Z3,GNBLOCK)),COLOR00C0C0;

现价:PLOYLINE(1,CONST(C)),COLOR008888,LINETHICK1;
2、稳赚 主图W,会创新高还有新高,直到不创新高

DRAWGBK(1,RGB(0,0,0),RGB(0,0,0),0,'01',0);
M60:=MA(C,60);
M120:=MA(C,120);

DRAWKLINE(H,O,L,C);

DRAWBAND(MA(CLOSE,5),RGB(160,0,0),MA(CLOSE,10),RGB(0,168,0));
DRAWBAND(MA(CLOSE,5),RGB(55,0,0),MA(CLOSE,20),RGB(0,91,0));

DRAWBAND(MA(CLOSE,60),RGB(155,50,50),MA(CLOSE,120),RGB(83,123,68));


变线:=EMA(MA(CLOSE,30),5),LINETHICK0;
STICKLINE(C>=变线 AND C>=O,H,L,0,0),COLORRED;
STICKLINE(C>=变线 AND C>=O,C,O,2.7,1),COLORRED;
STICKLINE(C>变线 AND C<=O,H,L,0,1),COLORCYAN;STICKLINE(C>变线 AND C<=O,C,O,3,0),COLORCYAN;
STICKLINE(C<变线 AND C<=O,H,L,0,1),COLORCYAN;STICKLINE(C<变线 AND C<=O,C,O,3,0),COLORCYAN;
STICKLINE(C<变线 AND C<=O,H,L,0,1),COLORGRAY;STICKLINE(C<变线 AND C>O,H,L,0,1),COLORGRAY;
STICKLINE(C<变线 AND C>O,C,O,3,1),COLORGRAY;STICKLINE(C<变线 AND C<=O,C,O,3,1),COLORGRAY;
PM:MA(C,5),COLORGRAY,LINETHICK1;
IF(PM<REF(PM,1),PM,DRAWNULL),COLORGRAY,LINETHICK0;
IF(PM>=REF(PM,1),PM,DRAWNULL),COLORRED,LINETHICK2;
IF(PM=REF(PM,1),PM,DRAWNULL),COLORRED,LINETHICK2;
A:=MA(CLOSE,12)+ABS(MA(CLOSE,12)-REF(MA(CLOSE,12),1));
B:=MA(CLOSE,12)+MA(CLOSE,12)-REF(MA(CLOSE,12),1);
分水岭:=IF(MA(CLOSE,12)<B,B,MA(CLOSE,12));
操作线:=分水岭-(EMA(C,3)-分水岭);
AA:=CROSS(分水岭,操作线);
STICKLINE(AA,C,O,3,0),COLOR0000AA;
STICKLINE(AA,C,O,2,0),COLOR0033CC;
STICKLINE(AA,C,O,1,0),COLOR0055EE;
STICKLINE(AA,C,O,0.3,0),COLOR0099FF;
STICKLINE(AA,H,L,0,1),COLOR0099FF;
RR:=CROSS((MA(VOL,5)),(MA(VOL,10))) AND MA(C,2)>=MA(C,4); {AND VOL>=REF(VOL,1)}
STICKLINE(RR,C,O,3,0),COLOR0000AA;
STICKLINE(RR,C,O,2,0),COLOR0033CC;
STICKLINE(RR,C,O,1,0),COLOR0055EE;
STICKLINE(RR,C,O,0.3,0),COLOR0099EE;
STICKLINE(RR,H,L,0,1),COLOR0099FF;
MA5:MA(CLOSE,5),NODRAW;
MA10:MA(CLOSE,10),COLORCC66FF;
MA20:MA(CLOSE,20),COLORFFCC66,LINETHICK2;

MA60:MA(CLOSE,60),COLOR00FF99,LINETHICK2;
MA120:MA(C,120),COLORGRAY;
MA250:MA(CLOSE,250)COLORBLUE;

DRAWTEXT(CROSS(MA60,MA120),MA60,'大牛'),COLORYELLOW,LINETHICK4;
DRAWTEXT(CROSS(MA120,MA60),MA60,'大熊'),COLORWHITE,LINETHICK2;

DRAWICON(CROSS(MA5,MA10),MA10,1); {5日上穿10日做记号}
DRAWICON(CROSS(MA10,MA20),MA20,9); {10日上穿20日做记号}
DRAWICON(CROSS(MA20,MA60),MA60,1);  {20日上穿60日做记号}
DRAWICON(CROSS(MA10,MA5),MA10,2); {5日下穿10日做记号}
DRAWICON(CROSS(MA20,MA10),MA20,6); {10日下穿20日做记号}
DRAWICON(CROSS(MA60,MA20),MA60,2); {20日下穿60日做记号}

STICKLINE(C<0.90*REF(C,1),C,O,4,0),COLORGREEN;
STICKLINE(C>1.099*REF(C,1),C,O,4,0),COLORYELLOW;

Z1:=STRCAT(HYBLOCK,' ');
Z2:=STRCAT(Z1,DYBLOCK);
Z3:=STRCAT(Z2,' ');
DRAWTEXT_FIX(ISLASTBAR,0,0,0,STRCAT(Z3,GNBLOCK)),COLOR00C0C0;

三、选股(源码不全,需者联系,有偿的,有点贵喔)

1、稳赚MACD选股1,MACD金叉 强势股精选。

DIF:=EMA(CLOSE,12) -
DEA:=EMA(DIF,9);
MACD:=2*(DIF-DEA);
MACD金叉:=CROSS(DIF,DEA);
M1:=MA(C,5);
M2:=MA(C,10);
M3:=MA(C,20);
M4:=MA(C,60);
M5:=MA(C,120);
N2:=M1>M2 AND (M1>=M4)  AND (M2>=M4)  AND M4>M5;

VA:=IF(CLOSE>REF(CLOSE,1),VOL,-VOL);
OBV:=SUM(IF(CLOSE=REF(CLOSE,1),0,VA),0);
T1:=HHV(OBV,60);
T2:=REF(T1,1);

V5:=MA(V,5);
V10:=MA(V,10);
V60:=MA(V,60);
                             
COUNT(MACD金叉,金叉天数)>=1                       {MACD金叉}                   
AND MACD>REF(MACD,1)                              {MACD多头}
AND N2                                            {牛市里}
AND OBV>T2                                        {稳赚能量}
AND VOL>V60                                       {量能填满60线}
AND C>=OPEN AND C>=M1
AND FINANCE(33)>0.01                              {收益为正,可选设置}
AND NOT(DYNAINFO(4)=0)                            {无停牌}
AND NOT(NAMELIKE('S') OR NAMELIKE('*'))           {无ST};

2、稳赚MACD选股2,MACD钱袋子 强势股精选。

DIF:=EMA(CLOSE,12) -
DEA:=EMA(DIF,9);
MACD:=2*(DIF-DEA);
MACD金叉:=CROSS(DIF,DEA);
钱袋子:=CROSS(DIF,0);
M1:=MA(C,5);
M2:=MA(C,10);
M3:=MA(C,20);
M4:=MA(C,60);
M5:=MA(C,120);
N2:=M1>M2 AND {(M1>=M4)  AND (M2>=M4)  AND} M4>M5;

COUNT(钱袋子,钱袋子天数)>=1                       {钱袋子}                    
AND MACD>REF(MACD,1)                              {MACD多头}
AND N2                                            {牛}
AND C>=OPEN AND C>=M1
AND NOT(DYNAINFO(4)=0)                            {无停牌}
AND NOT(NAMELIKE('S') OR NAMELIKE('*'))           {无ST};

3、稳赚盘中预警,神枪手   步步高升+爆发点+稳赚能量+稳赚MACD主力

M1:=MA(C,5)  ;
M2:=MA(C,10) ;
M3:=MA(C,20) ;
M4:=MA(C,60) ;
M5:=MA(C,120);
步步高升:=M1>REF(M1,1) AND M2>REF(M2,1) AND M3>REF(M3,1)
          AND M1>M2 AND M2>M3 AND
A3:=C>=OPEN AND C>=M1;

DIF:=EMA(CLOSE,12) - EMA(CLOSE,26);
DEA:=EMA(DIF,9);
MACD:=2*(DIF-DEA);
MACD金叉:=CROSS(DIF,DEA);
MACD零上:=DIF>0;

VA:=IF(CLOSE>REF(CLOSE,1),VOL,-VOL);
OBV:=SUM(IF(CLOSE=REF(CLOSE,1),0,VA),0);
T1:=HHV(OBV,60);
T2:=REF(T1,1);
                             
A1:=MA(VOL,5);
A2:=REF(A1,1);
虚拟成交量:=IF(CURRBARSCOUNT=1 AND PERIOD=5,VOL*240/FROMOPEN,0);
爆量:=虚拟成交量>(A2*10) AND 虚拟成交量>HHV(V,120);{虚拟成交量顶天立地}

步步高升                            {步步高升}
AND C>=OPEN AND C>=M1               {收盘在五日线之上}
AND 爆量                            {爆发点}
AND MACD零上                        {稳赚MACD主力}
AND MACD>REF(MACD,1)                {稳赚MACD主力强势}
AND OBV>T2                          {稳赚能量}
{AND CAPITAL<8*1000000}             {流通盘小于8亿,可选设置}
AND C>=HHV(CLOSE,突破前高天数)      {一览众山小}        
AND C<60                            {现价小于60 }
AND DYNAINFO(14)<0.08               {防追高设计}
AND NOT(NAMELIKE('S') OR NAMELIKE('*'))   {无ST}
AND NOT(DYNAINFO(4)=0)              {无停牌};