通达信多空止损止盈主图公式

[复制链接]
查看44 | 回复0 | 2022-7-24 08:07:16 | 显示全部楼层 |阅读模式

通达信多空止损止盈主图公式

STICKLINE(CURRBARSCOUNT=1,买价*1.0015,买价,100,0),COLOR00FFFF;
  止损价:买价*止损系数,DOTLINE,COLORFFFF00,LINETHICK1;
  止赢价:买价*止赢系数,DOTLINE,COLOR0080FF,LINETHICK1;
  STICKLINE(CURRBARSCOUNT=1,止损价*1.0015,止损价,80,0),COLORFFFF00;
  STICKLINE(CURRBARSCOUNT=1,止赢价*1.0015,止赢价,80,0),COLOR0080FF;
  DRAWTEXT(ISLASTBAR,止损价*1.005,'止损价'),COLOR00FFFF;
  DRAWTEXT(ISLASTBAR,止赢价*1.005,'止赢价'),COLOR00FFFF;
  DRAWTEXT(ISLASTBAR,买价*1.005,'买入价'),COLOR00FFFF;
  GJSZ:=(CURRBARSCOUNT=5-4);
  DRAWNUMBER(GJSZ AND 止损价,止损价,止损价),COLOR00FFFF;
  DRAWNUMBER(GJSZ AND 止赢价,止赢价,止赢价),COLOR00FFFF;
  DRAWNUMBER(GJSZ AND 买价,买价,买价),COLOR00FFFF;
 
 N2:=5;
  A1:=REF(H,N2)=HHV(H,2*N2+1);
B1:=FILTER(A1,N2);
C1:=BACKSET(B1,N2+1);
HD:= FILTER(C1,N2);
  RH:=BACKSET(CURRBARSCOUNT=2,BARSLAST(HD)+1);
SH:=RH>REF(RH,1);
  H1:=REF(H ,BARSLAST(SH));
  STICKLINE(H1,H1,H1,5,0),LINETHICK2,COLOR00FFFF;
  DRAWTEXT(ISLASTBAR,H1*1.005,'近高点'),COLORFFFFFF;
  TTP:=(CURRBARSCOUNT=5-4);
  DRAWNUMBER(TTP AND H1,H1,H1),COLOR00FFFF;
  A2:=REF(L,N2)=LLV(L,2*N2+1);
B2:=FILTER(A2,N2);
C2:=BACKSET(B2,N2+1);
LD:=FILTER(C2,N2);
RL:=BACKSET(CURRBARSCOUNT=2,BARSLAST(LD)+1);
SL:=RL>REF(RL,1);
  L1:=REF(L ,BARSLAST(SL));
  STICKLINE(L1,L1,L1,5,0),COLORFFFF00,LINETHICK5;
  DRAWTEXT(ISLASTBAR,L1*1.005,'近低点'),COLORFFFFFF;
  DRAWNUMBER(TTP AND L1,L1,L1),COLOR00FFFF;
  AHX:=MA(C,3);
  BHX:=MA(C,14);
  EHX:=(AHX+BHX)/2;
  当前价:=C,COLORFFFFFF;
  市盈率:=IF(FINANCE(33)>0,DYNAINFO(39),0)*0.35;
  每股收益:=IF(FINANCE(33)>0.01,FINANCE(33)*0.65,0);
  CKMJ:=每股收益*市盈率*4;
  参买价:STICKLINE(1,CKMJ,CKMJ,2,0),COLOR00FFFF,LINETHICK1;
  DRAWICON(EHX<CKMJ AND CROSS(当前价,EHX),L*0.98,34);
  DRAWICON(EHX>CKMJ AND CROSS(当前价,EHX),L*0.98,23);
  DRAWTEXT(ISLASTBAR,CKMJ*1.0054,'参买价'),COLOR00FFFF;
  TTP123:=(CURRBARSCOUNT=5-4);
  DRAWNUMBER(TTP123 AND CKMJ,CKMJ,CKMJ),COLOR00FFFF;
  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.1;
  DA:=SMA(CCC,3,1);
  短逃:DRAWICON(CROSS(DA,RSI5),H*1.02,35);
  逃顶:DRAWICON(CROSS(80,RSI5),H*1.04,35);
  DRAWTEXT(短逃,H*1.03, '★'),COLORFFFF00;
  DRAWTEXT(逃顶,H*1.05, '★'),COLOR939300;
