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

熱點內容
java實踐教程答案 瀏覽:969
怎麼看一個網站的域名伺服器 瀏覽:918
drc文件delphi編譯 瀏覽:941
魔獸世界廣西伺服器地址 瀏覽:309
android編譯源碼命令 瀏覽:407
朗行壓縮機維修 瀏覽:418
單片機比例運算電路 瀏覽:53
程序員改方案亮刀槍 瀏覽:136
無源資源碼化的作用 瀏覽:999
java內存編譯 瀏覽:163
福建節能環保無油螺桿壓縮機型號 瀏覽:527
美國紐約攝影學院pdf 瀏覽:952
如何把網頁代碼上傳到伺服器上 瀏覽:660
清理筆記本電腦灰塵解壓視頻 瀏覽:208
夜蒲聚會app是什麼軟體 瀏覽:643
任天堂如何區分伺服器 瀏覽:820
雲伺服器的運用前景 瀏覽:549
解壓視頻素材哪裡有 瀏覽:257
小米5android7 瀏覽:844
極品飛車10修改直接解壓 瀏覽:642