請問DEA中,如果輸出指標,例如淨利潤為負數,具體用軟體做效

時間 2021-11-04 23:18:41

1樓:匿名使用者

dea的效績指標都是大於0的結果. 如果輸出為負值 最後實際效績值有可能為負值, 但是如果用dea是反映不出來的. 如果用dea方法, 除非所有的dmu這項指標都是負值 不然不能進行有效的計算.

(即使所有的dmu這項都是負值, 計算結果也很有問題).

如果一定要用dea的話有這樣幾個方法

1.可以將淨利潤和其他輸入或者輸出項進行合併,以保證每一個資料都是大於0,再進行計算;

2.如果輸出只有利潤一項的話,可以將正負利潤的dmu進行單獨計算;在計算負利潤的dmu的效績的時候將負利潤變成正值(絕對值),然後將算出的效績值變成負值(加負號);最後將所有的dmu的效績值合併。 這樣就可以用dea同時反映正負效率。

但注意,這個結果是兩次dea計算合併的結果,跟dea的基本屬性相悖, 並非與每一個dmu比較得出的結果,所以 最後結果只能為排名做參考,效率數值本身沒有意義。

希望對你有幫助

呵呵 以前那dea個負相關的問題確實是我答的

2樓:百度網友

用投入面的bcc模型開解,具有產出平移不變性

3樓:匿名使用者

不對,如果出現負值 大多數dea模型都是無解的,因為相應的charnescooper變換不成立,所以不可能將原模型轉化為lp模型。比較靠譜的解決負值問題是用加法模型(additive model),因為加法模型具有平移不變性,講通俗一點,就是對於某一輸入變數x1,所有的dmu都加上或者減去同一個數,模型評價結果不變。

急求macd指標**。 20

4樓:白雲飄飄刀炕母

第一個公式《通達信》

diff:= ema(close,12) - ema(close,26);

dif:ema(close,12) - ema(close,26),colorred;

dea:ema(dif,9),colorblue;

macd:2*(dif-dea),colorstick;

fh1:=ref(macd,1)=0 and count(macd>ref(macd,1),1)=1;

fh3:=fh1 and fh2 and ema(c,13)>ref(ema(c,13),1);

fh4:=fh1 and fh2 and abs((dif-dea)/c)<0.018;

fh5:=fh1 and fh2 and macd<0.10;

vv:=close>open and ma(close,5)>ma(close,10) and ma(close,10)>ma(close,30)

and diff>dea and macd>ref(macd,1) and diff>0 and dea>0 and

ma(vol,5)>ma(vol,34) and ma(close,30)>=ref(ma(close,30),1);

佛手:if(vv,1,0),nodraw;

drawicon(佛手,0.06,11);

二次翻紅:(fh3 or fh4 or fh5),colorred,nodraw;

低買:cross(dif,dea) and dif<0,colorff00ff,nodraw;

加油:cross(dif,dea) and dif>0,coloryellow,nodraw;

drawicon(二次翻紅,-0.05,1);

drawtext(二次翻紅,-0.15,'↖翻紅'),colorred;

drawtext(cross(dif,dea) and dif<0,dea-0.02,'↖低買'),colorff00ff;

drawtext(cross(dif,dea) and dif>0,dea-0.05,'↖加油'),coloryellow;

xg:二次翻紅 or 低買 or 加油,nodraw;

ylzc:=if(close=indexc,(indexc+indexh+indexl+indexo)/4,amount/(vol+0.01)/100);

阻價:=if(close=indexc,ylzc+indexc-indexl,ylzc+(close-low));

支價:=if(close=indexc,indexl+indexc-ylzc,low+(close-ylzc));

今壓:ref(阻價,1),linethick0,coloraa11bb,nodraw;

今撐:ref(支價,1),linethick0,color009900,nodraw;

明壓:阻價,linethick0,nodraw;

明撐:支價,linethick0,nodraw;

第二個公式《通達信》

sqx:=(c-ma(close,13))*100;

dif:ema(ma(sqx,7),1),linethick1;

dea:ema(dif,7),linethick1;

macd: (dif-dea)*2,colorstick;

紅柱持股:if(macd>ref(macd,1),macd,drawnull),stick,colorred,linethick1;

綠柱持幣:if(macd=0));

二次金叉:if(cross(dif,dea) and dea<0 and count(jccount=2,21)=1,0.2,0),colorff00ff,pointdot;

stickline(二次金叉,25,15,8,1),colorff00ff;

a1:=barslast(ref(cross(dif,dea),1));

底背離:if(ref(close,a1+1)>close and dif>ref(dif,a1+1) and cross(dif,dea),0.1,0),colorred,pointdot;

stickline(底背離,40,30,8,1),colorred;

drawline(a1=0,dea,底背離,dea,0),colorred;

