導航:首頁 > 源碼編譯 > macd背離源碼

macd背離源碼

發布時間:2024-03-05 12:15:12

⑴ 求股票公式:macd背離選股公式

MACD底背離選股公式——通達信、同花順 {底背離,通達信版、同花順版}
DIFF:=EMA(CLOSE,12) - EMA(CLOSE,26);
DEA:=EMA(DIFF,9);
MACD:=2*(DIFF-DEA);
QZQ:=BARSLAST(REF(MACD,1)<0 ANDMACD>0);
QM:=LLVBARS(MACD,QZQ+20);
MQDZ:=IF(QM>QZQ,REF(MACD,QM),0);
XG1:=MACD<0 AND MACD>MQDZ
AND CLOSE=LLV(CLOSE,QZQ+20) ANDMQDZ<0;
XG:REF(XG1,1)=1 AND MACD>REF(MACD,1);

{雙底背離,通達信版、同花順版}
DIFF:=EMA(CLOSE,12) - EMA(CLOSE,26);
DEA:=EMA(DIFF,9);
MACD:=2*(DIFF-DEA);
QZQ:=BARSLAST(REF(MACD,1)<0 ANDMACD>0);
QM:=LLVBARS(MACD,QZQ+20);
MQDZ:=IF(QM>QZQ,REF(MACD,QM),0);
QF:=LLVBARS(DIFF,QZQ+20);
DQDZ:=IF(QF>QZQ,REF(DIFF,QF),0);

XG1:=MACD<0 AND MACD>MQDZ ANDDIFF<0 AND DIFF>DQDZ
AND CLOSE=LLV(CLOSE,QZQ+20) ANDMQDZ<0 AND DQDZ<0;
XG:REF(XG1,1)=1 AND MACD>REF(MACD,1);

註:底雙背離是指MACD(綠柱)和DIFF(黃白線)都底背離。

⑵ 求通達信15分鍾周期MACD底背離的選股公式

用日線的底歲首轎背離公乎肆式,選擇15分鍾周期就芹閉可以了。

下圖是macd底背離選股指標日線勝率回測截圖

⑶ 請高手編寫個通達信的簡單公式:MACD紅綠柱子背離

MACD頂底背離(同時包含KDJ背離,RSI背離)
公式如下:

DIFF:EMA(CLOSE,12) - EMA(CLOSE,26);
DEA:EMA(DIFF,9);
MACD:2*(DIFF-DEA),COLORSTICK;
A1:=BARSLAST(REF(CROSS(DIFF,DEA),1));
B1:=REF(C,A1+1)>C AND REF(DIFF,A1+1)<DIFF AND CROSS(DIFF,DEA);
A2:=BARSLAST(REF(CROSS("KDJ.K"(9,3,3),"KDJ.D"(9,3,3)),1));
B2:=REF(C,A2+1)>C AND REF("KDJ.K"(9,3,3),A2+1)<"KDJ.K"(9,3,3) AND CROSS("KDJ.K"(9,3,3),"KDJ.D"(9,3,3));
A3:=BARSLAST(REF(CROSS("RSI.RSI1"(6,12,24),"RSI.RSI2"(6,12,24)),1));
B3:=REF(C,A3+1)>C AND REF("RSI.RSI1"(6,12,24),A3+1)<"RSI.RSI1"(6,12,24) AND CROSS("RSI.RSI1"(6,12,24),"RSI.RSI2"(6,12,24));
C1:=BARSLAST(REF(CROSS(DEA,DIFF),1));
D1:=REF(C,C1+1)<C AND REF(DIFF,C1+1)>DIFF AND CROSS(DEA,DIFF);
C2:=BARSLAST(REF(CROSS("KDJ.D"(9,3,3),"KDJ.K"(9,3,3)),1));
D2:=REF(C,C2+1)<C AND REF("KDJ.K"(9,3,3),C2+1)>"KDJ.K"(9,3,3) AND CROSS("KDJ.D"(9,3,3),"KDJ.K"(9,3,3));
C3:=BARSLAST(REF(CROSS("RSI.RSI2"(6,12,24),"RSI.RSI1"(6,12,24)),1));
D3:=REF(C,C3+1)<C AND REF("RSI.RSI1"(6,12,24),C3+1)>"RSI.RSI1"(6,12,24) AND CROSS("RSI.RSI2"(6,12,24),"RSI.RSI1"(6,12,24));
MACD底背:IF(B1>0,-0.1,0),COLORRED,POINTDOT;
KDJ底背:IF(B2>0,-0.1,0),COLORFF00FF,POINTDOT;
RSI底背:IF(B3>0,-0.1,0),COLORYELLOW,POINTDOT;
MACD頂背:IF(D1>0,0.1,0),COLOR00FF00,POINTDOT;
KDJ頂背:IF(D2>0,0.1,0),COLORFFCC66,POINTDOT;
RSI頂背:IF(D3>0,0.1,0),COLORWHITE,POINTDOT;
STICKLINE(B1>0,-0.1,0,2,0),COLORRED;
STICKLINE(B2>0,-0.1,0,2,0),COLORFF00FF;
STICKLINE(B3>0,-0.1,0,2,0),COLORYELLOW;
STICKLINE(D1>0,0.1,0,2,0),COLOR00FF00;
STICKLINE(D2>0,0.1,0,2,0),COLORFFCC66;
STICKLINE(D3>0,0.1,0,2,0),COLORWHITE;

閱讀全文

與macd背離源碼相關的資料

熱點內容
插入單片機檢測不到埠 瀏覽:467
svn文件夾如何刪除 瀏覽:621
編譯過程和解析過程 瀏覽:819
德雲天團app如何參與活動 瀏覽:740
編譯系統的硬體原理 瀏覽:330
黑色玫瑰什麼時候出的伺服器 瀏覽:636
如何打開列印共享伺服器 瀏覽:866
手機熱點密碼的加密方式 瀏覽:328
貴州大數據伺服器閑置雲伺服器 瀏覽:527
文件夾加密微軟 瀏覽:383
蘋果突然提示無法驗證伺服器身份怎麼解決 瀏覽:988
調度命令發布的原則 瀏覽:679
dos提示不是內部或外部命令 瀏覽:683
騰訊100g編程源碼 瀏覽:209
機械設計和編程 瀏覽:830
八角單片機紅外遙控led 瀏覽:94
血液凈化pdf 瀏覽:383
烏市停車APP哪裡下載 瀏覽:904
單片機中fg是什麼意思 瀏覽:883
程序員網線 瀏覽:279