分享

通达信主图指标盘整突破(附源码)

 股海为家 2023-05-21 发布于广东
  1. {N:1,111,5}   

  2. ZGD:=HHV(H,50);   

  3. ZGD2:=CONST(ZGD)*1.05;   

  4. ZDD:=LLV(L,50);   

  5. ZDD2:=CONST(ZDD)*0.95;   

  6. DRAWBAND(ZGD2,RGB(100,100,100),ZDD2,RGB(00,00,00));   

  7. GJ:=(C+H+L+O)/4;   

  8. 明日阻力:L+(GJ-L)+(C-L);   

  9. 明日支撑:L+(C-GJ);   

  10. 今日阻力:REF(明日阻力 , 1),NODRAW;   

  11. 今日支撑:REF(明日支撑 , 1),NODRAW;   

  12. 下档线:=(((CLOSE - LLV(LOW,13)) / (HHV(HIGH,13) - LLV(LOW,13))) * 100);   

  13. RRRSV:=SMA(下档线,3,1);   

  14. KKK:=SMA(RRRSV,3,1);   

  15. DDDDD:=((3 * RRRSV) - (2 * KKK));   

  16. JJ12:=(((CLOSE - LLV(LOW,55)) / (HHV(HIGH,55) - LLV(LOW,55))) * 100);   

  17. RSV24:=SMA(JJ12,3,1);   

  18. K24:=SMA(RSV24,3,1);   

  19. D24:=((3 * RSV24) - (2 * K24));   

  20. 压力2:=IF(CROSS(D24,DDDDD),HIGH,REF(HIGH,BARSLAST(CROSS(D24,DDDDD)))),COLORFFFFFF;   

  21. 压力位:IF(ISLASTBAR,压力2,DRAWNULL),NODRAW;   

  22. 底部:=LLV(HIGH,30),COLOR00FF00;   

  23. 底部位:IF(ISLASTBAR,底部,DRAWNULL),NODRAW;   

  24. AA:=REF(H,N)=HHV(H,2*N+1);   

  25. QY:=BACKSET(AA,N+1);   

  26. CC:=FILTER(QY,N) AND H=HHV(H,N+1);   

  27. DDD:BARSLAST(CC),NODRAW;   

  28. GDTS:IF(CC,CURRBARSCOUNT,0),NODRAW;   

  29. DINGBUTS:IF(DDD,REF(GDTS,DDD),GDTS),NODRAW;   

  30. GDCS1:CONST(DINGBUTS),NODRAW;   

  31. GDCS13:=CONST(REF(HIGH,GDCS1-1));   

  32. DINGBUTS1:REF(DINGBUTS,DDD+1),NODRAW;   

  33. GDCS2:=CONST(DINGBUTS1);   

  34. GDCS23:=CONST(REF(HIGH,DINGBUTS1-1));   

  35. XG1:=BACKSET(ISLASTBAR,GDCS1);   

  36. XG2:=BACKSET(ISLASTBAR,DINGBUTS1);   

  37. 高点压力:=DRAWLINE(CURRBARSCOUNT=GDCS2,H,CURRBARSCOUNT=GDCS1,H,1) ,COLORBLUE,LINETHICK1;   

  38. AA1:=REF(L,N)=LLV(L,2*N+1);   

  39. QY1:=BACKSET(AA1,N+1);   

  40. CC1:=FILTER(QY1,N) AND L=LLV(L,N+1);   

  41. DD1:=BARSLAST(CC1);   

  42. DDTS:=IF(CC1,CURRBARSCOUNT,0);   

  43. DDTS1:=IF(DD1,REF(DDTS,DD1),DDTS);   

  44. DDCS1:=CONST(DDTS1);   

  45. DDCS13:=CONST(REF(L,DDCS1-1));   

  46. DDTS2:=REF(DDTS1,DD1+1);   

  47. DDCS2:=CONST(DDTS2);   

  48. DDCS23:=CONST(REF(L,DDTS2-1));   

  49. XD1:=BACKSET(ISLASTBAR,DDCS1);   

  50. XD2:=BACKSET(ISLASTBAR,DDTS2);   

  51. 低点支撑:=DRAWLINE(CURRBARSCOUNT=DDCS2,L,CURRBARSCOUNT=DDCS1,L,1),COLORBLUE,LINETHICK1;   

  52. DRAWBAND(高点压力,RGB(00,00,100),低点支撑,RGB(00,00,00));   

  53. ZGSTAR:=(高点压力+低点支撑)/2;   

  54. ZGEND:=CONST((高点压力+低点支撑)/2);   

  55. STARDAY:=IF(DDCS2<GDCS2,DDCS2,GDCS2);   

  56. 中轨:DRAWLINE(CURRBARSCOUNT=STARDAY,ZGSTAR,ISLASTBAR,ZGEND,1),COLOR555555,LINETHICK1;   

  57. M:=INTPART(3*N/5);   

  58. AAA:=REF(H,M)=HHV(H,2*M+1);   

  59. QYY:=BACKSET(AAA,M+1);   

  60. CCC:=FILTER(QYY,M) AND H=HHV(H,M+1);   

  61. DDDD:=BARSLAST(CCC),NODRAW;   

  62. GDTSS:=IF(CCC,CURRBARSCOUNT,0),NODRAW;   

  63. DINGBUTSS:=IF(DDDD,REF(GDTSS,DDDD),GDTSS),NODRAW;   

  64. GDCS11:=CONST(DINGBUTSS),NODRAW;   

  65. DINGBUTS11:REF(DINGBUTSS,DDDD+1),NODRAW;   

  66. GDCS22:=CONST(DINGBUTS11);   

  67. 高点压力M:DRAWLINE(CURRBARSCOUNT=GDCS22,H,CURRBARSCOUNT=GDCS11,H,1),COLORRED,LINETHICK1;   

  68. AA11:=REF(L,M)=LLV(L,2*M+1);   

  69. QY11:=BACKSET(AA11,M+1);   

  70. CC11:=FILTER(QY11,M) AND L=LLV(L,M+1);   

  71. DD11:=BARSLAST(CC11);   

  72. DDTSS:=IF(CC11,CURRBARSCOUNT,0);   

  73. DDTS11:=IF(DD11,REF(DDTSS,DD11),DDTSS);   

  74. DDCS11:=CONST(DDTS11);   

  75. DDTS22:=REF(DDTS11,DD11+1);   

  76. DDCS22:=CONST(DDTS22);   

  77. 低点支撑M:DRAWLINE(CURRBARSCOUNT=DDCS22,L,CURRBARSCOUNT=DDCS11,L,1) COLORRED,LINETHICK1;   

  78. STICKLINE(XG2,GDCS23,GDCS23,0.5,1),COLORWHITE,LINETHICK3;   

  79. STICKLINE(XG1,GDCS13,GDCS13,0.5,1),COLORYELLOW,LINETHICK3;   

  80. STICKLINE(XD2,DDCS23,DDCS23,0.5,1),COLORMAGENTA,LINETHICK3;   

  81. STICKLINE(XD1,DDCS13,DDCS13,0.5,1),COLORCYAN,LINETHICK3;   

  82. STICKLINE(ISLASTBAR AND C>=今日阻力,今日阻力,今日阻力,10,1),LINETHICK2,COLOR0000FF;   

  83. STICKLINE(ISLASTBAR AND C<今日阻力,今日阻力,今日阻力,10,1),LINETHICK2,COLOR00FF00;   

  84. STICKLINE(ISLASTBAR AND C>=今日支撑,今日支撑,今日支撑,10,1),LINETHICK2,COLORFF00FF;   

  85. STICKLINE(ISLASTBAR AND C<今日支撑,今日支撑,今日支撑,10,1),LINETHICK2,COLORFF8800;   

  86. STICKLINE(ISLASTBAR ,压力位,压力位,120,0),LINETHICK4,COLORFFFFFF;   

  87. STICKLINE(ISLASTBAR ,底部位,底部位,100,0),LINETHICK4,COLOR00FF00;   

  88. MA1:MA(CLOSE,5);   

  89. MA2:MA(CLOSE,10);   

  90. MA3:MA(CLOSE,20);   

  91. MA4:MA(CLOSE,60);   

  92. DRAWKLINE(H,O,L,C);   

  93. **********************************************************************************   

  94. {VOL}   

  95. 日换:V/CAPITAL*100,LINETHICK0;   

  96. HS:=V/CAPITAL*100;   

  97. 三换:SUM(HS,3),COLORFFFFFF,LINETHICK2;   

  98. 五换:SUM(HS,5),COLORFFFFFF,LINETHICK2;   

  99. 百日总:=SUM(V,100);   

  100. 百日换:百日总/CAPITAL*100,LINETHICK0;   

  101. 量:=VOL/((HIGH-LOW)*2-ABS(CLOSE-OPEN));   

  102. 买量:=IF(CLOSE>OPEN,量*(HIGH-LOW),IF(CLOSE<OPEN,量*((HIGH-OPEN)+(CLOSE-LOW)),VOL/2)),LINETHICK0;   

  103. 卖量:=(IF(CLOSE>OPEN,0-量*((HIGH-CLOSE)+(OPEN-LOW)),IF(CLOSE<OPEN,0-量*(HIGH-LOW),0-VOL/2)))*-1,LINETHICK0;   

  104. 总量:=买量+卖量,LINETHICK0;   

  105. 净量:=买量-卖量,LINETHICK0;   

  106. 主动买万:买量/10000,COLORRED,NODRAW;   

  107. 主动卖万:卖量/10000,COLORGREEN,NODRAW;   

  108. 总手:主动买万+主动卖万,LINETHICK0;   

  109. 总净:主动买万-主动卖万,LINETHICK0;   

  110. MAA:=MA( CLOSE ,2) ;   

  111. STICKLINE(C>MAA,总量,1,4,1 ),COLOR00FFFF;   

  112. STICKLINE(C<MAA,总量,1,4,1 ),COLORFF00FF;   

  113. STICKLINE(净量<0,1,总量,4,1),COLORFFFF00;   

  114. STICKLINE(C<MAA AND 净量>0,净量,1,4,1 ),COLOR0000FF;   

  115. STICKLINE(V>=2*REF(V,1),1,总量,4,1),COLOR0000FF;   

  116. STICKLINE(总量>1,总量,0,2.8,0),COLOR353500;   

  117. STICKLINE(总量>1,总量,0,2,0),COLOR555500;   

  118. STICKLINE(总量>1,总量,0,1,0),COLOR757500;   

  119. STICKLINE(总量>1,总量,0,0.1,0),COLOR959500;   

  120. STICKLINE(买量>0,0,买量,2.8,0),COLOR000099;   

  121. STICKLINE(买量>0,0,买量,2,0),COLOR0000AA;   

  122. STICKLINE(买量>0,0,买量,1,0),COLOR0000FF;   

  123. STICKLINE(买量>0,0,买量,0.1,0),COLORCC00FF;   

  124. STICKLINE(净量>0,0,净量,2.8,0),COLOR0033FF;   

  125. STICKLINE(净量>0,0,净量,2,0),COLOR0077FF;   

  126. STICKLINE(净量>0,0,净量,1,0),COLOR00BBFF;   

  127. STICKLINE(净量>0,0,净量,0.1,0),COLOR00FFFF;   

  128. STICKLINE(净量<0,1,净量,3.8,1),COLORFFFF00;   

  129. STICKLINE(净量<0,0,净量,3,0),COLOR005500;   

  130. STICKLINE(净量<0,0,净量,2,0),COLOR009900;   

  131. STICKLINE(净量<0,0,净量,1,0),COLOR00BB00;   

  132. STICKLINE(净量<0,0,净量,0.1,0),COLOR00FF00;   

  133. STICKLINE(C<MAA AND 净量>0,净量,0,2.8,0 ),COLOR777777;   

  134. STICKLINE(C<MAA AND 净量>0,净量,0,2,0 ),COLOR999999;   

  135. STICKLINE(C<MAA AND 净量>0,净量,0,1,0 ),COLORBBBBBB;   

  136. STICKLINE(C<MAA AND 净量>0,净量,0,0.1,0 ),COLORFFFFFF;   

  137. MA5:MA(VOL,5);   

  138. MA10:MA(VOL,10);   

  139. MA20:MA(VOL,20),COLOR00FFFF;    

  140. DRAWICON(CROSS(MA5,MA10),(MA5 - 0.01),11);   

  141. DRAWICON(CROSS(MA10,MA5),MA10,12);   

  142. N:=35;N1:=35;   

  143. 今V:=总量/10000;   

  144. 昨V:=REF(V,1)/10000;   

  145. 中点:=REFDATE(HHV(V,N)/2,DATE);   

  146. DRAWTEXT(CURRBARSCOUNT=N,中点*1.3,'昨比量能:'),COLORDD00FF;   

  147. STICKLINE(CURRBARSCOUNT=N1,中点*1.88,中点*1.52,昨V,0),COLORFF3300;   

  148. STICKLINE(CURRBARSCOUNT=N1,中点*1.82,中点*1.58,昨V,0),COLORFF7700;   

  149. STICKLINE(CURRBARSCOUNT=N1,中点*1.76,中点*1.64,昨V,0),COLORFF9900;   

  150. STICKLINE(CURRBARSCOUNT=N1,中点*1.7,中点*1.7,昨V,0),COLORFFDD00;   

  151. STICKLINE(CURRBARSCOUNT=N1,中点*1.76,中点*1.64,今V,0),COLOR0099FF;   

  152. STICKLINE(CURRBARSCOUNT=N1,中点*1.7,中点*1.7,今V,0),COLOR00DDFF;   

    转藏 分享 献花(0

    0条评论

    发表

    请遵守用户 评论公约