分类
短线操盘

MACD和RSI指标的优化

——————————————————

tranzwalle/MyTTx

This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.

Use Git or checkout with SVN using the web URL.

Work fast with our official CLI. Learn more.

Launching GitHub MACD和RSI指标的优化 Desktop

If nothing happens, download GitHub Desktop and try again.

Launching GitHub Desktop

If nothing happens, download GitHub Desktop and MACD和RSI指标的优化 try again.

Launching Xcode

If nothing happens, download Xcode and try again.

Launching Visual Studio Code

Your codespace will open MACD和RSI指标的优化 once ready.

There was a problem preparing your codespace, please try again.MACD和RSI指标的优化

This branch is not ahead of the upstream mpquant:main.

No new commits yet. Enjoy your day!

Latest commit

Git stats

Files

Failed to load latest commit information.

README.md

MyTT (My麦语言 T通达信 T同花顺)

MyTT是您量化工具箱里的瑞士军刀,精炼而高效,它将通达信,同花顺,文华麦语言等指标公式indicators,最简移植到Python中,核心库单个文件,仅百行代码,实现和转换同花顺通达信所有常见指标MACD,RSI,BOLL,ATR,KDJ,CCI,PSY等,全部基于numpy和pandas的函数封装,简洁且高性能,能非常方便的应用在各自股票股市技术分析,股票自动程序化交易,数字货币BTC等量化等领域.Mini Python library with most stock market indicators.

通达信MACD结合RSI和KDJ主图指标公式

