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

熱點內容
頭條下載了app怎麼安裝到桌面 瀏覽:885
原泥動力作用怎麼寫app 瀏覽:703
友行app怎麼注冊 瀏覽:190
伺服器如何打開組件服務 瀏覽:143
預約的app怎麼弄 瀏覽:507
來自星星的孩子印度電影名 瀏覽:600
大香焦高清在線 瀏覽:747
android自身卸載監聽 瀏覽:77
日本經典風月片 瀏覽:56
韓國把黃瓜套上避孕套的電影 瀏覽:643
jpeg如何轉換成pdf 瀏覽:61
英譯pdf 瀏覽:222
解壓的聲控圖片 瀏覽:208
迪士尼大電影 百度網盤 瀏覽:88
數組setjava 瀏覽:275
中國禁止觀看的十部鬼片 瀏覽:745
桌面小組件app怎麼添加到桌面 瀏覽:420
看片資源不用下載 瀏覽:846
魔獸世界怎麼改加密地形 瀏覽:611
revit快捷命令 瀏覽:827