叠加了下面4种指标,macd会自动远离最新价

[复制链接]
查看447 | 回复0 | 2022-7-24 09:10:01 | 显示全部楼层 |阅读模式

810188033.png

810188033.png

叠加了下面4种指标,macd会自动远离最新价,送有缘人
macd.macd  
kdj   
bbi  
sar
 

 

C/C++ Code复制内容到剪贴板
  1. {及时雨}   
  2. {可见K线 N=75条}; N=75;   
  3. {可见K线 最高价}; HH:=CONST(HHV(H,N));   
  4. {可见K线 最低价}; LL:=CONST(LLV(L,N));   
  5. {可见K线 中间价}; MM:=CONST(HH/2+LL/2);   
  6. {最后    收盘价}; CC:=CONST(C),CROSSDOT;   
  7. {浮动线&0.2差值}; YY:=CONST(IF(CC>=MM,LL-(HH-LL)*0.2,HH+(HH-LL)*0.2)),POINTDOT;   
  8. {MACD:-----------------------------------------------------------------};   
  9. {MACD    原参数}; DIF:=EMA(CLOSE,12)-EMA(CLOSE,26);   
  10. {MACD    原参数}; DEA:=EMA(DIF,9);   
  11. {MACD    原参数}; MACD:=(DIF-DEA)*2,COLORSTICK;   
  12. {MACD N内最高线}; MHH:=CONST(HHV(MACD,N));   
  13. {MACD N内最低线}; MLL:=CONST(LLV(MACD,N));   
  14. {MACD N内均顶底}; MMM0:=MHH/2-MLL/2; MMM:=IF(MMM0<(HH-LL)*0.1,(HH-LL)*0.1,MMM0);   
  15. {浮动线  灰衬底}; STICKLINE(0=0,YY+MMM,YY-MMM,5,0),COLOR444444;   
  16. {浮动线上红MACD}; STICKLINE(MACD>=0,YY,YY-MACD,2,0),COLORRED; {颠倒图};   
  17. {浮动线下蓝MACD}; STICKLINE(MACD<0, YY,YY-MACD,2,0),COLORCYAN; {颠倒图};   
  18. {KDJ3------------------------------------------------------------------};   
  19. {KDJ3   原参数}; RSV:=((CLOSE-LLV(LOW,13))/(HHV(HIGH,13)-LLV(LOW,13))-0.5)/100;   
  20. {KDJ3   原参数}; K:=SMA(RSV,4,1);   
  21. {KDJ3   原参数}; D:=SMA(K,4,1);   
  22. {KDJ3   原参数}; J:=3*K-2*D;   
  23. {浮动线上 取J值}; JJ:=(J/0.005)*MMM;{放在MACD后面};   
  24. {浮动线上 画J线}; STICKLINE(J>REF(J,1),YY+REF(JJ,1),YY+JJ,2.0,0),COLORMAGENTA;   
  25. {浮动线上 画J线}; STICKLINE(J<REF(J,1),YY+REF(JJ,1),YY+JJ,2.0,0),COLORGREEN;   
  26. {SAR-------------------------------------------------------------------};   
  27. {SAR 快下抛物线}; SAR1:=IF(CLOSE<SAR(2,3,10),SAR(2,3,10),0);   
  28. {SAR 下行抛物线}; SAR2:=IF(CLOSE<SAR(4,2,20),SAR(4,2,20),0);   
  29. {SAR 快上抛物线}; SARE:=IF(CLOSE>SAR(3,3,20),SAR(3,3,20),0);   
  30. {SAR 上行抛物线}; SARA:=IF(CLOSE>SAR(4,2,10),SAR(4,2,10),0);   
  31. {SAR 合画抛物线}; 空仓:IF(MIN(SAR1,SAR2)>0,(SAR1+SAR2)/2,IF(SAR1+SAR2=0,DRAWNULL,SAR1+SAR2)),CIRCLEDOT,COLORGREEN;   
  32. {SAR 合画抛物线}; 持股:IF(MIN(SARE,SARA)>0,(SARE+SARA)/2,IF(SARE+SARA=0,DRAWNULL,SARE+SARA)),CIRCLEDOT,COLORMAGENTA;   
  33. {MA--------------------------------------------------------------------};   
  34. {MA1   收盘价线}; MA1:C,COLORYELLOW,NODRAW;   
  35. {MA3天均线:4K价}; MA3:MA(((3*C+L+O+H)/6),3),COLORYELLOW,NODRAW;    
  36. {MA3上穿SAR提示}; {DRAWICON(CROSS(MA3,SAR(4,2,20))=1,SAR(4,2,20),7);};   
  37. {MA3下穿SAR提示}; {DRAWICON(CROSS(SAR(4,2,20),MA3)=1,SAR(4,2,20),8);};   
  38. {BBI-------------------------------------------------------------------};   
  39. {BBI      1天线}; BBI:(MA(C,3)+MA(C,6)+MA(C,12)+MA(C,24))/4,COLORWHITE;   
  40. {BB5      5天线}; BB5:(MA(C,15)+MA(C,30)+MA(C,60)+MA(C,120))/4,COLORWHITE;   
  41. {BB5   上行变红}; IF(C>BB5,BB5,DRAWNULL),COLORRED;   
  42. {BB5   下行变蓝}; IF(C<BB5,BB5,DRAWNULL),COLORCYAN;   
  43. {重影指示--------------------------------------------------------------};   
  44. {MACD    取高点}; MH:=IF(MACD<0,-MACD,0);   
  45. {MACD    取低点}; ML:=IF(MACD>0,-MACD,0);   
  46. {JJ      取高点}; JJH:=IF(REF(JJ,1)>JJ,REF(JJ,1),JJ);   
  47. {JJ      取低点}; JJL:=IF(REF(JJ,1)<JJ,REF(JJ,1),JJ);   
  48. {重叠区  取高点}; Z1:=IF(JJH>ML AND JJH<MH,JJH,IF(JJH>=MH,MH,DRAWNULL));   
  49. {重叠区  取低点}; Z2:=IF(JJL>ML AND JJL<MH,JJL,IF(JJL<=ML,ML,DRAWNULL));   
  50. {重叠区  画蓝条}; STICKLINE(0=0,YY+Z1,YY+Z2,0.1,0),COLORBLUE;   
  51.   
  52. DRAWTEXT(BACKSET(C>BB5,CURRBARSCOUNT)=1 AND CURRBARSCOUNT=16,IF(CC>MM,LL,HH),'收BB5上,还有好市'),COLORRED;   
  53. DRAWTEXT(BACKSET(C<BB5,CURRBARSCOUNT)=1 AND CURRBARSCOUNT=16,IF(CC>MM,LL,HH),'收BB5下,保本要紧'),COLORLIBLUE;   
  54.   
  55. DRAWTEXT(CURRBARSCOUNT=16 AND BACKSET(C>BB5,CURRBARSCOUNT)=1 AND BACKSET(CROSS(MA1,BBI)=1,CURRBARSCOUNT)=1,IF(CC>MM,LL,HH),'收BB5上,上穿BBI'),COLORRED;   
  56.   
  57. DRAWICON(CROSS(DIF,DEA), YY-MMM,1);   
  58. DRAWICON(CROSS(DEA,DIF), YY+MMM,2);   

 

回复

使用道具 举报

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

本版积分规则