導航:首頁 > 源碼編譯 > 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背離源碼相關的資料

熱點內容
php讀取二維數組 瀏覽:348
php編譯安裝參數 瀏覽:278
其實壓力沒那麼大程序員圖片 瀏覽:416
如何查看app內訪問的網頁地址 瀏覽:757
安卓手機信號旁邊的漢字怎麼設置 瀏覽:304
nrf2401單片機 瀏覽:713
清除電腦文件夾垃圾的方法 瀏覽:226
天河程序員 瀏覽:192
成都程序員公積金 瀏覽:768
程序員為什麼叫程序猿 瀏覽:482
加西貝拉壓縮機價格 瀏覽:787
海信聚好看如何用u盤安裝app 瀏覽:69
加密狗怎麼寫的 瀏覽:558
安卓手機如何能調最大聲音 瀏覽:668
編程開發工具大全 瀏覽:572
如何把安卓系統換成windows 瀏覽:31
android拼接url 瀏覽:23
華為nfc復制加密卡怎麼模擬 瀏覽:775
在pdf中怎麼插入文件 瀏覽:115
單片機中fw縮寫是什麼 瀏覽:378