您现在的位置:程序化交易>> 股票公式>> 其他>> 其他软件公式>>正文内容

MACD+KDJ综合指标 公式 源码[其他软件公式]

指标代码分析:

 

根据给出的分析指标,可以得出以下指标思路及操作建议:
 
1. MACD指标:观察MACD线与零轴的关系。当MACD线位于零轴以上并且上涨时,表示多头趋势,建议考虑买入;当MACD线位于零轴以下并且下跌时,表示空头趋势,建议考虑卖出。
 
2. KDJ指标:观察K线和D线的交叉情况。当K线由下向上穿过D线并且K线值小于80时,表示买入信号;当K线由上向下穿过D线并且K线值大于20时,表示卖出信号。
 
3. RSI指标:观察RSI1和RSI2的交叉情况。当RSI1由下向上穿过RSI2并且RSI1值小于80时,表示买入信号;当RSI1由上向下穿过RSI2并且RSI1值大于20时,表示卖出信号。
 
4. 多方趋势和空方趋势:观察多方趋势和空方趋势的数值。当多方趋势大于空方趋势并且多方趋势超过78时,表示多头市场,建议考虑买入;当空方趋势大于多方趋势并且空方趋势低于14时,表示空头市场,建议考虑卖出。
 
5. 最佳买入指标:观察最佳买入指标的数值。当最佳买入指标由负数变为正数时,表示买入信号。
 
总结来说,根据MACD、KDJ、RSI等指标的交叉和数值变化情况来判断市场的多空趋势,以及选择买入和卖出时机。建议在多头趋势下买入股票,在空头趋势下卖出或持币观望。同时,可以结合最佳买入指标进行参考,选择适合的买入时机。注意,以上仅为指标分析,具体操作还需结合个人风险承受能力、资金实力和市场行情等因素进行综合考虑。

 

源码:

 

