九毛八公式指标
公式模块:
{dde--cyc成本均线-主图}
TODAY:="ddx.ddx"<>0;{判断是否有正版数据}
{比例}
主单买:=IF(TODAY,bigorder(1,2),"DATA@DDE"(6));
主单卖:=IF(TODAY,bigorder(2,2),"DATA@DDE"(7));
特单买:=IF(TODAY,bigorder(1,3),"DATA@DDE"(4));
特单卖:=IF(TODAY,bigorder(2,3),"DATA@DDE"(5));
大单买:=IF(TODAY,bigorder(1,2)-bigorder(1,3),"DATA@DDE"(6)-"DATA@DDE"(4));
大单卖:=IF(TODAY,bigorder(2,2)-bigorder(2,3),"DATA@DDE"(7)-"DATA@DDE"(5));
中单买:=IF(TODAY,bigorder(1,1)-bigorder(1,2),"DATA@DDE"(8)-"DATA@DDE"(6));
中单卖:=IF(TODAY,bigorder(2,1)-bigorder(2,2),"DATA@DDE"(9)-"DATA@DDE"(7));
散单买:=IF(TODAY,1-bigorder(1,1),1-"DATA@DDE"(8));
散单卖:=IF(TODAY,1-bigorder(2,1),1-"DATA@DDE"(9));
HS:=vol/capital;
CD:=特单买-特单卖;
超大:=HS*CD*100;
超持:= 25+Sum(超大,0);
DD:=大单买-大单卖;
大户:=HS*DD*100;
大持:=25+Sum(大户,0);
ZD:=中单买-中单卖;
中户:=HS*ZD*100;
中持:= 25+Sum(中户,0);
XD:=散单买-散单卖;
散户:=HS*XD*100;
散持:= 25+Sum(散户,0);
主力:=(超大+大户);
主持:=(超持+大持);
TT:=散持+中持;
TG:=(TT-REF(TT,1));
T4:=(主持-REF(主持,1));
GR:=(TG-REF(TG,1));
CD:=(T4-REF(T4,1));
TG1:=(TG-REF(TG,1))*capital*c;
T41:=(T4-REF(T4,1))*capital*c;
CDCG:=FINANCE2(37)*10000*CD/100;
GRCG:=FINANCE2(37)*10000*GR/100;
主力成本:EMA(CLOSE,17),linethick1,COLORRED,PRECIS2;
个人成本:EMA(CLOSE,33),linethick1,COLORGREEN,PRECIS2;
平均成本:EMA(CLOSE,24),linethick1,color33FFFF,PRECIS2;
FILLRGN(平均成本,主力成本,平均成本<主力成本,rgb(180,50,0),平均成本>主力成本,rgb(0,50,180)){,layer5};
FILLRGN(个人成本,平均成本,个人成本<平均成本,rgb(200,0,100),个人成本>平均成本,rgb(0,100,100)){,layer5};
partline(平均成本,平均成本>=ref(平均成本,1),rgb(250,0,250),平均成本<ref(平均成本,1),rgb(0,255,255)),linethick1;
主力持仓:超持+大持,linethick0,COLORRED,PRECIS1;
个人持仓:中持+散持,linethick0,COLORGREEN,PRECIS1;
FILLRGN(主力成本,个人成本,主力成本>个人成本,rgb(200,0,150),主力成本<个人成本,rgb(0,150,200)),layer5;
STICKLINE(c>=o and o<>0,HIGH,LOW,0.5,0),color0000CD;
STICKLINE(c>=o and o<>0,CLOSE,OPEN,8,0),color070084;
STICKLINE(c>=o and o<>0,CLOSE,OPEN,7,0),color0000A3;
STICKLINE(c>=o and o<>0,CLOSE,OPEN,6,0),color0000B7;
STICKLINE(c>=o and o<>0,CLOSE,OPEN,5,0),color0000CD;
STICKLINE(c>=o and o<>0,CLOSE,OPEN,4,0),color0000E9;
STICKLINE(c>=o and o<>0,CLOSE,OPEN,2,0),color0754E9;
STICKLINE(c>=o and o<>0,CLOSE,OPEN,0.5,0),Color5555FF;
STICKLINE(c<o and o<>0,HIGH,LOW,0.5,0),colorFFBE00;
STICKLINE(CLOSE<OPEN and OPEN<>0,HIGH,LOW,0.5,0),colorFFBE00;
STICKLINE(CLOSE<OPEN and OPEN<>0,CLOSE,OPEN,8,0),ColorCA6500;
STICKLINE(CLOSE<OPEN and OPEN<>0,CLOSE,OPEN,7,0),ColorE17100;
STICKLINE(CLOSE<OPEN and OPEN<>0,CLOSE,OPEN,6,0),ColorF27900;
STICKLINE(CLOSE<OPEN and OPEN<>0,CLOSE,OPEN,5,0),ColorFF850B;
STICKLINE(CLOSE<OPEN and OPEN<>0,CLOSE,OPEN,4,0),ColorFF9326;
STICKLINE(CLOSE<OPEN and OPEN<>0,CLOSE,OPEN,2,0),ColorFFA851;
STICKLINE(CLOSE<OPEN and OPEN<>0,CLOSE,OPEN,0.5,0),colorFFFF00;
DRAWTEXTREL(0,0,'成本均线'),COLORYELLOW;
DRAWTEXTREL(600,975,'证券代码: '+STKLABEL+' 证券名称: '+STKNAME+''),ColorFFAA00;
DRAWTEXTABS(45,0,'《夏卫东-修改》'),COLOR0000FF;
DRAWTEXTABS(135,0,IFS(TODAY,'正版数据','新游客数据')),colorwhite;
平均成本:=EMA(CLOSE,24);
crOSS(C,平均成本);