涨停:=IF(REF(C,1)*1.1-C STICKLINE(涨停,OPEN,CLOSE,4,2),COLORRED;
STICKLINE(涨停,OPEN,CLOSE,0.8,0),COLORYELLOW;
STICKLINE(涨停,H,L,0,0),COLORYELLOW;
ZT:=C/REF(C,1)>1.095;
STICKLINE(MA(CLOSE,5)>REF(MA(CLOSE,5),1) AND ZT,O,C,0.6,0),COLORYELLOW;
STICKLINE(MA(CLOSE,5) VAR6:=REF(C,1);
VAR7:=SMA(MAX(MACD和RSI指标的优化 C-VAR6,0),6,1)/SMA(ABS(C-VAR6),6,1)*100;
DRAWTEXT(CROSS(82,VAR7),H*1.02,'逃顶'),COLORYELLOW;

MA5:MA(C,5)COLORYELLOW; MACD和RSI指标的优化
MA10:MA(C,10)COLORGREEN,DOTLINE;
DIF:EMA(CLOSE,7) - EMA(CLOSE,19)NODRAW;
DEA:EMA(DIF,9)NODRAW;
MACD:2*(DIF-DEA),COLORSTICK,NODRAW;
NOTEXTDIF1:MA(C,20)+(MACD和RSI指标的优化 MACD.DIF)*3,COLORWHITE,NODRAW;
强:IF(NOTEXTDIF1*1.002>MA(NOTEXTDIF1,2),NOTEXTDIF1,DRAWNULL),COLORRED,LINETHICK3,NODRAW;
NOTEXTDEA1:MA(MACD和RSI指标的优化 C,20)+(MACD.DEA)*3,COLORYELLOW,NODRAW;
弱:IF(NOTEXTDEA1>MA(NOTEXTDEA1,MACD和RSI指标的优化 2),NOTEXTDEA1,DRAWNULL),COLORMAGENTA,LINETHICK1,NODRAW;
NOTEXTOZ:MA(C,20)COLORBLUE,DOTLINE;
NOTEXTMACD:=MA(C,20)+(MACD.MACD)*3;
DRAWICON(CROSS(NOTEXTDEA1,NOTEXTDIF1),NOTEXTDEA1*1.003,27);>
A:=REF(NOTEXTDIF1,1)REF(NOTEXTDIF1,1);
B:=REF(NOTEXTDIF1,1)>REF(NOTEXTDIF1,2) AND REF(NOTEXTDIF1,2)>REF(NOTEXTDIF1,MACD和RSI指标的优化 3) AND NOTEXTDIF1 DRAWICON(B,NOTEXTDEA1,2);>
STICKLINE(MACD>REF(MACD,1) AND MACD>0,NOTEXTOZ,NOTEXTMACD,0,-1),COLORRED;
STICKLINE(NOTEXTMACD>=NOTEXTOZ AND MACD>REF(MACD,1),NOTEXTOZ,NOTEXTMACD,0,-1),COLORRED;
STICKLINE(MACD0,NOTEXTOZ,NOTEXTMACD,0,-1),COLORYELLOW;
TC1:=IF(H=HHV(H,48),H,DRAWNULL);
TC2:=CONST(BARSLAST(TC1=H))+1;
UPPER:=CONST(IF(TC2=1,H,REF(H,TC2-1)));
BC1:=IF(L=LLV(L,48),L,DRAWNULL);
BC2:=CONST(BARSLAST(BC1=L))+1;
LOWER:=CONST(IF(BC2=1,L,REF(L,BC2-1)));
LP:=CURRBARSCOUNT HP:=CURRBARSCOUNT 底:=IF(LP,150,0),COLORMAGENTA;
DRAWICON(FILTER(底,10),MACD和RSI指标的优化 L*0.925,1);

STICKLINE(NOTEXTMACD STICKLINE(MACD>=REF(MACD,1) AND MACD <0,NOTEXTOZ,NOTEXTMACD,0,-1),COLORMAGENTA;
;

N:=9;
M1:=3;
M2:=3;
RSV:=(CLOSE-LLV(LOW,N))/(HHV(HIGH,N)-LLV(LOW,N))*100,NODRAW;
K:=SMA(RSV,M1,1),NODRAW;
D:=SMA(K,M2,1),NODRAW;
J:=3*K-2*D,NODRAW;
CJ_K:=MA(K,15),LINETHICK2,NODRAW;
CJ_D:=MA(D,15),LINETHICK2,NODRAW;
CJ_J:=MA(J,15),LINETHICK2,NODRAW;
DRAWICON(CROSS(CJ_K,CJ_D)&&CJ_D <30,L*0.92,11);
DRAWICON(CROSS(CJ_D,CJ_K)&&CJ_D>70,H*1.05,12);
DRAWICON(CROSS(CCI,-100),L*0.98,1);
DRAWICON(CROSS(CCI,0),L*0.98,1);
DRAWICON(CROSS(CCI,100),L*0.98,1);
DRAWICON(CROSS(MACD和RSI指标的优化 100,CCI),H*1.02,2);
;
PT1:=CONST(HHV(H,20))/1.2;
IF(CURRBARSCOUNT <=10,PT1,DRAWNULL),COLORGREEN;
DRAWTEXT(ISLASTBAR,PT1,'回马枪观测'),COLORWHITE;
PT2:=CONST(HHV(H,10))/1.2;
IF(CURRBARSCOUNT <=10,PT2,DRAWNULL),COLORGREEN;
DRAWTEXT(ISLASTBAR,PT2,'回马枪观测'),COLORWHITE;

如何理解 KDJ 和 MACD 等指标的使用?

及时晴 ​

下面我来演示下 kdj macd 两个指标的变换。

上图为『图一』

上图为『图二』

上图为『图三』

上图为『图四』(蓝色圆圈里面的是原始参数)





——————————————————

什么是MACD顶背离和底背离?

刘鹏程Sai.L ​

上证指数 日线级别 2010年10月

干货逻辑 ​

以上就是macd与均线系统的底层逻辑的大概讲解,但其实聪明的人会发现,就这样的解析,还是有一些无法自圆其说的地方,例如我们可以看到,一个连续的趋势里面,必然会有几次价格回撤,例如上涨趋势里面,总会经历几次小周期均线回调后又继续上涨,那么问题来了,我们该如何辨别这是趋势的翻转,还是仅仅是上涨过程的一次小回撤?——这才是此篇的重点,我们才辨别之前,首先要先理解为什么会又价格回撤,这期间到底发生了什么?接下来才是烧脑的部分。