DIFZ:=EMA(C,12)-EMA(C,26);
DEAZ:=EMA(DIFZ,9);
MACDZ:=8*(DIFZ-DEAZ);
RSV:=((CLOSE-LLV(LOW,21))/(HHV(HIGH,21)-LLV(LOW,21)))*247.2-123.6;
SQX:=(C-MA(CLOSE,13))*10;
DIF:=EMA(MA(SQX,7),1);
DEA:=EMA(DIF,7);
MACD:=(DIF-DEA)*2;
STICKLINE(MACD>0ANDMACD>REF(MACD,1),MACD,0,0.1,0),COLORRED;
STICKLINE(MACD>0ANDMACD<REF(MACD,1),MACD,0,0.1,0),COLORWHITE;
STICKLINE(MACD<0ANDMACD<REF(MACD,1),MACD,0,0.1,0),COLORBLUE;
STICKLINE(MACD<0ANDMACD>REF(MACD,1),MACD,0,0.1,0),COLORBROWN;
K:SMA(SMA( RSV,3,1),3,1),COLORWHITE;
D:MA(EMA(K,3),3),COLORYELLOW;
J:3*K-2*D,COLORMAGENTA;
A11:=BARSLAST(REF(CROSS(DIF,DEA),1));
B1:=REF(C,A11+1)>C AND REF(DIF,A11+1)<DIF AND CROSS(DIF,DEA);
A12:=BARSLAST(REF(CROSS("KDJ.K","KDJ.D"),1));
B2:=REF(C,A12+1)>C AND REF("KDJ.K",A12+1)<"KDJ.K" AND CROSS("KDJ.K","KDJ.D");
A13:=BARSLAST(REF(CROSS("RSI.RSI1","RSI.RSI2"),1));
B3:=REF(C,A13+1)>C AND REF("RSI.RSI1",A13+1)<"RSI.RSI1"AND CROSS("RSI.RSI1","RSI.RSI2");
C1:=BARSLAST(REF(CROSS(DEA,DIF),1));
D1:=REF(C,C1+1)<C AND REF(DIF,C1+1)>DIF AND CROSS(DEA,DIF);
C2:=BARSLAST(REF(CROSS("KDJ.D","KDJ.K"),1));
D2:=REF(C,C2+1)<C AND REF("KDJ.K",C2+1)>"KDJ.K" AND CROSS("KDJ.D","KDJ.K");
C3:=BARSLAST(REF(CROSS("RSI.RSI2","RSI.RSI1"),1));
D3:=REF(C,C3+1)<C AND REF("RSI.RSI1",C3+1)>"RSI.RSI1" AND CROSS("RSI.RSI2","RSI.RSI1");
MACD底背:IF(B1>0,50,0),LINETHICK2,COLORRED;
DRAWTEXT(B1>0,50,'M底背'),COLORRED;
KDJ底背:IF(B2>0,65,0),LINETHICK2,COLORFF00FF;
DRAWTEXT(B2>0,65,'K底背'),COLORFF00FF;
RSI底背:IF(B3>0,80,0),LINETHICK2,COLORYELLOW;
DRAWTEXT(B3>0,80,'R底背'),COLORYELLOW;
MACD顶背:IF(D1>0,-50,0),LINETHICK2,COLOR00FF00;
DRAWTEXT(D1>0,-50,'M顶背'),COLOR00FF00;
KDJ顶背:IF(D2>0,-65,0),LINETHICK2,COLORFFCC66;
DRAWTEXT(D2>0,-65,'K顶背'),COLORFFCC66;
RSI顶背:IF(D3>0,-80,0),LINETHICK2,COLORWHITE;
DRAWTEXT(D3>0,-80,'R顶背'),COLORWHITE;
DRAWICON((CROSS(K,D)
AND K<0 ),REF(K,1),11);
DRAWICON((CROSS(D,K) AND K>0
),D*1.05,12);
DRAWICON(J<(REF(J,1))AND K>(REF(K,1)) AND D>(REF(D,1)
AND J>0),REF(J,1),2);
DRAWICON(J>REF(J,1) AND K<REF(K,1) AND
D<REF(D,1) AND J<0,REF(J,1),1);
DRAWICON(MACD<REF(MACD,1) AND
REF(MACD,1)>REF(MACD,2) AND
MACD>0,MACD,2);
DRAWICON(MACD>REF(MACD,1) AND
REF(MACD,1)<REF(MACD,2) AND MACD<=0,MACD,1);
多方趋势:((7)*(SMA(((CLOSE-LLV (LOW,27))/(HHV(HIGH,27)-LLV(LOW,27)))*(30),4,1))-(3)*(SMA(SMA(((CLOSE-LLV(LOW,27))/(HHV(HIGH,27)-LLV(LOW,27)))*(30),4,1),3,1))-SMA(SMA(SMA(((CLOSE-LLV(LOW,27))/(HHV(HIGH,27)-LLV(LOW,27)))*(30),4,1),3,1),2,1)),COLOR0000FF;
空方趋势:(EMA(MA(多方趋势,5),7)),COLORF0F000;
STICKLINE((多方趋势>78) AND (多方趋势>=空方趋势),78,多方趋势,5,1),COLOR00FF00;
STICKLINE((空方趋势<=多方趋势),空方趋势,多方趋势,3,0),COLOR0000FF;
STICKLINE((空方趋势>多方趋势),多方趋势,空方趋势,3,0),COLORF0F000;
STICKLINE((空方趋势<14) AND (空方趋势>多方趋势),多方趋势,20,3,0),COLOR00FFFF;
TJ:=FILTER((空方趋势<14) AND (空方趋势>多方趋势),6);
DRAWTEXT(TJ,40,'低吸'),COLORFFFFFF;
斋主:(空方趋势<12) AND (空方趋势<=多方趋势),COLOR00FFFF;
选金股:CROSS(多方趋势,空方趋势) AND (空方趋势<22);
{E:=CROSS(83,RSI);
STICKLINE( E,75,85,4,0),COLOR00FF00;
DRAWTEXT(E,72,' 逃顶');}
LC:=REF(CLOSE,1);
RSI5:=((SMA(MAX((CLOSE - LC),0),5,1) / SMA(ABS((CLOSE - LC)),5,1)) * 100);
TR1:=SUM(MAX(MAX((HIGH - LOW),ABS((HIGH - REF(CLOSE,1)))),ABS((LOW - REF(CLOSE,1)))),10);
HD:=(HIGH - REF(HIGH,1));
LD:=(REF(LOW,1) - LOW);
DMP:=SUM(IF(((HD > 0) AND (HD > LD)),HD,0),10);
DMM:=SUM(IF(((LD > 0) AND (LD > HD)),LD,0),10);
PDI:=((DMP * 100) / TR1);
MDI:=((DMM * 100) / TR1);
ADX:=MA(((ABS((MDI - PDI)) / (MDI + PDI)) * 100),5);
AV:=(RSI5 + ADX);
DXR:=(((ADX + REF(ADX,5)) / 2) + RSI5);
WR10:=((100 * (HHV(HIGH,10) - CLOSE)) / (HHV(HIGH,10) - LLV(LOW,10)));
NEWVOL:=(RSI5 - WR10);
最佳买入:=(AV + NEWVOL);
最佳买入选股:IF(CROSS(最佳买入,0),61,0),STICK,COLORRED,LINETHICK4;
DRAWTEXT(CROSS(最佳买入,0),62,'最佳买入'),COLOR00FFFF;
AA:=(MA(C,1)+MA(C,3)+MA(C,5)+MA(C,7)+MA(C,9))/5;
BB:=(MA(C,2)+MA(C,4)+MA(C,6)+MA(C,8)+MA(C,10))/5;
CC:=EMA(AA,2);
DD:=EMA(BB,5);
TJ0:=CROSS(CC,DD);
上:=EMA(C,3);
中:=EMA(C,5);
下:=EMA(中,5);
TJ1:=CROSS(上,中);
TJ2:=上>REF(上,1);
X1:=(C+L+H)/3;
BB5:=ATAN(EMA(X1,5)-REF(EMA(X1,5),1))*3.1416*10;
EMA3:=EMA(C,3);
TJ3:=BB5>1 AND EMA(X1,5)>REF(EMA(X1,3),1);
STICKLINE(TJ1 AND TJ2AND TJ0 AND TJ3,0,20,4,0)COLOR009999;
STICKLINE(TJ1 AND TJ2AND TJ0 AND TJ3,0,35,3,0)COLOR00BBBB;
STICKLINE(TJ1 AND TJ2AND TJ0 AND TJ3,0,45,1.5,0)COLOR00DDDD;
STICKLINE(TJ1 AND TJ2AND TJ0 AND TJ3,0,50,0.6,0)COLOR00FFFF;
DRAWTEXT(TJ1 AND TJ2AND TJ0 AND TJ3,48,'斋主全仓'),COLORRED;
{斋主全仓:IF(CROSS('斋主全仓',0),0.9,0),STICK,COLORRED;}
DRAWTEXT(CROSS(多方趋势,空方趋势) AND (空方趋势<22),30,'金股'),COLOR00FFFF;
中间线:50,COLORFFFFFF,POINTDOT;
CXH11:=(CLOSE+HIGH+LOW)/3;
CXH2A1:=EMA(CXH11,10);
CXH3A:=REF(CXH2A1,1);
绿珠逃:IF(CXH2A1,0.1,0),COLORGREEN,LINETHICK9;
红珠买: IF(CXH2A1>CXH3A,0.1,0),COLORRED,LINETHICK9;
黄珠卖: IF(CXH2A1<CXH3A,0.1,0),COLOR00FFFF,LINETHICK9;{程序化交易 www.cxh99.com }

 

公式导入教程: 【通达信公式源码导入方法教程】 【同花顺公式源码导入方法教程】 【大智慧新一代公式源码导入方法教程

 

 

有思路,想编写各种指标公式,交易模型,选股公式,还原公式的朋友

可联系技术人员 QQ: 262069696  点击在线交流或微信:cxhjy888 进行 有偿收费 编写!(注:由于人数限制,QQ或微信请选择方便的一个联系我们就行,加好友时请简单备注下您的需求,否则无法通过。谢谢您!)

怎么收费,代编流程等详情请点击查阅!

(注:由于人数限制,QQ或微信请选择方便的一个联系我们就行,加好友时请简单备注下您的需求,否则无法通过。谢谢您!)

 


【字体: 】【打印文章】【查看评论

相关文章

    没有相关内容