ma1:MA(C,5);
ma2:MA(C,10); ma3:MA(C,30); A1:=BARSLAST(REF(CROSS("macd.diff"(12,26,9),"macd.dea"(12,26,9)),1)); B1:=REF(C,A1+1)>C AND REF("macd.diff"(12,26,9),A1+1)<"macd.diff"(12,26,9) AND CROSS("macd.diff"(12,26,9),"macd.dea"(12,26,9)); 底背離MACD:DRAWTEXT(FILTER(B1>0,5),LOW,'1'),coloryellow; DRAWTEXT(FILTER(B1>0,5),LOW*0.98,'MACD底背離'),COLOR00ff00; 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)); 底背離KDJ:DRAWTEXT(FILTER(B2>0,5),LOW,'▲'),coloryellow; DRAWTEXT(FILTER(B2>0,5),LOW*0.98,'KDJ底背離'),colorred; A3:=BARSLAST(REF(CROSS("RSI.RSI$1"(12,26,9),"RSI.RSI$2"(12,26,9)),1)); B3:=REF(C,A3+1)>C AND REF("RSI.RSI$1"(8,55,55),A3+1)<"RSI.RSI$1"(8,55,55) AND CROSS("RSI.RSI$1"(8,55,55),"RSI.RSI$2"(8,55,55)); 底背離RSI:DRAWTEXT(FILTER(B3>0,5),LOW,'▲'),coloryellow; DRAWTEXT(FILTER(B3>0,5),LOW*0.98,'RSI底背離'),colorf0f000; A4:=BARSLAST(REF(CROSS("dmi_ql.pdi"(14,6),"dmi_ql.mdi"(14,6)),1)); B4:=REF(C,A4+1)>C AND REF("dmi_ql.pdi"(14,6),A4+1)<"dmi_ql.pdi"(14,6) AND CROSS("dmi_ql.pdi"(14,6),"dmi_ql.mdi"(14,6)); 底背離DMI:DRAWTEXT(FILTER(B4>0,5),LOW,'▲'),coloryellow; DRAWTEXT(FILTER(B4>0,5),LOW*0.98,'DMI底背離'),colorF00FF0; C1:=BARSLAST(REF(CROSS("macd.dea"(12,26,9),"macd.diff"(12,26,9)),1)); D1:=REF(C,C1+1)<C AND REF("macd.diff"(12,26,9),C1+1)>"macd.diff"(12,26,9) AND CROSS("macd.dea"(12,26,9),"macd.diff"(12,26,9)); 頂背離MACD:DRAWTEXT(FILTER(D1>0,5),HIGH*1.02,'▲'),COLOR00FF00; DRAWTEXT(FILTER(D1>0,5),HIGH*1.04,'MACD頂背離'),colorred; 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)); 頂背離KDJ:DRAWTEXT(FILTER(D2>0,5),HIGH*1.02,'▲'),COLOR00FF00; DRAWTEXT(FILTER(D2>0,5),HIGH*1.04,'KDJ頂背離'),COLORF00FF0; C3:=BARSLAST(REF(CROSS("RSI.RSI$2"(8,55,55),"RSI.RSI$1"(8,55,55)),1)); D3:=REF(C,C3+1)<C AND REF("RSI.RSI$1"(8,55,55),C3+1)>"RSI.RSI$1"(8,55,55) AND CROSS("RSI.RSI$2"(8,55,55),"RSI.RSI$1"(8,55,55)); 頂背離RSI:DRAWTEXT(FILTER(D3>0,5),HIGH*1.02,'▲'),COLOR00FF00; DRAWTEXT(FILTER(D3>0,5),HIGH*1.04,'RSI頂背離'),coloryellow; C4:=BARSLAST(REF(CROSS("DMI_ql.MDI"(14,6),"DMI_ql.PDI"(14,6)),1)); D4:=REF(C,C4+1)<C AND REF("DMI_ql.PDI"(14,6),C4+1)>"DMI_ql.PDI"(14,6) AND CROSS("DMI_ql.MDI"(14,6),"DMI_ql.PDI"(14,6)); 頂背離DMI:DRAWTEXT(FILTER(D4>0,5),HIGH*1.02,'▲'),COLOR00FF00; DRAWTEXT(FILTER(D4>0,5),HIGH*1.04,'DMI頂背離'),COLORF0F000; {適合主圖顯示}
a:=SUM(IF(CLOSEREF(CLOSE,1),VOL,IF(CLOSEREF(CLOSE,1),-VOL,0)),0)/10000;b:=MA(a,5);A1:=BARSLAST(REF(CROSS(a,b),1)); B1:=R
a:=SUM(IF(CLOSE>REF(CLOSE,1),VOL,IF(CLOSE<REF(CLOSE,1),-VOL,0)),0)/10000;
b:=MA(a,5); A1:=BARSLAST(REF(CROSS(a,b),1)); B1:=REF(C,A1+1)>C AND REF(a,A1+1)<b AND CROSS(a,b); DRAWTEXT(IF(B1>0,1,0),L-0.1,'obv底背離'),colorgreen; 同花順OBV一般為單線顯示,因此做了少量改動,該公式為底背離公式 適合主圖顯示。 ⊙本文章轉(zhuǎn)自[廣西東盟商業(yè)網(wǎng) — http://www.w8www.com] 原文鏈接:http://www.w8www.com/news/content-11410.html |
|