倚天财经公式-多空止损止盈
买价:=8.600;
止损系数:=0.950;
止赢系数:=1.100;
多头:SUM((2*CLOSE+OPEN+HIGH+LOW)/5*VOL,8)/SUM(VOL,8),LINETHICK0, COLORCYAN;
空头:LLV(多头,8),LINETHICK0, COLORYELLOW;
DKT:=多头>空头;
DRAWICON(REF(多头,1)=REF(空头,1) AND 多头>空头,LOW*0.980,13);
DRAWTEXT(REF(多头,1)=REF(空头,1) AND 多头>空头,LOW*0.970,'*关注'), COLORRED;
C11:=CLOSE>=多头 AND 多头>REF(多头,1);
C21:=CLOSE<多头;
AA:=C11>=C21;
BB:=C21>C11;
STICKLINE(AA,CLOSE,OPEN,3.400,0), COLORAA00AA;
STICKLINE(AA,CLOSE,OPEN,3,0), COLORBB00BB;
STICKLINE(AA,CLOSE,OPEN,2.400,0), COLORCC00CC;
STICKLINE(AA,CLOSE,OPEN,2,0), COLORDD00DD;
STICKLINE(AA,CLOSE,OPEN,1.600,0), COLOREE00EE;
STICKLINE(AA,CLOSE,OPEN,1.200,0), COLORMAGENTA;
STICKLINE(AA,CLOSE,OPEN,0.600,0), COLORMAGENTA;
STICKLINE(AA,HIGH,LOW,0,0), COLORMAGENTA;
STICKLINE(BB,CLOSE,OPEN,3.400,0), COLORAAAA00;
STICKLINE(BB,CLOSE,OPEN,3,0), COLORBBBB00;
STICKLINE(BB,CLOSE,OPEN,2.400,0), COLORCCCC00;
STICKLINE(BB,CLOSE,OPEN,1.600,0), COLOREEEE00;
STICKLINE(BB,CLOSE,OPEN,1.200,0), COLORYELLOW;
STICKLINE(BB,CLOSE,OPEN,0.600,0), COLORYELLOW;
STICKLINE(BB,HIGH,LOW,0,0), COLORYELLOW;
STICKLINE(ISLASTBAR,买价*1.002,买价,100,0), COLORCYAN;
止损价:买价*止损系数,LINETHICK0, COLORCYAN;
止赢价:买价*止赢系数,LINETHICK0, COLORGREEN;
STICKLINE(ISLASTBAR,止损价*1.002,止损价,80,0), COLORBLUE;
STICKLINE(ISLASTBAR,止赢价*1.002,止赢价,80,0), COLORMAGENTA;
DRAWTEXT(ISLASTBAR,止损价*1.005,'止损价'), COLORCYAN;
DRAWTEXT(ISLASTBAR,止赢价*1.005,'止赢价'), COLORCYAN;
DRAWTEXT(ISLASTBAR,买价*1.005,'买入价'), COLORYELLOW;
GJSZ:=ISLASTBAR;
DRAWNUMBER(GJSZ AND 止损价,止损价,止损价,2), COLORCYAN;
DRAWNUMBER(GJSZ AND 止赢价,止赢价,止赢价,2), COLORYELLOW;
DRAWNUMBER(GJSZ AND 买价,买价,买价,2), COLORCYAN;
N2:=5;
A1:=REF(HIGH,N2)=HHV(HIGH,2*N2+1);
B1:=FILTER(A1,N2);
C1:=BACKSET(B1,N2+1);
HD:=FILTER(C1,N2);
RH:=BACKSET(DATACOUNT-BARPOS+1=2,BARSLAST(HD)+1);
SH:=RH>REF(RH,1);
H1:=REF(HIGH,BARSLAST(SH));
STICKLINE(H1,H1,H1,5,0),LINETHICK2, COLORCYAN;
DRAWTEXT(ISLASTBAR,H1*1.005,'近期高点'), COLORYELLOW;
TTP:=ISLASTBAR;
DRAWNUMBER(TTP AND H1,H1,H1,2), COLORYELLOW;
A2:=REF(LOW,N2)=LLV(LOW,2*N2+1);
B2:=FILTER(A2,N2);
C2:=BACKSET(B2,N2+1);
LD:=FILTER(C2,N2);
RL:=BACKSET(DATACOUNT-BARPOS+1=2,BARSLAST(LD)+1);
SL:=RL>REF(RL,1);
L1:=REF(LOW,BARSLAST(SL));
STICKLINE(L1,L1,L1,5,0),LINETHICK5, COLORYELLOW;
DRAWTEXT(ISLASTBAR,L1*1.005,'近期低点'), COLORYELLOW;
DRAWNUMBER(TTP AND L1,L1,L1,2), COLORCYAN;
AHX:=MA(CLOSE,3);
BHX:=MA(CLOSE,14);
EHX:=(AHX+BHX)/2;
当前价:=CLOSE;
市盈率:=IF(FINANCE(33)>0,DYNAINFO(39),0)*0.350;
每股收益:=IF(FINANCE(33)>0.010,FINANCE(33)*0.650,0);
CKMJ:=每股收益*市盈率*4;
参考买价:STICKLINE(1,CKMJ,CKMJ,2,0), COLORWHITE;
DRAWICON(EHX<CKMJ AND CROSS(当前价,EHX),LOW*0.980,34);
DRAWICON(EHX>CKMJ AND CROSS(当前价,EHX),LOW*0.980,23);
DRAWTEXT(ISLASTBAR,CKMJ*1.005,'参考买价'), COLORCYAN;
TTP123:=ISLASTBAR;
DRAWNUMBER(TTP123 AND CKMJ,CKMJ,CKMJ,2), COLORYELLOW;
LC5:=REF(CLOSE,1);
RSI5:=SMA(MAX(CLOSE-LC5,0),6,1)/SMA(ABS(CLOSE-LC5),6,1)*100;
R:=(CLOSE-LLV(LOW,9))/(HHV(HIGH,9)-LLV(LOW,9))*100;
A:=SMA(R,3,1);
B:=SMA(A,3,1);
CCC:=(B/2+40)*1.100;
DA:=SMA(CCC,3,1);
短逃:DRAWICON(CROSS(DA,RSI5),HIGH*1.020,12);
逃顶:DRAWICON(CROSS(80,RSI5),HIGH*1.040,14);
DRAWTEXT(CROSS(DA,RSI5),HIGH*1.030,'短逃'), COLORCYAN;
DRAWTEXT(CROSS(80,RSI5),HIGH*1.050,'逃顶'), COLORGREEN;
SJ:=EMA((CLOSE-LLV(LOW,5))/(HHV(HIGH,5)-LLV(LOW,5))*100,2);
ZJ:=EMA(0.667*REF(SJ,1)+0.333*SJ,2);
DRAWTEXT(CROSS(SJ,ZJ) AND SJ<30,LOW-0.050,'←低吸'),LINETHICK2, COLOR00FF99;
===============喜欢修改K線,上升用空心K線,下跌用实体K綫,用下面源码:
买价:=8.600;
止损系数:=0.950;
止赢系数:=1.100;
多头:SUM((2*CLOSE+OPEN+HIGH+LOW)/5*VOL,8)/SUM(VOL,8),LINETHICK0, COLORCYAN;
空头:LLV(多头,8),LINETHICK0, COLORYELLOW;
DKT:=多头>空头;
DRAWICON(REF(多头,1)=REF(空头,1) AND 多头>空头,LOW*0.980,13);
DRAWTEXT(REF(多头,1)=REF(空头,1) AND 多头>空头,LOW*0.970,'*关注'), COLORRED;
C11:=CLOSE>=多头 AND 多头>REF(多头,1);
C21:=CLOSE<多头;
AA:=C11>=C21;
BB:=C21>C11;
STICKLINE(AA,C,H,0,1),COLORMAGENTA;
STICKLINE(AA,L,O,0,1),COLORMAGENTA;
STICKLINE(AA,C,O,3.4,1),COLORMAGENTA;
STICKLINE(BB,CLOSE,OPEN,3.400,0), COLORAAAA00;
STICKLINE(BB,CLOSE,OPEN,3,0), COLORBBBB00;
STICKLINE(BB,CLOSE,OPEN,2.400,0), COLORCCCC00;
STICKLINE(BB,CLOSE,OPEN,1.600,0), COLOREEEE00;
STICKLINE(BB,CLOSE,OPEN,1.200,0), COLORYELLOW;
STICKLINE(BB,CLOSE,OPEN,0.600,0), COLORYELLOW;
STICKLINE(BB,HIGH,LOW,0,0), COLORYELLOW;
STICKLINE(ISLASTBAR,买价*1.002,买价,100,0), COLORCYAN;
止损价:买价*止损系数,LINETHICK0, COLORCYAN;
止赢价:买价*止赢系数,LINETHICK0, COLORGREEN;
STICKLINE(ISLASTBAR,止损价*1.002,止损价,80,0), COLORBLUE;
STICKLINE(ISLASTBAR,止赢价*1.002,止赢价,80,0), COLORMAGENTA;
DRAWTEXT(ISLASTBAR,止损价*1.005,'止损价'), COLORCYAN;
DRAWTEXT(ISLASTBAR,止赢价*1.005,'止赢价'), COLORCYAN;
DRAWTEXT(ISLASTBAR,买价*1.005,'买入价'), COLORYELLOW;
GJSZ:=ISLASTBAR;
DRAWNUMBER(GJSZ AND 止损价,止损价,止损价,2), COLORCYAN;
DRAWNUMBER(GJSZ AND 止赢价,止赢价,止赢价,2), COLORYELLOW;
DRAWNUMBER(GJSZ AND 买价,买价,买价,2), COLORCYAN;
N2:=5;
A1:=REF(HIGH,N2)=HHV(HIGH,2*N2+1);
B1:=FILTER(A1,N2);
C1:=BACKSET(B1,N2+1);
HD:=FILTER(C1,N2);
RH:=BACKSET(DATACOUNT-BARPOS+1=2,BARSLAST(HD)+1);
SH:=RH>REF(RH,1);
H1:=REF(HIGH,BARSLAST(SH));
STICKLINE(H1,H1,H1,5,0),LINETHICK2, COLORCYAN;
DRAWTEXT(ISLASTBAR,H1*1.005,'近期高点'), COLORYELLOW;
TTP:=ISLASTBAR;
DRAWNUMBER(TTP AND H1,H1,H1,2), COLORYELLOW;
A2:=REF(LOW,N2)=LLV(LOW,2*N2+1);
B2:=FILTER(A2,N2);
C2:=BACKSET(B2,N2+1);
LD:=FILTER(C2,N2);
RL:=BACKSET(DATACOUNT-BARPOS+1=2,BARSLAST(LD)+1);
SL:=RL>REF(RL,1);
L1:=REF(LOW,BARSLAST(SL));
STICKLINE(L1,L1,L1,5,0),LINETHICK5, COLORYELLOW;
DRAWTEXT(ISLASTBAR,L1*1.005,'近期低点'), COLORYELLOW;
DRAWNUMBER(TTP AND L1,L1,L1,2), COLORCYAN;
AHX:=MA(CLOSE,3);
BHX:=MA(CLOSE,14);
EHX:=(AHX+BHX)/2;
当前价:=CLOSE;
市盈率:=IF(FINANCE(33)>0,DYNAINFO(39),0)*0.350;
每股收益:=IF(FINANCE(33)>0.010,FINANCE(33)*0.650,0);
CKMJ:=每股收益*市盈率*4;
参考买价:STICKLINE(1,CKMJ,CKMJ,2,0), COLORWHITE;
DRAWICON(EHX<CKMJ AND CROSS(当前价,EHX),LOW*0.980,34);
DRAWICON(EHX>CKMJ AND CROSS(当前价,EHX),LOW*0.980,23);
DRAWTEXT(ISLASTBAR,CKMJ*1.005,'参考买价'), COLORCYAN;
TTP123:=ISLASTBAR;
DRAWNUMBER(TTP123 AND CKMJ,CKMJ,CKMJ,2), COLORYELLOW;
LC5:=REF(CLOSE,1);
RSI5:=SMA(MAX(CLOSE-LC5,0),6,1)/SMA(ABS(CLOSE-LC5),6,1)*100;
R:=(CLOSE-LLV(LOW,9))/(HHV(HIGH,9)-LLV(LOW,9))*100;
A:=SMA(R,3,1);
B:=SMA(A,3,1);
CCC:=(B/2+40)*1.100;
DA:=SMA(CCC,3,1);
短逃:DRAWICON(CROSS(DA,RSI5),HIGH*1.020,12);
逃顶:DRAWICON(CROSS(80,RSI5),HIGH*1.040,14);
DRAWTEXT(CROSS(DA,RSI5),HIGH*1.030,'短逃'), COLORCYAN;
DRAWTEXT(CROSS(80,RSI5),HIGH*1.050,'逃顶'), COLORGREEN;
SJ:=EMA((CLOSE-LLV(LOW,5))/(HHV(HIGH,5)-LLV(LOW,5))*100,2);
ZJ:=EMA(0.667*REF(SJ,1)+0.333*SJ,2);
DRAWTEXT(CROSS(SJ,ZJ) AND SJ<30,LOW-0.050,'←低吸'),LINETHICK2, COLOR00FF99;