close2:=CLOSE;h2:=HIGH;l2:=LOW;o2:=OPEN;
ma1:MA(CLOSE,2),colorff00ff;
ma2:MA(CLOSE,5),color00ff00;
B1:=REF(close2,1);B2:=REF(close2,2);
SS:=IF(close2>REF(close2,1) AND REF(close2,1)>=REF(close2,2),1,IF(CLOSE<REF(close2,1) AND REF(close2,1)<=REF(close2,2),-1,IF(close2>REF(close2,2) AND REF(close2,2)>REF(close2,1),2,IF(close2<REF(close2,2) AND REF(close2,2)<REF(close2,1),-2,0))));
SM:=IF(REF(SS,1)<>0,REF(SS,1),IF(REF(SS,2)<>0,REF(SS,2),IF(REF(SS,3)<>0,REF(SS,3),IF(REF(SS,5)<>0,REF(SS,5),IF(REF(SS,6)<>0,REF(SS,6),IF(REF(SS,7)<>0,REF(SS,7),0))))));
mc:IF(REF(SS,1)<>0,B2,IF(SM>0,MIN(B1,B2),MAX(B1,B2))),COLOR000000;
STICKLINE(SS=1 OR SM>=1 AND SS=0,B1,close2,6,0),COLOR0000ff;
STICKLINE(SS=-1 OR SM<=-1 AND SS=0,B1,close2,6,0),COLOR00FF00;
STICKLINE(SS=2,B2,CLOSE,6,0),COLORRED;
STICKLINE(SS=-2,B2,CLOSE,6,0),COLOR00FF00;
STICKLINE((SS=-1 OR SS=-2) AND SM>0,B2,B1,6,0),COLORRED;
STICKLINE((SS=1 OR SS=2) AND SM<0,B2,B1,6,0),COLOR00FF00;
aa:=CLOSE > REF(CLOSE, 1) and REF(CLOSE, 1) > REF(CLOSE, 2) and REF(CLOSE, 1) < REF(CLOSE, 3) and IF(REF(CLOSE, 3) < REF(CLOSE, 4), 1, IF(REF(CLOSE, 4) < REF(CLOSE, 5),REF(CLOSE, 1) < REF(CLOSE, 4) or( REF(CLOSE, 2) < REF(CLOSE, 4) and REF(CLOSE, 3) >= REF(CLOSE, 5) ),IF(REF(CLOSE, 5) < REF(CLOSE, 6), 1,REF(CLOSE, 6) < REF(CLOSE, 7))));
bb:=CLOSE < REF(CLOSE, 1) and REF(CLOSE, 1) < REF(CLOSE, 2) and REF(CLOSE, 1) > REF(CLOSE, 3) and IF(REF(CLOSE, 3) > REF(CLOSE, 4), 1, IF(REF(CLOSE, 4) > REF(CLOSE, 5),REF(CLOSE, 1) > REF(CLOSE, 4) or( REF(CLOSE, 2) > REF(CLOSE, 4) and REF(CLOSE, 3) <= REF(CLOSE, 5) ),IF(REF(CLOSE, 5) > REF(CLOSE, 6), 1,REF(CLOSE, 6) > REF(CLOSE, 7))));
DRAWICON(aa and CLOSE>REF(OPEN,2),LOW,1);
DRAWICON(bb and CLOSE<REF(CLOSE,2),HIGH*1.01,2);
DRAWTEXT(aa and CLOSE>REF(OPEN,2),LOW*0.995,'三平底翻红'),color00ffff;
DRAWTEXT(bb and CLOSE<REF(CLOSE,2),HIGH*1.01,'三平顶翻绿'),color00ff00;
{三平底翻红选股:if(aa and close>ref(open,2),1,0);
三平顶翻绿选股:if(bb and close<ref(close,2),1,0);}
ll:=COST(0);
hh:=COST(100);
aa1:=(hh-ll)/100;//把区间分成100份
tm1:=WINNER(ll[DATACOUNT]+aa1[DATACOUNT]);
tm:=tm1[DATACOUNT];
dyjw[1]:=ll[DATACOUNT]+aa1[DATACOUNT];
for k=2 to 100 do begin
dyjw[k]:=(ll[DATACOUNT]+k*aa1[DATACOUNT]);
dyhlp:=WINNER(dyjw[k]);
hlp:=dyhlp-tm1;
tm1:=dyhlp;
IF hlp[DATACOUNT]>tm then begin
tm:=hlp[DATACOUNT];
jg:=dyjw[k];
end;
end;
筹码密集峰价位:jg-aa1[DATACOUNT]/2,LINETHICK4;
jg-aa1[DATACOUNT]/2,LINETHICK1,Colorwhiter;
Aa1:=SUMBARS(VOL,CAPITAL);
换手%成本:IF(CAPITAL>0,SUM(AMOUNT,Aa1)/SUM(VOL,Aa1)/100,EMA(CLOSE,120)),LINETHICK4,ColorFFE9E9;{99.99%换手平均成本}
IF(CAPITAL>0,SUM(AMOUNT,Aa1)/SUM(VOL,Aa1)/100,EMA(CLOSE,120)),LINETHICK1,Colorblue;
AA:=(EMA(SUMBARS(VOL,CAPITAL)*0.1,3)+MA(SUMBARS(VOL,CAPITAL)*0.2,5)+MA(SUMBARS(VOL,CAPITAL)*0.3,8)+MA(SUMBARS(VOL,CAPITAL)*0.4,13))/4;
A1:=FORCAST(IF(CAPITAL>0,SUM(AMOUNT,AA)/SUM(VOL,AA)/100,EMA(CLOSE,3)),3);
半年成本:EMA(A1,152),LINETHICK4,Color0000FF;
EMA(A1,152),LINETHICK1,Coloryellow;
年成本:EMA(A1,246),LINETHICK4,ColorFF0000;
EMA(A1,246),LINETHICK1,Colorgreen; |