紫开多红.AICOIN 5.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148
  1. // @version=2
  2. // 在这里创建您的自定义脚本
  3. // RSV:=(CLOSE-LLV(LOW,5))/(HHV(HIGH,5)-LLV(LOW,5))*100;
  4. RSV = (close - lowest(low, 5)) / (highest(high, 5) - lowest(low, 5)) * 100;
  5. // K0:=SMA(RSV,3,1);
  6. K0 = smma(RSV, 3, 1);
  7. // K:=K0;D:=SMA(K0,2,1);
  8. K = K0;
  9. D = smma(K0, 2, 1);
  10. // J1:(3*K0-2*D),COLORYELLOW;J2:=MA(J1,2);
  11. J1 = (3 * K0 - 2 * D);
  12. plot(J1, title='J1', color='yellow');
  13. J2 = ma(J1, 2);
  14. //MAV:=(2*C+H+L)/4;
  15. MAV = (2 * close + high + low) / 4;
  16. // VR1:=LLV(LOW,21);
  17. VR1 = lowest(low, 21);
  18. // VR2:=HHV(HIGH,21);
  19. VR2 = highest(high, 21);
  20. // SK: EMA((MAV-VR1)/(VR2-VR1)*100,8),COLORWHITE;
  21. SK = ema((MAV - VR1) / ( VR2 - VR1) * 100,8);
  22. plot(SK, title='SK', color='white');
  23. // SD: EMA(0.667*REF(SK,1)+0.333*SK,1),COLORCYAN;
  24. SD = ema(0.667 * SK[1] + 0.333 * SK, 1);
  25. plot(SD, title='SD', color='cyan');
  26. // SJ:=3*SK-2*SD;
  27. SJ = 3 * SK - 2 * SD;
  28. // A1:=REF(CLOSE,2);
  29. A1 = close[2];
  30. // A2:=SMA(MAX(CLOSE-A1,0),7,1)/SMA(ABS(CLOSE-A1),7,1)*100;
  31. A2 = smma(max(close - A1, 0), 7, 1) / sma(abs(close - A1), 7, 1) * 100;
  32. // 波段介入点:IF(A2<19,19,0),COLORWHITE;
  33. 波段介入点 = A2 < 19 ? 19 : 0
  34. plot(波段介入点, title='波段介入点', color='white');
  35. // VAR1:=REF((LOW+OPEN+CLOSE+HIGH)/4,1);
  36. VAR1 = (low[1] + open[1] + close[1] + high[1]) / 4;
  37. // VAR2:=SMA(ABS(LOW-VAR1),13,1)/SMA(MAX(LOW-VAR1,0),10,1);
  38. VAR2 = smma(abs(low - VAR1), 13, 1) / smma(max(low - VAR1, 0), 10, 1);
  39. // VAR3:=EMA(VAR2,10);
  40. VAR3 = ema(VAR2, 10);
  41. // plot(VAR3, title='VAR3', color='red');
  42. // VAR4:=LLV(LOW,33);
  43. VAR4 = lowest(low, 33);
  44. // plot(VAR4, title='VAR4', color='red');
  45. // VAR5:=EMA(IF(LOW<=VAR4,VAR3,0),3);
  46. VAR5 = ema(low <= VAR4 ? VAR3 : 0, 3);
  47. // plot(VAR5, title='VAR5', color='red');
  48. // 主力进场:IF(VAR5>REF(VAR5,1),VAR5,0),LINETHICK0,COLORRED;
  49. 主力进场 = VAR5 > VAR5[1] ? VAR5 : 0;
  50. plot(主力进场, title='主力进场', color='red');
  51. show_var5 = VAR5 > VAR5[1];
  52. // STICKLINE(VAR5>REF(VAR5,1),0,VAR5,6,0),COLORRED;
  53. plotColumn(VAR5, title='VAR5', color='red', fill=true, display=show_var5);
  54. // STICKLINE(VAR5>REF(VAR5,1),0,VAR5,5,0 ),COLOR000055;
  55. plotColumn(VAR5, title='VAR5', color='000055', fill=true, display=show_var5);
  56. // STICKLINE(VAR5>REF(VAR5,1),0,VAR5,4,0 ),COLOR000077;
  57. plotColumn(VAR5, title='VAR5', color='000077', fill=true, display=show_var5);
  58. // STICKLINE(VAR5>REF(VAR5,1),0,VAR5,3.1,0 ),COLOR000099;
  59. plotColumn(VAR5, title='VAR5', color='000099', fill=true, display=show_var5);
  60. // STICKLINE(VAR5>REF(VAR5,1),0,VAR5,2.5,0 ),COLOR0000BB;
  61. plotColumn(VAR5, title='VAR5', color='0000BB', fill=true, display=show_var5);
  62. // STICKLINE(VAR5>REF(VAR5,1),0,VAR5,1.5,0 ),COLOR0000DD;
  63. plotColumn(VAR5, title='VAR5', color='0000DD', fill=true, display=show_var5);
  64. // STICKLINE(VAR5>REF(VAR5,1),0,VAR5,1,0 ),COLOR0000FF;
  65. plotColumn(VAR5, title='VAR5', color='0000FF', fill=true, display=show_var5);
  66. // 洗盘:IF(VAR5<REF(VAR5,1),VAR5,0),LINETHICK0,COLORGREEN;
  67. 洗盘 = VAR5 < VAR5[1] ? VAR5 : 0;
  68. plot(洗盘, title='洗盘', color='green');
  69. // STICKLINE(VAR5<REF(VAR5,1),0,VAR5,1,0),COLOR00FF00;
  70. plotColumn(VAR5, title='VAR5', color='red', fill=true, display=!show_var5);
  71. // VAR12:=SMA(ABS(VAR1-H),13,1)/SMA(MAX(VAR1-H,0),10,1);
  72. VAR12 = smma(abs(VAR1 - high), 13, 1) / smma(max(VAR1 - high, 0), 10, 1);
  73. // VAR13:=EMA(VAR12,10);
  74. VAR13 = ema(VAR12, 10);
  75. // VAR14:=HHV(H,33);
  76. VAR14 = highest(high, 33);
  77. // VAR15:=EMA(IF(H>=VAR14,VAR13,0),3);
  78. VAR15 = ema(high >= VAR14 ? VAR13 : 0, 3);
  79. // 冲顶:IF(VAR15>REF(VAR15,1),VAR15,0),LINETHICK0,COLORFF00FF;
  80. 冲顶 = VAR15 > VAR15[1] ? VAR15 : 0;
  81. plot(冲顶, title = '冲顶', color='FF00FF');
  82. show_var15 = VAR15 > VAR15[1];
  83. // STICKLINE(VAR15>REF(VAR15,1),0,VAR15,1,0 ),COLORFF00FF;
  84. plotColumn(VAR15, title='VAR15', color='red', fill=true, display=show_var15);
  85. // 主力出场:IF(VAR15<REF(VAR15,1),VAR15,0),LINETHICK0,COLORYELLOW;
  86. 主力出场 = VAR15 < VAR15[1] ? VAR15 : 0;
  87. plot(主力出场, title = '主力出场', color='yellow');
  88. // STICKLINE(VAR15<REF(VAR15,1),0,VAR15,1,0),COLOR00FFFF;
  89. plotColumn(VAR15, title='VAR15', color='green', fill=true, display=!show_var15);
  90. // X_1:=(CLOSE-MA(CLOSE,13))/MA(CLOSE,13)*20;
  91. X_1 =(close - ma(close, 13)) / ma(close, 13) * 20;
  92. // X_2:=(CLOSE-MA(CLOSE,4))/MA(CLOSE,4)*20;
  93. X_2 =(close - ma(close, 4)) / ma(close, 4) * 20;
  94. // 红柱:SMA(X_1,3,1),COLORRED,LINETHICK0;
  95. 红柱 = smma(X_1, 3, 1);
  96. plot(红柱, title = '红柱', color='red');
  97. // 蓝柱:SMA(X_2,3,1),COLORSTICK,COLORCYAN;
  98. 蓝柱 = smma(X_2, 3, 1);
  99. plot(蓝柱, title = '蓝柱', color='cyan');
  100. // STICKLINE(红柱<REF(红柱,0.5) AND 红柱>0,0,红柱,4,0),COLORRED;
  101. plotColumn(红柱, title='红柱', color='red', fill=true, display=(红柱 < 红柱[0.5] && 红柱 > 0));
  102. // STICKLINE(红柱<REF(红柱,1) AND 红柱>0,0,红柱,2,0),COLORGREEN;
  103. plotColumn(红柱, title='红柱', color='green', fill=true, display=(红柱 < 红柱[1] && 红柱 > 0));
  104. // STICKLINE(红柱>REF(红柱,1) AND 红柱>0,0,红柱,3,0),COLORRED;
  105. plotColumn(红柱, title='红柱', color='red', fill=true, display=(红柱 > 红柱[1] && 红柱 > 0));
  106. // STICKLINE(蓝柱<REF(蓝柱,1) AND 蓝柱>0,0,蓝柱,2,0),COLOR00DDFF;
  107. plotColumn(蓝柱, title='蓝柱', color='00DDFF', fill=true, display=(蓝柱 < 蓝柱[1] && 蓝柱 > 0));
  108. // STICKLINE(红柱>REF(红柱,1) AND 红柱<0,0,红柱,2,0),COLORFFDD00;
  109. plotColumn(红柱, title='红柱', color='FFDD00', fill=true, display=(红柱 > 红柱[1] && 红柱 < 0));
  110. // STICKLINE(红柱<REF(红柱,1) AND 红柱<0,0,红柱,3,0),COLORFFCC00;
  111. plotColumn(红柱, title='红柱', color='FFCC00', fill=true, display=(红柱 < 红柱[1] && 红柱 < 0));
  112. // STICKLINE(蓝柱>REF(蓝柱,1) AND 蓝柱<0,0,蓝柱,2,0),COLORMAGENTA;
  113. plotColumn(蓝柱, title='蓝柱', color='magenta', fill=true, display=(蓝柱 > 蓝柱[1] && 蓝柱 < 0));