這個公式的思路是通過比較PDI和MDI的大小和變化來判斷股票的強弱和買賣信號。一般來說,當PDI大于MDI時,表示股票處于上漲趨勢,可以考慮買入或持有;當PDI小于MDI時,表示股票處于下跌趨勢,可以考慮賣出或觀望。
?
此外,這個公式還設置了一些特殊情況來識別股票的反轉、背離、小心等信號。例如,當MDI突然增大而PDI下降時,可能預示著股票即將反轉下跌;當股價創(chuàng)新高而PDI沒有創(chuàng)新高時,可能存在著頂部背離的風險;當PDI低于一定閾值時,可能需要小心股價的回調等等。
?
具體操作建議如下:
?
當出現(xiàn)“巨反轉”或“反轉”的信號時,應該及時止盈或止損,并觀察后續(xù)走勢。
當出現(xiàn)“小心”或“背離”的信號時,應該謹慎操作,并注意風險控制。
當出現(xiàn)“上”或“?上”的信號時,可以適當加倉或開倉,并跟隨趨勢。
當沒有明顯信號時,可以按照PDI和MDI的相對大小和變化來調整倉位。
?
?
?
TR1 := SUM(MAX(MAX(H-L,ABS(H-REF(C,1))),ABS(L-REF(C,1))),N);
HD := H-REF(H,1);
LD := REF(L,1)-L;
DMP:= SUM(IF(HD>0 ,HD,0),N);
DMM:= SUM(IF(LD>0 ,LD,0),N);
PDI: DMP*100/TR1,colorwhite;
MDI: DMM*100/TR1,coloryellow;
反轉:=ref(MDI,1)=0 and ref(MDI,2)<3 and MDI>1 and close>ref(close,1) and PDI<ref(PDI,1) and ref(PDI,1)>ref(PDI,2) and PDI<60 and PDI>45;
巨反轉:=if(ref(MDI,1)=0 and ref(mdi,2)=0 AND MDI>3 AND PDI>60 and close>ref(close,1) and pdi<ref(pdi,1) and ref(close,1)>ref(close,2),1,0);
小心:=if(ref(MDI,1)<2.5 and (MDI-ref(MDI,1))>2 and close>ref(close,1) and pdi<ref(pdi,1) and 40<PDI,1,0);
背離:=if(close>ref(close,1) and pdi<ref(pdi,1) and ref(pdi,1)>ref(PDI,2) and ref(pdi,1)>60,1,0);
F:=if(close>ref(close,1) and pdi<ref(pdi,1) and ref(close,2)<ref(close,1),if((PDI-10)>0,PDI-10,0),0);
e:=if(ref(MDI,1)=0,10,0)+if(ref(MDI,1)<3,10,0)+if(ref(MDI,2)=0,10,0)+if(ref(MDI,2)<4,15,0)+if(ref(MDI,3)=0,15,0)+if(ref(MDI,3)<5,20,0)+if(MDI=0,5,0)+if(MDI<5,5,0)+F+if(F>0,ref(f,1),0);
小心指數(shù):IF(E>100,100,E);
DRAWTEXT(巨反轉=1,20,'巨反轉' ),colorred;
DRAWTEXT(巨反轉=0 and 反轉=1,20,'反轉' ),colorred;
DRAWTEXT(反轉=0 and 小心=1,20,'小心' ),colorred;
DRAWTEXT(背離=1,80,'背離'),colorred;
DRAWTEXT(背離=0 and close>ref(close,1) and pdi<ref(pdi,1) {and ref(pdi,1)>ref(PDI,2)} and ref(pdi,1)>50,70,'背'),colorred;
DRAWTEXT(ref(PDI,1)<2.5 and (PDI-ref(PDI,1))>1.5 and close<ref(close,1) and Mdi<ref(Mdi,1),20,'上' ),colorred;
DRAWTEXT(ref(PDI,1)<5 and ref(PDI,1)<ref(pdi,2) and (PDI-ref(PDI,1))>1.5 and close>ref(close,1) and Mdi<ref(Mdi,1),20,'?上' ),colorred;
?
頂部預判-自以為是精品的指標
公式導入教程: 【通達信公式源碼導入方法教程】 【同花順公式源碼導入方法教程】 【大智慧新一代公式源碼導入方法教程】
?
?
TR1 := SUM(MAX(MAX(H-L,ABS(H-REF(C,1))),ABS(L-REF(C,1))),N);
HD := H-REF(H,1);
LD := REF(L,1)-L;
DMP:= SUM(IF(HD>0 ,HD,0),N);
DMM:= SUM(IF(LD>0 ,LD,0),N);
PDI: DMP*100/TR1,colorwhite;
MDI: DMM*100/TR1,coloryellow;
反轉:=ref(MDI,1)=0 and ref(MDI,2)<3 and MDI>1 and close>ref(close,1) and PDI<ref(PDI,1) and ref(PDI,1)>ref(PDI,2) and PDI<60 and PDI>45;
巨反轉:=if(ref(MDI,1)=0 and ref(mdi,2)=0 AND MDI>3 AND PDI>60 and close>ref(close,1) and pdi<ref(pdi,1) and ref(close,1)>ref(close,2),1,0);
小心:=if(ref(MDI,1)<2.5 and (MDI-ref(MDI,1))>2 and close>ref(close,1) and pdi<ref(pdi,1) and 40<PDI,1,0);
背離:=if(close>ref(close,1) and pdi<ref(pdi,1) and ref(pdi,1)>ref(PDI,2) and ref(pdi,1)>60,1,0);
F:=if(close>ref(close,1) and pdi<ref(pdi,1) and ref(close,2)<ref(close,1),if((PDI-10)>0,PDI-10,0),0);
e:=if(ref(MDI,1)=0,10,0)+if(ref(MDI,1)<3,10,0)+if(ref(MDI,2)=0,10,0)+if(ref(MDI,2)<4,15,0)+if(ref(MDI,3)=0,15,0)+if(ref(MDI,3)<5,20,0)+if(MDI=0,5,0)+if(MDI<5,5,0)+F+if(F>0,ref(f,1),0);
小心指數(shù):IF(E>100,100,E);
DRAWTEXT(巨反轉=1,20,'巨反轉' ),colorred;
DRAWTEXT(巨反轉=0 and 反轉=1,20,'反轉' ),colorred;
DRAWTEXT(反轉=0 and 小心=1,20,'小心' ),colorred;
DRAWTEXT(背離=1,80,'背離'),colorred;
DRAWTEXT(背離=0 and close>ref(close,1) and pdi<ref(pdi,1) {and ref(pdi,1)>ref(PDI,2)} and ref(pdi,1)>50,70,'背'),colorred;
DRAWTEXT(ref(PDI,1)<2.5 and (PDI-ref(PDI,1))>1.5 and close<ref(close,1) and Mdi<ref(Mdi,1),20,'上' ),colorred;
DRAWTEXT(ref(PDI,1)<5 and ref(PDI,1)<ref(pdi,2) and (PDI-ref(PDI,1))>1.5 and close>ref(close,1) and Mdi<ref(Mdi,1),20,'?上' ),colorred;
?
有思路,想編寫各種指標公式,交易模型,選股公式,還原公式的朋友
可聯(lián)系技術人員 QQ: 262069696
或微信:cxhjy888 進行 有償收費 編寫!(注:由于人數(shù)限制,QQ或微信請選擇方便的一個聯(lián)系我們就行,加好友時請簡單備注下您的需求,否則無法通過。謝謝您!)
(怎么收費,代編流程等詳情請點擊查閱!)
(注:由于人數(shù)限制,QQ或微信請選擇方便的一個聯(lián)系我們就行,加好友時請簡單備注下您的需求,否則無法通過。謝謝您!)