{-----------------------------由macd定位顶底-------------------------------}
DIFF:=EMA(CLOSE,12)-EMA(CLOSE,26);
DEA:=EMA(DIFF,9);
MacD:=2*(DIFF-DEA);
KX:=BARSSINCE(CLOSE);{←首次开盘价距金的天数}
HHN:=CONst(HHV(DIFF,KX));
HLN:=CONST(LLV(DEA,KX));
RC1:=CONST((HHN+HLN)/2);
SS:=((HHN-HLN)/200);
MACD底部:=(-100*SS+RC1)+-(-100*SS+RC1),COLOR669999;
MACD顶部:=(100*SS+RC1)+-(-100*SS+RC1),COLORFF0033;
MACD中轴:=0+-(-100*SS+RC1);
DIFF修正:=DIFF+-(-100*SS+RC1),COLOR008080;
DEA修正:=DEA+-(-100*SS+RC1),COLOR00FF00;
MACD修正:=2*(DIFF修正-DEA修正)+MACD中轴,COLOR0000BB,NODRAW;
MACD超跌:=CONST(LLV(MACD修正,KX));
MACD超跌线:=IF(MACD超跌<MACD底部,MACD超跌,MACD底部);
{----------------------利用MACD趋势进行精确顶底判断------------------------}
顶部:=MACD顶部+-MACD超跌线;
天际:=顶部*0.809;
中轴:=MACD中轴+-MACD超跌线;
海面:=顶部*0.191;
底部:=MACD底部;
{---------------------------------密集成本突破-----------------------------}
最高获利参数:=顶部/100;
VAR1C:=(COST(89)-COST(11))*最高获利参数;
VAR2C:=(COST(99.9)-COST(1))*最高获利参数;
单峰:=((1-VAR1C/VAR2C))*顶部;
低密:=((COST(90)-COST(60))/VAR2C)*顶部;
高密:=((COST(40)-COST(1))/VAR2C)*顶部;
赢利:= (SMA(WINNER(AMOUNT/vol/99),2,1))*顶部;
活跃度:=顶部-顶部/(1+expma(HIGH,21)),COLOR774455;{←CYF公众追涨热情指标}
70%成本集中度:=IF(VAR1C>顶部,顶部,VAR1C),COLORFFFFFF;
90%成本集中度:=IF(VAR2C>顶部,顶部,VAR2C),COLORFF0000;
套牢筹码上升:=IF((单峰-赢利)>底部,(单峰-赢利),底部);
个股散户:=IF(套牢筹码上升>顶部,顶部,套牢筹码上升),COLOR408000;
散户:IF(个股散户=DRAWNULL,DRAWNULL,个股散户),COLOR408000;
获利筹码上升:=IF((赢利-单峰)>底部,(赢利-单峰),底部);
个股主力:=IF(获利筹码上升>顶部,顶部,获利筹码上升),COLOR330088;
主力:IF(个股主力=DRAWNULL,DRAWNULL,个股主力),COLOR330088;