SJ:=WMA((C-LLV(L,5))/(HHV(H,5)-LLV(L,5))*100,2);
ZJ:=WMA(0.667*REF(SJ,1)+0.333*SJ,2);
DRAWTEXT(CROSS(SJ,ZJ) AND SJ<30,L-0.09,'★'),COLOR00FFFF,LINETHICK2;
{DRAWTEXT(CROSS(ZJ,SJ) AND SJ>70,H+0.05,'←高抛'),COLOR00FF00,LINETHICK2;}
  DRAWTEXT_FIX(1,0.05,0.0,0,'【操作须知】★★及时调整买价★★
  根据自己习惯确定止损系数及止赢系数 ★★ 参考买价线下大胆买★★ '),COLOR00FFFF;
 高1:=REF(HHV(H,150),3);
  低1:=REF(LLV(L,150),3);
 
 H2:=高1-(高1-低1)*0.382;
  H3:=高1-(高1-低1)*0.5;
  H4:=高1-(高1-低1)*0.618;
  H5:=高1-(高1-低1)*0.809;
  {顶:REFDATE(高1,DATE),POINTDOT,COLORWHITE;}
 疯牛%19:REFDATE(H1,DATE),POINTDOT,COLORYELLOW;
 突破%38:REFDATE(H2,DATE),POINTDOT,COLORYELLOW;
 平衡%50:REFDATE(H3,DATE),POINTDOT,COLORWHITE;
 回落%61:REFDATE(H4,DATE),POINTDOT,COLORYELLOW;
 次低%80:REFDATE(H5,DATE),POINTDOT,COLORYELLOW;
 DRAWTEXT(ISLASTBAR,疯牛%19.8,'疯牛%19.8'),COLOR00FFFF;
 DRAWTEXT(ISLASTBAR,突破%38.2,'突破%38.2'),COLOR00FFFF;
 DRAWTEXT(ISLASTBAR,平衡%50,'平衡'),COLOR00FFFF;
 DRAWTEXT(ISLASTBAR,回落%61.8,'回落%61.8'),COLOR00FFFF;
 DRAWTEXT(ISLASTBAR,次低%80.9,'次低%80.9'),COLOR00FFFF;
 
 突破:REF(EMA(C,14),1)COLORMAGENTA,LINETHICK2;
  A1X:=(EMA(C,14)-突破)/突破*100,NODRAW;
  出击:IF(A1X>=0,REF(EMA(C,14),BARSLAST(CROSS(A1X,0))+1),DRAWNULL)COLORRED,LINETHICK2;
  休假:IF(A1X<0,REF(EMA(C,14),BARSLAST(CROSS(0,A1X))+1),DRAWNULL)COLORGREEN,LINETHICK2;
  STICKLINE(A1X>=0,出击,突破,0,-1)COLORRED;
  STICKLINE(A1X<0,休假,突破,0,-1)COLORGREEN;
  STICKLINE(CROSS(A1X,0),C,O,2,0)COLORYELLOW;
  STICKLINE(CROSS(0,A1X),C,O,2,0)COLORGREEN;
  ※:IF(A1X<0,突破,DRAWNULL)COLORGREEN,LINETHICK2;
  DP:=REF(EMA(INDEXC,14),1);
  DPX:=(EMA(INDEXC,14)-DP)/DP*100;
  STICKLINE(DPX>=0 AND A1X>=0,REFDATE(低1,DATE),REFDATE(低1,DATE)*0.98,2,1)COLORRED;
  STICKLINE(DPX<0 AND A1X<0,REFDATE(低1,DATE),REFDATE(低1,DATE)*0.98,2,1)COLORGREEN;
  STICKLINE(NOT(DPX>=0 AND A1X>=0) AND NOT(DPX<0 AND A1X<0),REFDATE(低1,DATE),REFDATE(低1,DATE)*0.98,2,1)COLORYELLOW;

126233341.png

126233341.png

回复

使用道具 举报

您需要登录后才可以回帖 登录 | 立即注册

本版积分规则