A. 求通达信软件选股公式,高手请进~~~~~
要求太多了,我只找到一个接近要求的,图片演示在下面网址里.
A:=CURRBARSCOUNT;
A1:=DAY!=REF(DAY,1);
A2:=BARSLAST(A1)+1;
A3:=MA(C,A2);
A4:=SUM(AMO,A2)/SUM(VOL,A2)/100;
A5:=IF(CAPITAL>0,A4,A3);
均价线:=IF(A<=CONST(A2),A5,DRAWNULL);
分钟有效周期:=IF(PERIOD=2,15,IF(PERIOD=3,30,IF(PERIOD=4,60,IF(PERIOD=5,240,DRAWNULL))));
分时价:=TFILT(CLOSE,CURRBARSCOUNT,00,CURRBARSCOUNT,00);
分时判断:=IF(分时价=DRAWNULL,1,IF(分钟有效周期=DRAWNULL,DRAWNULL,1));
{-----------------------------由MACD定位顶底 -------------------------------}
DIFF:=EMA(CLOSE,12)-EMA(CLOSE,26);
DEA:=EMA(DIFF,9);
MACD:=2*(DIFF-DEA);
KX:=BARSSINCE(CLOSE);{←首次开盘价距金的天数}
HHN:=CONST(HHV(DIFF,KX));
HLN:=CONST(LLV(DEA,KX));
RC1:=CONST((HHN+HLN)/2);
SS:=((HHN-HLN)/200);
MACD底部:=(-100*SS+RC1)+-(-100*SS+RC1),COLOR669999;
MACD顶部:=(100*SS+RC1)+-(-100*SS+RC1),COLORFF0033;
MACD中轴:=0+-(-100*SS+RC1);
DIFF修正:=DIFF+-(-100*SS+RC1),COLOR008080;
DEA修正:=DEA+-(-100*SS+RC1),COLOR00FF00;
MACD修正:=2*(DIFF修正-DEA修正)+MACD中轴,COLOR0000BB,NODRAW;
MACD超跌:=CONST(LLV(MACD修正,KX));
MACD超跌线:=IF(MACD超跌<MACD底部,MACD超跌,MACD底部);
{----------------------利用MACD趋势进行精确顶底判断 ------------------------}
顶部:=MACD顶部+-MACD超跌线;
天际:=顶部*0.809;
中轴:=MACD中轴+-MACD超跌线;
海面:=顶部*0.191;
底部:=MACD底部;
{------------------------传统KDJ指标结合MACD优化 ---------------------------}
RSVA:=(CLOSE-LLV(LOW,21))/(HHV(HIGH,21)-LLV(LOW,21))*顶部;{采用21日月线优化}
K:SMA(RSVA,3,1),COLORFFFFFF,NODRAW;
D:SMA(K,3,1),COLOR00FFFF,NODRAW;
原J值参数:=3*K-2*D;
JD:=IF(原J值参数<底部,底部,原J值参数);{J值底部钝化处理}
J:IF(JD>顶部,顶部,JD),COLORFF00FF,NODRAW;{底部钝化处理后再进行顶部钝化处理}
{---------------------------MACD多空量能判断-------------------------------}
MACD多头:DIFF修正+-MACD超跌线,COLOR339999;
空头:DEA修正+-MACD超跌线,COLOR00FF00;
量能柱:2*(MACD多头-空头)+中轴,COLOR0000BB,NODRAW;
超前DEA:=(EMA(MACD多头,7));
超前MACD:=2*(MACD多头-超前DEA)+中轴;
{-----------------------------------大盘动向-------------------------------}
VAR1大盘:=LLV(LOW,13);
VAR2大盘:=HHV(HIGH,13);
VAR3大盘:=(SMA((CLOSE-VAR1大盘)/(VAR2大盘-VAR1大盘)*顶部,5,1))-顶部/2;
VAR4大盘:=SMA((VAR2大盘-CLOSE)/(VAR2大盘-VAR1大盘)*顶部,5,1)-顶部/2;
大盘散户:=IF(VAR4大盘<底部,底部,VAR4大盘),COLOR408000;
大盘主力:=IF(VAR3大盘<底部,底部,VAR3大盘),COLOR330088;
{---------------------------------密集成本突破-----------------------------}
最高获利参数:=顶部/100;
VAR1C:=(COST(89)-COST(11))*最高获利参数;
VAR2C:=(COST(99.9)-COST(1))*最高获利参数;
单峰:=((1-VAR1C/VAR2C))*顶部;
低密:=((COST(90)-COST(60))/VAR2C)*顶部;
高密:=((COST(40)-COST(1))/VAR2C)*顶部;
赢利:= (SMA(WINNER(AMOUNT/VOL/99),2,1))*顶部;
活跃度:顶部-顶部/(1+EXPMA(HSL,21)),COLOR774455; {←CYF公众追涨热情指标}
70%成本集中度:=IF(VAR1C>顶部,顶部,VAR1C),COLORFFFFFF;
90%成本集中度:=IF(VAR2C>顶部,顶部,VAR2C),COLORFF0000;
套牢筹码上升:=IF((单峰-赢利)>底部,(单峰-赢利),底部);
个股散户:=IF(套牢筹码上升>顶部,顶部,套牢筹码上升),COLOR408000;
散户:IF(个股散户=DRAWNULL,DRAWNULL,个股散户),COLOR408000;
获利筹码上升:=IF((赢利-单峰)>底部,(赢利-单峰),底部);
个股主力:=IF(获利筹码上升>顶部,顶部,获利筹码上升),COLOR330088;
主力:IF(个股主力=DRAWNULL,DRAWNULL,个股主力),COLOR330088;
{--------------------换手率,五日换手率辅助判断个股活跃度-------------------}
换手:SUM(VOL,1)/CAPITAL*100,COLOR666666,NODRAW;
⑤日换:SUM(VOL,5)/CAPITAL*100,COLOR999999,NODRAW;
{----------------------密集成本突破指标筹码峰画线--------------------------}
金色背景修边1:STICKLINE(C>0 AND CURRBARSCOUNT>=2,顶部,底部,3.05,0),COLOR003333;
金色背景修边2:STICKLINE(C>0 AND CURRBARSCOUNT>=2,顶部,中轴,3.05,0),COLOR003333;
金色背景补充:DRAWBAND(顶部,RGB(51,51,0),中轴,RGB(51,51,0));
金色背景:DRAWBAND(顶部,RGB(51,51,0),底部,RGB(128,128,128));
追涨热度峰紫色:DRAWBAND(活跃度,RGB(66,52,81),底部,RGB(204,0,0));
高密峰墨蓝色:=DRAWBAND(高密,RGB(0,0,51),底部,RGB(0,0,255));
低密峰纯蓝色:=DRAWBAND(低密,RGB(0,0,102),底部,RGB(0,0,255));
90%成本峰:DRAWBAND(90%成本集中度,RGB(0,0,153),底部,RGB(0,0,153));
70%成本峰:DRAWBAND(70%成本集中度,RGB(0,128,0),底部,RGB(255,255,255));
散户峰绿色:DRAWBAND(散户,RGB(0,64,0),底部,RGB(204,0,0));
主力峰红色:DRAWBAND(主力,RGB(102,26,51),底部,RGB(0,0,255));
MACD多空趋势:DRAWBAND(MACD多头,RGB(204,51,51),空头,RGB(0,179,0));
MACD多头重画:DRAWBAND(MACD多头,RGB(153,153,51),MACD多头,RGB(153,153,51));
MACD空头重画:DRAWBAND(空头,RGB(0,204,0),空头,RGB(0,204,0));
{--------创幻论坛‘131488’会员提供的通达信■新宝塔线■-----原码-----------}
VAR1:=CLOSE>REF(CLOSE,1) AND CLOSE>REF(CLOSE,2);
VAR2:=REF(VAR1,1) AND CLOSE<=REF(CLOSE,1) AND CLOSE>=REF(CLOSE,2);
VAR3:=REF(VAR2,1) AND CLOSE>=REF(CLOSE,1) AND CLOSE<=REF(CLOSE,2);
VAR4:=REF(VAR3,1) AND CLOSE<=REF(CLOSE,1) AND CLOSE>=REF(CLOSE,2);
VAR5:=REF(VAR4,1) AND CLOSE>=REF(CLOSE,1) AND CLOSE<=REF(CLOSE,2);
VAR6:=REF(VAR5,1) AND CLOSE<=REF(CLOSE,1) AND CLOSE>=REF(CLOSE,2);
VAR7:=REF(VAR6,1) AND CLOSE>=REF(CLOSE,1) AND CLOSE<=REF(CLOSE,2);
VAR8:=REF(VAR7,1) AND CLOSE<=REF(CLOSE,1) AND CLOSE>=REF(CLOSE,2);
VAR9:=REF(VAR8,1) AND CLOSE>=REF(CLOSE,1) AND CLOSE<=REF(CLOSE,2);
VARD:=CLOSE<REF(CLOSE,1) AND CLOSE<REF(CLOSE,2);
VARE:=REF(VARD,1) AND CLOSE>=REF(CLOSE,1) AND CLOSE<=REF(CLOSE,2);
VARF:=REF(VARE,1) AND CLOSE<=REF(CLOSE,1) AND CLOSE>=REF(CLOSE,2);
VAR10:=REF(VARF,1) AND CLOSE>=REF(CLOSE,1) AND CLOSE<=REF(CLOSE,2);
VAR11:=REF(VAR10,1) AND CLOSE<=REF(CLOSE,1) AND CLOSE>=REF(CLOSE,2);
VAR12:=REF(VAR11,1) AND CLOSE>=REF(CLOSE,1) AND CLOSE<=REF(CLOSE,2);
VAR13:=REF(VAR12,1) AND CLOSE<=REF(CLOSE,1) AND CLOSE>=REF(CLOSE,2);
VAR14:=REF(VAR13,1) AND CLOSE>=REF(CLOSE,1) AND CLOSE<=REF(CLOSE,2);
VAR15:=REF(VAR14,1) AND CLOSE<=REF(CLOSE,1) AND CLOSE>=REF(CLOSE,2);
VAR16:=REF(VAR15,1) AND CLOSE>=REF(CLOSE,1) AND CLOSE<=REF(CLOSE,2);
VAR17:=REF(VAR16,1) AND CLOSE<=REF(CLOSE,1) AND CLOSE>=REF(CLOSE,2);
VAR18:=REF(VAR17,1) AND CLOSE>=REF(CLOSE,1) AND CLOSE<=REF(CLOSE,2);
三平底翻金:=(REF(VARD OR VARE OR VARF OR VAR10 OR VAR11 OR VAR12 OR VAR13 OR VAR14 OR VAR15 OR VAR16 OR VAR17 OR VAR18,1))
AND VAR1;
主力启动线:=MA(V,5),COLORFFFFFF;
主力洗盘线:=MA(V,35),COLOR00FFFF;
资金异动线:=MA(V,135),COLORFF0000;
{----------------------------买卖参考--------------------------------------}
出击:=(CROSS(主力启动线,资金异动线) OR ((主力洗盘线 > 资金异动线) AND CROSS(主力启动线,主力洗盘线))),COLORYELLOW;
启动:=(主力启动线>REF(主力启动线,1) AND (CROSS(VOL,主力启动线) AND (REF(VOL,1)<REF(资金异动线,1) OR REF(VOL,2)<REF(资金异动线,2)))),COLOR45AAEE;
成立:=三平底翻金 AND (出击 OR 启动);
买入提示:=IF(成立=1,海面*0.5,0) AND 分时判断=1;
{------------------------顶部线,天际线,海面线,底部线重画-------------------}
顶部线:DRAWBAND(顶部,RGB(51,0,255),顶部,RGB(51,0,255));
天际线:DRAWBAND(天际,RGB(128,64,64),天际,RGB(128,64,64));
海面线:DRAWBAND(海面,RGB(0,153,153),海面,RGB(0,153,153));
底部线:DRAWBAND(0,RGB(153,153,102),买入提示,RGB(153,153,102));
{------------------------超前MACD多空量能柱--------------------------------}
超前MACD红柱1:STICKLINE(超前MACD>=中轴,超前MACD,中轴,1.50,0),COLOR226688;
超前MACD红柱2:STICKLINE(超前MACD>=中轴,超前MACD,中轴,0.95,0),COLOR4488BB;
超前MACD红柱3:STICKLINE(超前MACD>=中轴,超前MACD,中轴,0.31,0),COLOR55AADD;
超前MACD兰柱1:STICKLINE(超前MACD<=中轴,超前MACD,中轴,1.50,0),COLOR006600;
超前MACD兰柱2:STICKLINE(超前MACD<=中轴,超前MACD,中轴,0.95,0),COLOR007700;
超前MACD兰柱3:STICKLINE(超前MACD<=中轴,超前MACD,中轴,0.31,0),COLOR008800;
{--------------------------MACD多空量能柱----------------------------------}
MACD红柱1:STICKLINE(量能柱>=中轴,量能柱,中轴,1.5,0),COLOR000077;
MACD红柱2:STICKLINE(量能柱>=中轴,量能柱,中轴,1.1,0),COLOR000088;
MACD红柱3:STICKLINE(量能柱>=中轴,量能柱,中轴,0.6,0),COLOR000099;
MACD红柱4:STICKLINE(量能柱>=中轴,量能柱,中轴,0.15,0),COLOR0000AA;
MACD兰柱1:STICKLINE(量能柱<=中轴,量能柱,中轴,1.5,0),COLORAA6633;
MACD兰柱2:STICKLINE(量能柱<=中轴,量能柱,中轴,1.1,0),COLORBB7744;
MACD兰柱3:STICKLINE(量能柱<=中轴,量能柱,中轴,0.6,0),COLORCC8855;
MACD兰柱4:STICKLINE(量能柱<=中轴,量能柱,中轴,0.15,0),COLORDD9966;
{---------中轴线重画及顶部线,天际线,海面线,底部线,多空线文字说明-----------}
中轴线:DRAWBAND(中轴,RGB(128,128,255),中轴,RGB(128,128,255));
顶部线文字:DRAWTEXT(CURRBARSCOUNT=1,顶部*0.98,' 顶部线'),COLORFF0033;
天际线文字:DRAWTEXT(CURRBARSCOUNT=1,天际*0.98,' 天际线'),COLOR404080;
海面线文字:DRAWTEXT(CURRBARSCOUNT=1,海面,' 海面线'),COLOR999900;
底部线文字:DRAWTEXT(CURRBARSCOUNT=1,底部,' 底部线'),COLOR669999;
中轴线文字:DRAWTEXT(CURRBARSCOUNT=1,中轴,' 多空线'),COLORFF8080;
{-------------------------------传统KDJ指标线重画--------------------------}
D线重画:DRAWBAND(D,RGB(255,255,0),D*0.998,RGB(255,255,0));
K线重画:DRAWBAND(K,RGB(255,255,255),K,RGB(255,255,255));
J线重画:DRAWBAND(J,RGB(255,0,255),J,RGB(255,0,255));
B. 跪求高手将此编写成(通达信)选股公式,5日,10日和20日无线粘合一起,选出粘合时间长达5日以上
捞干的,找飙股,赚大钱;均线粘合后发飙;以下网上找的副图 {给你做几个选股公式在后};
{粘合突破----拉升前兆,创幻论坛一品茶缘编写精品指标,通达信,大智慧,飞弧 通用}
N:=5,15,10;{n表示均线之间的最大距离}
{粘合突破指标使用技巧:
均线粘合先关注,放量上穿可买入;
阳穿多线是优选,长线走牛更选优!
多头发散要拉升,脱离粘合是飞行。}
MA5:=MA(CLOSE,5);
MA10:=MA(CLOSE,10);
MA20:=MA(CLOSE,20);
MA30:=MA(CLOSE,30);
MA60:=MA(CLOSE,60);
MA90:=MA(CLOSE,90);
MA120:=MA(CLOSE,120);
MA250:=MA(CLOSE,250);
DTPL:=MA10>MA30 AND MA30>REF(MA30,1);
DG:=MAX(MAX(MA5,MA10),MAX(MA20,MA30));
ZG:=MAX(MAX(DG,MA60),MAX(MA90,MA120));
DD:=MIN(MIN(MA5,MA10),MIN(MA20,MA30));
ZD:=MIN(MIN(DD,MA60),MIN(MA90,MA120));
粘合:=(ZG/ZD-1)*100<N,POINTDOT,LINETHICK0;
高粘:=(ZG/ZD-1)*100<N AND ZD>MA250,POINTDOT,LINETHICK0;
穿5:(粘合 AND CROSS(C,MA5))*0.5;
穿10:(粘合 AND CROSS(C,MA10))*1;
穿20:(粘合 AND CROSS(C,MA20))*2;
穿30:(粘合 AND CROSS(C,MA30))*3;
FLSZ:=(C/REF(C,1)-1)*100>=2 AND V>REF(V,1);
DXTP:=((穿5/0.5)+穿10+(穿20/2)+(穿30/3))>=2;
优选:(FLSZ AND DXTP AND MA30>REF(MA30,1))*3,COLOR00FFFF,LINETHICK2;
选优:(FLSZ AND DXTP AND MA30>REF(MA30,1) AND COUNT(高粘,20)>=15)*3,COLOR0000FF,LINETHICK2;
JXDT:=MA5>MA10 AND MA10>MA20 AND MA20>MA30;
发散:(JXDT AND NOT(REF(JXDT,1)))*1,COLOR00FF00,LINETHICK2;
起飞:(NOT(粘合) AND REF(粘合,1) AND COUNT(粘合,20)>=15 AND DTPL)*3,COLORFF00FF,LINETHICK2;
{以下设置副图显示方式}
STICKLINE(粘合,-0.2,0,4,0),COLOR00FF00;
STICKLINE(高粘,0.2,0,4,0),COLORFF00FF;
DRAWTEXT(优选,3,'优●选'),COLOR00FFFF;
DRAWTEXT(发散,2,'发●散'),COLOR00FF00;
DRAWTEXT(起飞,3,'起●飞'),COLOR00FFFF;
DRAWICON(选优,0.3,1);
DRAWICON(起飞,3,1);
------------
选股公式1)起飞;
N:=5,15,10;
MA5:=MA(CLOSE,5);
MA10:=MA(CLOSE,10);
MA20:=MA(CLOSE,20);
MA30:=MA(CLOSE,30);
MA60:=MA(CLOSE,60);
MA90:=MA(CLOSE,90);
MA120:=MA(CLOSE,120);
DTPL:=MA10>MA30 AND MA30>REF(MA30,1);
DD:=MIN(MIN(MA5,MA10),MIN(MA20,MA30));
DG:=MAX(MAX(MA5,MA10),MAX(MA20,MA30));
ZG:=MAX(MAX(DG,MA60),MAX(MA90,MA120));
ZD:=MIN(MIN(DD,MA60),MIN(MA90,MA120));
粘合:=(ZG/ZD-1)*100<N;
起飞:(NOT(粘合) AND REF(粘合,1) AND COUNT(粘合,20)>=15 AND DTPL)*3;
--------------------------
选股公式2)发散{多头};
N:=5,15,10;
MA5:=MA(CLOSE,5);
MA10:=MA(CLOSE,10);
MA20:=MA(CLOSE,20);
MA30:=MA(CLOSE,30);
JXDT:=MA5>MA10 AND MA10>MA20 AND MA20>MA30;
发散:(JXDT AND NOT(REF(JXDT,1)))*1;
--------------------------------------------------------
选股公式3)优选;
N:=5,15,10;
MA5:=MA(CLOSE,5);
MA10:=MA(CLOSE,10);
MA20:=MA(CLOSE,20);
MA30:=MA(CLOSE,30);
MA60:=MA(CLOSE,60);
MA90:=MA(CLOSE,90);
MA120:=MA(CLOSE,120);
DG:=MAX(MAX(MA5,MA10),MAX(MA20,MA30));
ZG:=MAX(MAX(DG,MA60),MAX(MA90,MA120));
DD:=MIN(MIN(MA5,MA10),MIN(MA20,MA30));
ZD:=MIN(MIN(DD,MA60),MIN(MA90,MA120));
粘合:=(ZG/ZD-1)*100<N;
穿5:=(粘合 AND CROSS(C,MA5))*0.5;
穿10:=(粘合 AND CROSS(C,MA10))*1;
穿20:=(粘合 AND CROSS(C,MA20))*2;
穿30:=(粘合 AND CROSS(C,MA30))*3;
FLSZ:=(C/REF(C,1)-1)*100>=2 AND V>REF(V,1);
DXTP:=((穿5/0.5)+穿10+(穿20/2)+(穿30/3))>=2;
优选:(FLSZ AND DXTP AND MA30>REF(MA30,1))*3;
{多说一句,股市有风险}
C. 请高手帮我把下面指标做个预警公式,当副图"启动"等于50的时候预警,谢谢行家
A5:=MA(C,5);
A20:=MA(C,20);
A30:=MA(C,30);
M5:=ATAN((A5/REF(A5,1)-1)*100)*180/3.14159;
M20:=ATAN((A20/REF(A20,1)-1)*100)*180/3.14159;
M30:=ATAN((A30/REF(A30,1)-1)*100)*180/3.14159;
QSXS:=M30>0;
A50:=IF(M5<0,-25,0);
A51:=IF(BETWEEN(M5,0,45),25,A50);
A52:=IF(BETWEEN(M5,45,75),50,A51);
MA5:=IF(M5>75,75,A52)*QSXS,COLOR00FFFF;
A200:=IF(M20<0,-25,0);
A201:=IF(BETWEEN(M20,0,45),25,A200);
A202:=IF(BETWEEN(M20,45,75),50,A201);
MA20:=IF(M20>75,75,A202)*QSXS,COLORFF00FF;
A300:=IF(M30<0,-25,0);
A301:=IF(BETWEEN(M30,0,45),25,A300);
A302:=IF(BETWEEN(M30,45,75),50,A301);
MA30:=IF(M30>75,75,A302)*QSXS;
SGSJ:=BARSLAST(CROSS(MA5,REF(MA5+1,1)));
XGSJ:=BARSLAST(CROSS(REF(MA5-1,1),MA5));
列车:=IF(MA5>=50 AND MA20>=25 AND MA30>=25 AND SGSJ<XGSJ,50,25);
启动:CROSS(列车,45);
D. 哪里有免费好用的,有买卖点的股票指标公式呢
创幻及其它各大论坛多的是,不过指标说实在的用处不大。
E. 请问怎样破解我买的股票软件里指标公式的密码
首先要知道你买的是什么版本的软件
咳,既然楼下都说了,那我也推荐到创幻论坛指标公式区,我是那里的版主,欢迎你求助,或分享交流。
参考网址: http://www.chcj.net/forum-23-1.html
F. 那里有好的股票软件指标公式
没有最好,只有更好
再好的公式,用的人多了,就不好了,且庄家也会利用该公式(指标)设陷
公式--各有特点
使用者--各有所好
________________________
下面的网站收录了8个公式指标网站:
(7)指标公式
通达信公式天堂
MACD指标公式
理想论坛指标公式
创幻论坛指标公式
点金投资软件公式
海风论坛股软交流
同花顺公式俱乐部
超牛股客网指标
__________________________
网络或google搜“扬搜”,然后在导航条上选“财经”
(这里我只要贴网址,就发不出,上黑名单了)
G. 求通达信k线选股公式
OK:REF(COUNT(C<O,3)=3,1) AND C>O AND C>REF(O,1);
{直接粘贴到预警公式里,就可了 }
H. VOL相关问题
一正量指标:
VOL成交量,配合K线图,若当日收市价较前一日收市价上涨,以空心柱表示;反之以实心柱表示。
二、负量指标:
NVI(Negative Volume Index),与正量指标一样是依照成交量的变化与股价的涨跌所算出的一个指标, 当NVI向上表示弱势. 本指标可设定一条平均线。它可指示“醒目资金”在大众未找到市场方向时已经入市,这些资金可能是内幕人士或投资大户的,研究负量指标走势,对后市有一定指导作用。
算法及公式:如果今天成交量比昨日小 ,NVI = 前一日NVI + 100 * 涨跌幅 ,
否则,NVI = 前一天NVI ;
应用原则:
1. 当NVI指标向下穿越其平均线时,是买入信号
2. 当NVI指标向上穿越其平均线时,是卖出信号
I. 公式里时间周期的确认确定
Hm:=cross(diff,dea),linethick;
lm:=cross(dea,diff),linethick;
Dayh:=BARSLAST(hm),linethick;//金叉到现在的天数
dayl:=BARSLAST(lm),linethick;
上面是我在算macd金叉死天数的方法,供你参考,可能不是想要的。
tfilt的函数具体用法我也不是了解(我只用飞狐),下面是个tdx公式,用tfilt应该方法你参考一下,你对公式应该有基础!
A:=CURRBARSCOUNT;
A1:=DAY!=REF(DAY,1);
A2:=BARSLAST(A1)+1;
A3:=MA(C,A2);
A4:=SUM(AMO,A2)/SUM(VOL,A2)/100;
A5:=IF(CAPITAL>0,A4,A3);
均价线:=IF(A<=CONST(A2),A5,DRAWNULL);
分钟有效周期:=IF(PERIOD=2,15,IF(PERIOD=3,30,IF(PERIOD=4,60,IF(PERIOD=5,240,DRAWNULL))));
分时价:=TFILT(CLOSE,CURRBARSCOUNT,00,CURRBARSCOUNT,00);
分时判断:=IF(分时价=DRAWNULL,1,IF(分钟有效周期=DRAWNULL,DRAWNULL,1));
{-----------------------------由MACD定位顶底-------------------------------}
DIFF:=EMA(CLOSE,12)-EMA(CLOSE,26);
DEA:=EMA(DIFF,9);
MACD:=2*(DIFF-DEA);
KX:=BARSSINCE(CLOSE);{←首次开盘价距金的天数}
HHN:=CONST(HHV(DIFF,KX));
HLN:=CONST(LLV(DEA,KX));
RC1:=CONST((HHN+HLN)/2);
SS:=((HHN-HLN)/200);
MACD底部:=(-100*SS+RC1)+-(-100*SS+RC1),COLOR669999;
MACD顶部:=(100*SS+RC1)+-(-100*SS+RC1),COLORFF0033;
MACD中轴:=0+-(-100*SS+RC1);
DIFF修正:=DIFF+-(-100*SS+RC1),COLOR008080;
DEA修正:=DEA+-(-100*SS+RC1),COLOR00FF00;
MACD修正:=2*(DIFF修正-DEA修正)+MACD中轴,COLOR0000BB,NODRAW;
MACD超跌:=CONST(LLV(MACD修正,KX));
MACD超跌线:=IF(MACD超跌<MACD底部,MACD超跌,MACD底部);
{----------------------利用MACD趋势进行精确顶底判断------------------------}
顶部:=MACD顶部+-MACD超跌线;
天际:=顶部*0.809;
中轴:=MACD中轴+-MACD超跌线;
海面:=顶部*0.191;
底部:=MACD底部;
{------------------------传统KDJ指标结合MACD优化---------------------------}
RSVA:=(CLOSE-LLV(LOW,21))/(HHV(HIGH,21)-LLV(LOW,21))*顶部;{采用21日月线优化}
K:SMA(RSVA,3,1),COLORFFFFFF,NODRAW;
D:SMA(K,3,1),COLOR00FFFF,NODRAW;
原J值参数:=3*K-2*D;
JD:=IF(原J值参数<底部,底部,原J值参数);{J值底部钝化处理}
J:IF(JD>顶部,顶部,JD),COLORFF00FF,NODRAW;{底部钝化处理后再进行顶部钝化处理}
{---------------------------MACD多空量能判断-------------------------------}
MACD多头:DIFF修正+-MACD超跌线,COLOR339999;
空头:DEA修正+-MACD超跌线,COLOR00FF00;
量能柱:2*(MACD多头-空头)+中轴,COLOR0000BB,NODRAW;
超前DEA:=(EMA(MACD多头,7));
超前MACD:=2*(MACD多头-超前DEA)+中轴;
{-----------------------------------大盘动向-------------------------------}
VAR1大盘:=LLV(LOW,13);
VAR2大盘:=HHV(HIGH,13);
VAR3大盘:=(SMA((CLOSE-VAR1大盘)/(VAR2大盘-VAR1大盘)*顶部,5,1))-顶部/2;
VAR4大盘:=SMA((VAR2大盘-CLOSE)/(VAR2大盘-VAR1大盘)*顶部,5,1)-顶部/2;
大盘散户:=IF(VAR4大盘<底部,底部,VAR4大盘),COLOR408000;
大盘主力:=IF(VAR3大盘<底部,底部,VAR3大盘),COLOR330088;
{---------------------------------密集成本突破-----------------------------}
最高获利参数:=顶部/100;
VAR1C:=(COST(89)-COST(11))*最高获利参数;
VAR2C:=(COST(99.9)-COST(1))*最高获利参数;
单峰:=((1-VAR1C/VAR2C))*顶部;
低密:=((COST(90)-COST(60))/VAR2C)*顶部;
高密:=((COST(40)-COST(1))/VAR2C)*顶部;
赢利:= (SMA(WINNER(AMOUNT/VOL/99),2,1))*顶部;
活跃度:顶部-顶部/(1+EXPMA(HSL,21)),COLOR774455;{←CYF公众追涨热情指标}
70%成本集中度:=IF(VAR1C>顶部,顶部,VAR1C),COLORFFFFFF;
90%成本集中度:=IF(VAR2C>顶部,顶部,VAR2C),COLORFF0000;
套牢筹码上升:=IF((单峰-赢利)>底部,(单峰-赢利),底部);
个股散户:=IF(套牢筹码上升>顶部,顶部,套牢筹码上升),COLOR408000;
散户:IF(个股散户=DRAWNULL,DRAWNULL,个股散户),COLOR408000;
获利筹码上升:=IF((赢利-单峰)>底部,(赢利-单峰),底部);
个股主力:=IF(获利筹码上升>顶部,顶部,获利筹码上升),COLOR330088;
主力:IF(个股主力=DRAWNULL,DRAWNULL,个股主力),COLOR330088;
{--------------------换手率,五日换手率辅助判断个股活跃度-------------------}
换手:SUM(VOL,1)/CAPITAL*100,COLOR666666,NODRAW;
⑤日换:SUM(VOL,5)/CAPITAL*100,COLOR999999,NODRAW;
{----------------------密集成本突破指标筹码峰画线--------------------------}
金色背景修边1:STICKLINE(C>0 AND CURRBARSCOUNT>=2,顶部,底部,3.05,0),COLOR003333;
金色背景修边2:STICKLINE(C>0 AND CURRBARSCOUNT>=2,顶部,中轴,3.05,0),COLOR003333;
金色背景补充:DRAWBAND(顶部,RGB(51,51,0),中轴,RGB(51,51,0));
金色背景:DRAWBAND(顶部,RGB(51,51,0),底部,RGB(128,128,128));
追涨热度峰紫色:DRAWBAND(活跃度,RGB(66,52,81),底部,RGB(204,0,0));
高密峰墨蓝色:=DRAWBAND(高密,RGB(0,0,51),底部,RGB(0,0,255));
低密峰纯蓝色:=DRAWBAND(低密,RGB(0,0,102),底部,RGB(0,0,255));
90%成本峰:DRAWBAND(90%成本集中度,RGB(0,0,153),底部,RGB(0,0,153));
70%成本峰:DRAWBAND(70%成本集中度,RGB(0,128,0),底部,RGB(255,255,255));
散户峰绿色:DRAWBAND(散户,RGB(0,64,0),底部,RGB(204,0,0));
主力峰红色:DRAWBAND(主力,RGB(102,26,51),底部,RGB(0,0,255));
MACD多空趋势:DRAWBAND(MACD多头,RGB(204,51,51),空头,RGB(0,179,0));
MACD多头重画:DRAWBAND(MACD多头,RGB(153,153,51),MACD多头,RGB(153,153,51));
MACD空头重画:DRAWBAND(空头,RGB(0,204,0),空头,RGB(0,204,0));
{--------创幻论坛'131488’会员提供的通达信■新宝塔线■-----原码-----------}
VAR1:=CLOSE>REF(CLOSE,1) AND CLOSE>REF(CLOSE,2);
VAR2:=REF(VAR1,1) AND CLOSE<=REF(CLOSE,1) AND CLOSE>=REF(CLOSE,2);
VAR3:=REF(VAR2,1) AND CLOSE>=REF(CLOSE,1) AND CLOSE<=REF(CLOSE,2);
VAR4:=REF(VAR3,1) AND CLOSE<=REF(CLOSE,1) AND CLOSE>=REF(CLOSE,2);
VAR5:=REF(VAR4,1) AND CLOSE>=REF(CLOSE,1) AND CLOSE<=REF(CLOSE,2);
VAR6:=REF(VAR5,1) AND CLOSE<=REF(CLOSE,1) AND CLOSE>=REF(CLOSE,2);
VAR7:=REF(VAR6,1) AND CLOSE>=REF(CLOSE,1) AND CLOSE<=REF(CLOSE,2);
VAR8:=REF(VAR7,1) AND CLOSE<=REF(CLOSE,1) AND CLOSE>=REF(CLOSE,2);
VAR9:=REF(VAR8,1) AND CLOSE>=REF(CLOSE,1) AND CLOSE<=REF(CLOSE,2);
VARD:=CLOSE<REF(CLOSE,1) AND CLOSE<REF(CLOSE,2);
VARE:=REF(VARD,1) AND CLOSE>=REF(CLOSE,1) AND CLOSE<=REF(CLOSE,2);
VARF:=REF(VARE,1) AND CLOSE<=REF(CLOSE,1) AND CLOSE>=REF(CLOSE,2);
VAR10:=REF(VARF,1) AND CLOSE>=REF(CLOSE,1) AND CLOSE<=REF(CLOSE,2);
VAR11:=REF(VAR10,1) AND CLOSE<=REF(CLOSE,1) AND CLOSE>=REF(CLOSE,2);
VAR12:=REF(VAR11,1) AND CLOSE>=REF(CLOSE,1) AND CLOSE<=REF(CLOSE,2);
VAR13:=REF(VAR12,1) AND CLOSE<=REF(CLOSE,1) AND CLOSE>=REF(CLOSE,2);
VAR14:=REF(VAR13,1) AND CLOSE>=REF(CLOSE,1) AND CLOSE<=REF(CLOSE,2);
VAR15:=REF(VAR14,1) AND CLOSE<=REF(CLOSE,1) AND CLOSE>=REF(CLOSE,2);
VAR16:=REF(VAR15,1) AND CLOSE>=REF(CLOSE,1) AND CLOSE<=REF(CLOSE,2);
VAR17:=REF(VAR16,1) AND CLOSE<=REF(CLOSE,1) AND CLOSE>=REF(CLOSE,2);
VAR18:=REF(VAR17,1) AND CLOSE>=REF(CLOSE,1) AND CLOSE<=REF(CLOSE,2);
三平底翻金:=(REF(VARD OR VARE OR VARF OR VAR10 OR VAR11 OR VAR12 OR VAR13 OR VAR14 OR VAR15 OR VAR16 OR VAR17 OR VAR18,1))
AND VAR1;
主力启动线:=MA(V,5),COLORFFFFFF;
主力洗盘线:=MA(V,35),COLOR00FFFF;
资金异动线:=MA(V,135),COLORFF0000;
{----------------------------买卖参考--------------------------------------}
出击:=(CROSS(主力启动线,资金异动线) OR ((主力洗盘线 > 资金异动线) AND CROSS(主力启动线,主力洗盘线))),COLORYELLOW;
启动:=(主力启动线>REF(主力启动线,1) AND (CROSS(VOL,主力启动线) AND (REF(VOL,1)<REF(资金异动线,1) OR REF(VOL,2)<REF(资金异动线,2)))),COLOR45AAEE;
成立:=三平底翻金 AND (出击 OR 启动);
买入提示:=IF(成立=1,海面*0.5,0) AND 分时判断=1;
{------------------------顶部线,天际线,海面线,底部线重画-------------------}
顶部线:DRAWBAND(顶部,RGB(51,0,255),顶部,RGB(51,0,255));
天际线:DRAWBAND(天际,RGB(128,64,64),天际,RGB(128,64,64));
海面线:DRAWBAND(海面,RGB(0,153,153),海面,RGB(0,153,153));
底部线:DRAWBAND(0,RGB(153,153,102),买入提示,RGB(153,153,102));
{------------------------超前MACD多空量能柱--------------------------------}
超前MACD红柱1:STICKLINE(超前MACD>=中轴,超前MACD,中轴,1.50,0),COLOR226688;
超前MACD红柱2:STICKLINE(超前MACD>=中轴,超前MACD,中轴,0.95,0),COLOR4488BB;
超前MACD红柱3:STICKLINE(超前MACD>=中轴,超前MACD,中轴,0.31,0),COLOR55AADD;
超前MACD兰柱1:STICKLINE(超前MACD<=中轴,超前MACD,中轴,1.50,0),COLOR006600;
超前MACD兰柱2:STICKLINE(超前MACD<=中轴,超前MACD,中轴,0.95,0),COLOR007700;
超前MACD兰柱3:STICKLINE(超前MACD<=中轴,超前MACD,中轴,0.31,0),COLOR008800;
{--------------------------MACD多空量能柱----------------------------------}
MACD红柱1:STICKLINE(量能柱>=中轴,量能柱,中轴,1.5,0),COLOR000077;
MACD红柱2:STICKLINE(量能柱>=中轴,量能柱,中轴,1.1,0),COLOR000088;
MACD红柱3:STICKLINE(量能柱>=中轴,量能柱,中轴,0.6,0),COLOR000099;
MACD红柱4:STICKLINE(量能柱>=中轴,量能柱,中轴,0.15,0),COLOR0000AA;
MACD兰柱1:STICKLINE(量能柱<=中轴,量能柱,中轴,1.5,0),COLORAA6633;
MACD兰柱2:STICKLINE(量能柱<=中轴,量能柱,中轴,1.1,0),COLORBB7744;
MACD兰柱3:STICKLINE(量能柱<=中轴,量能柱,中轴,0.6,0),COLORCC8855;
MACD兰柱4:STICKLINE(量能柱<=中轴,量能柱,中轴,0.15,0),COLORDD9966;
{---------中轴线重画及顶部线,天际线,海面线,底部线,多空线文字说明-----------}
中轴线:DRAWBAND(中轴,RGB(128,128,255),中轴,RGB(128,128,255));
顶部线文字:DRAWTEXT(CURRBARSCOUNT=1,顶部*0.98,' 顶部线'),COLORFF0033;
天际线文字:DRAWTEXT(CURRBARSCOUNT=1,天际*0.98,' 天际线'),COLOR404080;
海面线文字:DRAWTEXT(CURRBARSCOUNT=1,海面,' 海面线'),COLOR999900;
底部线文字:DRAWTEXT(CURRBARSCOUNT=1,底部,' 底部线'),COLOR669999;
中轴线文字:DRAWTEXT(CURRBARSCOUNT=1,中轴,' 多空线'),COLORFF8080;
{-------------------------------传统KDJ指标线重画--------------------------}
D线重画:DRAWBAND(D,RGB(255,255,0),D*0.998,RGB(255,255,0));
K线重画:DRAWBAND(K,RGB(255,255,255),K,RGB(255,255,255));
J线重画:DRAWBAND(J,RGB(255,0,255),J,RGB(255,0,255));
J. 指标公式如何改写成选股条件公式
【一品抄底】,是个副图指标,既有线性输出信号,也有买点提示信号,输出类别众多,就不是一个单独的选股指标。如何修改、拆分出自己需要的【底部】选股信号,成为一个单独的选股指标呢?如果还需要将【深坑】的信号,也单独设置为选股指标,又该如何修改呢?在此先当做一个问题吧,继续看了后面(二)、(三)小节的引路,相信你自己来就行了!
{一品抄底----创幻论坛一品茶缘编写,通用副图指标}
TYP := (HIGH + LOW + CLOSE)/3;
CCI:=(TYP-MA(TYP,14))/(0.015*AVEDEV(TYP,14));
A:=REF(C,1);
RSI:=SMA(MAX(C-A,0),6,1)/SMA(ABS(C-A),6,1)*100;
A1:=(C/MA(C,5)-1)*100<-10;
A2:=(C/MA(C,13)-1)*100<-10;
A3:=(C/MA(C,34)-1)*100<-15;
A4:=RSI<18;
A5:=CCI<-120;
A6:=COUNT(ABS(C/REF(C,1)-1)*100>=6,30)>=1;
底部:A1 AND A2 AND A3 AND A4 AND A5 AND A6,COLOR00FFFF,LINETHICK2;
CDSJ:=BARSLAST(底部);
ZF:=(C/REF(C,1)-1)*100;
深坑:IF(BETWEEN(CDSJ,0,5) AND L<=REF(C,CDSJ) AND ZF<=-5,-0.5,0),COLORFF0000,LINETHICK2;
机会:IF(CDSJ<=7 AND L<=REF(C,CDSJ),0.5,0),COLOR00FF00;
寻找选股信号的来源
所谓选股信号,多数都是属于将已有的指标公式中具有买点类的信号特征“剥离”出来。那么,在指标中该保留哪些有用的源码,删除哪些无关的源码呢?寻找选股信号的来源,就是最主要的过程。
寻找选股信号来源的方法,一般都是遵循从后往前寻找的原则。
具体步骤是:先找到发出指标信号的那行代码,然后查看该行代码中的所有条件,需要用到上面哪些源码,再从后往前一一对应寻找出来;而其他无关的条件、修饰符号源码,均可删除。
举例3:(本例子参考大庆老杨先生帖子,略有改动)
{股市马经----副图指标,源码来自网络}
A1:3*SMA((C-LLV(L,55))/(HHV(H,55)-LLV(L,55))*100,5,1)-2*SMA((C-LLV(L,55))/(HHV(H,55)-LLV(L,55))*100,5,1);
黑马线:EMA(A1,5),LINETHICK2,COLOR6600FF;
A2:=(黑马线-REF(黑马线,1))/REF(黑马线,1)*100;
A3:=EMA(C,5);
A4:=((C-LLV(L,21))/(HHV(H,21)-LLV(L,21)))*100;
趋势线:(MA(3*SMA(A4,6,1)-2*SMA(SMA(A4,5,1),5,1),2)),LINETHICK2,coloryellow;
A5:=(HHV(H,60)-C)/(HHV(H,60)-LLV(L,60))*100;
DRAWTEXT(FILTER(REF(黑马线,1)>90 AND A2<0,7),黑马线,'跑'),COLOR00FF00;
DRAWTEXT(CROSS(A1,黑马线)AND 黑马线<A5,黑马线,'黑马');
DRAWTEXT(CROSS(黑马线,A5)AND 趋势线<80,黑马线,'追涨');
DRAWTEXT(CROSS(趋势线,0)AND 黑马线<40,5,'大黑马');
底部:(A2<-10 AND A2>REF(A2,1))*25,colorred;
DRAWICON(底部 AND A3>REF(A3,1),25,4);
机会来临:REF(IF((MA(C,5)-C)/C>0.04 AND (MA(C,10)-MA(C,5))/MA(C,5)>0.04,30,0),1),COLORF00FF0;
大势已去:IF(CROSS(黑马线,A1)AND 黑马线>70 AND 趋势线>80,90,100),COLORFF0000;
公式中涉及“买”的信号有黑马、追涨、大黑马、底部和机会来临五个明显的,另外还有一个画图标信号。
假如我们提取其中的【机会来临】,仔细分析后,就是一句话:
机会来临:REF(IF((MA(C,5)-C)/C>0.04 AND (MA(C,10)-MA(C,5))/MA(C,5)>0.04,30,0),1);
这个可看作简单提取。
如果提取【大黑马】的话,从后向前推,涉及趋势线和黑马线两个定义,这部分都有用:
A1:3*SMA((C-LLV(L,55))/(HHV(H,55)-LLV(L,55))*100,5,1)-2*SMA((C-LLV(L,55))/(HHV(H,55)-LLV(L,55))*100,5,1);
黑马线:EMA(A1,5),LINETHICK2,COLOR6600FF;
A4:=((C-LLV(L,21))/(HHV(H,21)-LLV(L,21)))*100;
趋势线:(MA(3*SMA(A4,6,1)-2*SMA(SMA(A4,5,1),5,1),2)),LINETHICK2,coloryellow;
DRAWTEXT(CROSS(趋势线,0) AND 黑马线<40,5,'大黑马');
(三)修改选股指标的方法
根据以上选股公式的特征,结合寻找选股信号来源的方法,自己动手修改选股信号,应该就没有太大的难度了!
举例4:继续承接上面(二)的例子。
修改步骤:
①先将线性输出的A1、黑马线、A4、趋势线均限制输出,方法很简单,就是在他们的冒号后面直接加上等号=;
②再删去修饰符LINETHICK2,COLOR6600FF:
③将本来是文字输出的“黑马线”修改成信号输出;先将“黑马线”三个字移动到最前面,并加上冒号:;然后保留符合黑马线的限制条件CROSS(趋势线,0) AND 黑马线<40;同时删除其余无关的代码,包括文字输出函数DRAWTEXT、位置、括号()等。
修改成选股指标后的源码如下:
A1:=3*SMA((C-LLV(L,55))/(HHV(H,55)-LLV(L,55))*100,5,1)-2*SMA((C-LLV(L,55))/(HHV(H,55)-LLV(L,55))*100,5,1);
黑马线:=EMA(A1,5);
A4:=((C-LLV(L,21))/(HHV(H,21)-LLV(L,21)))*100;
趋势线:=(MA(3*SMA(A4,6,1)-2*SMA(SMA(A4,5,1),5,1),2));
大黑马:CROSS(趋势线,0) AND 黑马线<40;
举例5:
下面附图指标【大三浪】中,如何选出出现“买”字提示信号的选股指标?
{大三浪----创幻论坛一品茶缘编写,通用副图指标}
{大三浪指标使用说明:
均线粘合且多头,长期未涨庄吸筹;
目标锁定先跟踪,出击买入等丰收!}
{N:30,120,65;}
MA5:=MA(CLOSE,5);
MA21:=MA(CLOSE,21);
MA65:=MA(CLOSE,N);
多头:=COUNT(MA21>MA65,10)=10;
GX:=MAX(MA5,MAX(MA21,MA65));
DX:=MIN(MA5,MIN(MA21,MA65));
粘合:=ABS(GX/DX-1)*100<=15;
多头粘合:IF(多头 AND 粘合,1,0),COLORFF00FF,POINTDOT,LINETHICK0;
DIFF:=EMA(CLOSE,12) - EMA(CLOSE,26);
DEA:=EMA(DIFF,9);
MACD:=2*(DIFF-DEA);
庄股:COUNT(MACD<0,10)=10,COLORFFFF00,POINTDOT,LINETHICK0;
目标:IF(多头 AND 粘合 AND 庄股,5,0),COLORFFFFFF,LINETHICK2;
跟踪:IF(目标,BARSLAST(CROSS(目标,0))+1,0),COLOR00FF00,POINTDOT,LINETHICK2;
出击:IF(CROSS(0.1,目标) AND CROSS(MACD,0),8,0),COLOR00FFFF,LINETHICK2;
MJSJ:=BARSLAST(出击>0);
涨幅:IF(MJSJ<=120,(C/REF(C,MJSJ)-1)*100,0),COLOR0000FF,POINTDOT,LINETHICK0;
日涨:IF(MJSJ<=120,涨幅/MJSJ,0),COLORFFFFFF,POINTDOT,LINETHICK0;
TPX:=MIN(MA65*1.15,MA21*1.13);
突破:IF(CROSS(C,TPX) AND 粘合 AND MA65>REF(MA65,1),10,0),COLOR0000FF,LINETHICK2;
{以下设置副图显示方式}
STICKLINE(多头粘合,0,1,8,0),COLORFF00FF;
STICKLINE(庄股,0,MACD*10,8,0),COLORFFFF00;
DRAWTEXT(出击=8,10,'★买'),COLOR00FFFF;
VERTLINE(CROSS(涨幅,20) AND COUNT(CROSS(涨幅,20),MJSJ)=1,2),COLOR0000FF; 根据选股指标的步骤,一步一步来:
①首先找到出现“★买”提示的一行代码,发现她其实就是“出击”的信号;
②从后往前,找到“出击”信号的条件,发现他与“目标”、MACD有关;
再次往前寻找,又发现“目标”信号的条件,与“多头”、“粘合”、“庄股”三个条件有关,由此,保留相关条件代码,其余删除,如下:
{N:30,120,65;}
MA5:=MA(CLOSE,5);
MA21:=MA(CLOSE,21);
MA65:=MA(CLOSE,N);
多头:=COUNT(MA21>MA65,10)=10;
GX:=MAX(MA5,MAX(MA21,MA65));
DX:=MIN(MA5,MIN(MA21,MA65));
粘合:=ABS(GX/DX-1)*100<=15;
DIFF:=EMA(CLOSE,12) - EMA(CLOSE,26);
DEA:=EMA(DIFF,9);
MACD:=2*(DIFF-DEA);
庄股:COUNT(MACD<0,10)=10,COLORFFFF00,POINTDOT,LINETHICK0;
目标:IF(多头 AND 粘合 AND 庄股,5,0),COLORFFFFFF,LINETHICK2;
出击:IF(CROSS(0.1,目标) AND CROSS(MACD,0),8,0),COLOR00FFFF,LINETHICK2;
③限制输出数量,只保留“出击”信号的输出,其他的输出信号均加上等号=加以限制输出;
④删除多余的修饰符号,如:COLORFFFF00,POINTDOT,LINETHICK0等。
⑤IF格式也可简化,只保留需要的条件,输出信号自动为1。“出击”两字也可修改为“买”。
修改完最后保留的源码如下:
{大三浪----选股指标}
{N:30,120,65;}
MA5:=MA(CLOSE,5);
MA21:=MA(CLOSE,21);
MA65:=MA(CLOSE,N);
多头:=COUNT(MA21>MA65,10)=10;
GX:=MAX(MA5,MAX(MA21,MA65));
DX:=MIN(MA5,MIN(MA21,MA65));
粘合:=ABS(GX/DX-1)*100<=15;
DIFF:=EMA(CLOSE,12) - EMA(CLOSE,26);
DEA:=EMA(DIFF,9);
MACD:=2*(DIFF-DEA);
庄股:=COUNT(MACD<0,10)=10;
目标:=IF(多头 AND 粘合 AND 庄股,5,0);
买:CROSS(0.1,目标) AND CROSS(MACD,0); 导入选股指标的途径
①修改完后的选股指标源码,想做成选股指标,并非放在指标系统之下的【技术指标】分类,一般是放入【条件选股】分类;便于设置预警、自动选股。
②还可将选股指标加入交易系统中,但需要注意的是:输出信号必须为英文单词的买入ENTERLONG、卖出EXITLONG信号。在应用时,飞狐软件输入该交易系统指标名称,即可在主图自动显示买卖信号的提示。
源码如下:
ENTERLONG:CROSS(MA(C,3),MA(C,8));----表示输出多头买入信号。
EXITLONG:CROSS(MA(C,8),MA(C,3));----表示输出空头卖出信号。