a2:=barslast(ref(cross(dea,dif),1));

頂背離:ref(close,a2+1)dif and cross(dea,dif),colorgreen;

drawline(a2=0,dea,頂背離,dea,0),colorgreen;

a3:=cross(dif,dea) and dea<0;

零下二次金叉:if(filter(count(a3,21)=2,10),0.05,0),colorwhite,pointdot;

stickline(零下二次金叉,45,55,8,1),colorwhite;

金叉:drawicon(cross(dif,dea),dif,1);

死叉:drawicon(cross(dea,dif),dif,2);

第三個公式 金牌macd《通達信》

diff:ema(close,12)-ema(close,27);

dea:ema(diff,9);

macd:=2*(diff-dea);

stickline(macd>=0,macd,0,2,1),colorf00ff0;

stickline(macd<0,macd,0,2,1),colorwhite;

stickline(macd0,0,macd,2,0 ),color00aaff;

stickline(macd0,0,macd,2,0 ),color00bbff;

stickline(macd0,0,macd,2,0 ),color00ccff;

stickline(macd0,0,macd,2,0 ),color00ddff;

stickline(macd0,0,macd,2,0 ),color00eeff;

stickline(macd0,0,macd,2,0 ),color00ffff;

stickline(macd>=ref(macd,1)and macd>0,0,macd,2,0 ),color0000aa;

stickline(macd>=ref(macd,1)and macd>0,0,macd,2,0 ),color0011bb;

stickline(macd>=ref(macd,1)and macd>0,0,macd,2,0 ),color0022cc;

stickline(macd>=ref(macd,1)and macd>0,0,macd,2,0 ),color0033dd;

stickline(macd>=ref(macd,1)and macd>0,0,macd,2,0 ),color0044ee;

stickline(macd>=ref(macd,1)and macd>0,0,macd,2,0 ),color0055ff;

stickline(macd>ref(macd,1)and macd<0,0,macd,2,0 ),coloraa00bb;

stickline(macd>ref(macd,1)and macd<0,0,macd,2,0 ),colorbb11bb;

stickline(macd>ref(macd,1)and macd<0,0,macd,2,0 ),colorcc22bb;

stickline(macd>ref(macd,1)and macd<0,0,macd,2,0 ),colordd33bb;

stickline(macd>ref(macd,1)and macd<0,0,macd,2,0 ),coloree44bb;

stickline(macd>ref(macd,1)and macd<0,0,macd,2,0 ),colorff55bb;

stickline(macd<=ref(macd,1)and macd<0,0,macd,2,0 ),colorffaa00;

stickline(macd<=ref(macd,1)and macd<0,0,macd,2,0 ),colorffbb11;

stickline(macd<=ref(macd,1)and macd<0,0,macd,2,0 ),colorffcc22;

stickline(macd<=ref(macd,1)and macd<0,0,macd,2,0 ),colorffdd33;

stickline(macd<=ref(macd,1)and macd<0,0,macd,2,0 ),colorffee44;

stickline(macd<=ref(macd,1)and macd<0,0,macd,2,0 ),colorffff55;

if(diff<0,diff,0),colorred,linethick1;

if(diff<0,0,diff),coloryellow,linethick1;

if(diffdea,dea,dea),colorwhite,linethick1;

低位金叉:=cross(diff,dea) and diff<-0.1;

stickline(低位金叉,0,-0.18,2,0),coloryellow;

drawtext(低位金叉,-0.1,' 低位金叉'),coloryellow;

jccount:=count(cross(diff,dea),barslast(dea>=0));

二次金叉:=cross(diff,dea) and dea<0 and count(jccount=2,21)=1;

stickline(二次金叉,0,-0.18,2,0),colorff00ff;

drawicon(二次金叉,dea*1.04,13) ;

drawtext(二次金叉,-0.1,' 二次金叉'),colorff00ff;

a1:=barslast(ref(cross(diff,dea),1));

底背離:=ref(close,a1+1)>close and diff>ref(diff,a1+1) and cross(diff,dea);

stickline(底背離,0,0.13,2,0),color00ff00;

drawline(a1=0,dea,底背離,dea,0),colorred,linethick2;

drawtext(底背離,0.1,' 底背離'),color00ff00;

a2:=barslast(ref(cross(dea,diff),1));

頂背離:=ref(close,a2+1)diff and cross(dea,diff);

drawline(a2=0,dea,頂背離,dea,0),colorgreen,linethick2;

第四個選股公式《通達信》

diff:=ema(close,12)-ema(close,26);

dea:=ema(diff,9);

macd:=2*(diff-dea);

jccount:=count(cross(diff,dea),barslast(dea>=0));

二次金叉:cross(diff,dea) and dea<0 and count(jccount=2,21)=1;