xmd79

MrtComboV1.2

Sep 25th, 2021
251
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 4.15 KB | None | 0 0
  1.  
  2. // © adnanmurat
  3. //@version=4
  4. study("MrtComboV1.2", shorttitle="MrtComboV1.2")
  5. CCI = input(true, title="CCI line")
  6. ccilength=input(34, "CCI lenght")
  7. wmalength=input(13, title="CCI soft ")
  8. v4=0.1*(cci(close, ccilength)/4)
  9. v3=wma(v4, wmalength)
  10. v1=(exp(2*v3)-1)/(exp(2*v3)+1)
  11. plot(v1, color=v1 > 0 ? color.lime : color.red, linewidth=2, style=plot.style_area, display=display.all, title="DRSI-buy-sell",transp=85)
  12. period_ = input(21, title="Vortex lenght", minval=2)
  13. VMA = sum ( abs( high - low[1]), period_ )
  14. VMS = sum( abs ( low - high[1]), period_ )
  15. STR = sum( atr(1), period_ )
  16. v11 = VMA / STR
  17. v21 = VMS / STR
  18. src_fast = close
  19. len_fast = input(5, minval=1, title="DRSI-d fast")
  20. src_slow = close
  21. len_slow = input(14, minval=1, title="DRSI-d slow")
  22. up_fast = rma(max(change(src_fast), 0), len_fast)
  23. down_fast = rma(-min(change(src_fast), 0), len_fast)
  24. rsi_fast = down_fast == 0 ? 100 : up_fast == 0 ? 0 : 100 - 8 / (1 + up_fast / down_fast)
  25. up_slow = rma(max(change(src_slow), 0), len_slow)
  26. down_slow = rma(-min(change(src_slow), 0), len_slow)
  27. rsi_slow = down_slow == 0 ? 100 : up_slow == 0 ? 0 : 100 - 8 / (1 + up_slow / down_slow)
  28. d1 = rsi_fast - rsi_slow
  29. plot(d1, color=d1 > 0 ? color.lime : color.red, display=display.all, linewidth=2, title="DRSI-buy-sell")
  30. rsiSource = input(title="rsi source", type=input.source, defval=close)
  31. rsiLenght = input(title="rsi lenght", type=input.integer, defval=5)
  32. rsi = rsi(rsiSource, rsiLenght)
  33. len = input(21, minval=1, title="Length")
  34. high_ = highest(hl2, len)
  35. low_ = lowest(hl2, len)
  36. round_(val) => val > .99 ? .999 : val < -.99 ? -.999 : val
  37. value = 0.0
  38. value := round_(.66 * ((hl2 - low_) / max(high_ - low_, .001) - .5) + .67 * nz(value[1]))
  39. fish1 = 0.0
  40. fish1 := .5 * log((1 + value) / max(1 - value, .001)) + .5 * nz(fish1[1])
  41. fish2 = fish1[1]
  42. up5 = crossover(fish1, fish2) and fish1 < -1.5
  43. down5 = crossunder(fish1, fish2) and fish1 > 0
  44. fmal = input(3, "First Average length"), smal = input(1, "Second Average length")
  45. tmal = fmal + smal, Fmal = smal + tmal, Ftmal = tmal + Fmal, Smal = Fmal + Ftmal
  46. M1 = wma(close, fmal),M2 = wma(M1, smal), M3 = wma(M2, tmal), M4 = wma(M3, Fmal), M5 = wma(M4, Ftmal), MAVW = wma(M5, Smal)
  47. col1 = MAVW > MAVW[1], col3 = MAVW < MAVW[1]
  48. MI = input(true, title="BS")
  49. l1 = close > MAVW and close[1] <= MAVW[1], s1 = close < MAVW and close[1] >= MAVW[1]
  50. longCond = MI ? l1 : col1,
  51. shortCond = MI ? s1 : col3
  52. last_signal = 0
  53. long_op = longCond and (nz(last_signal[1]) == 0 or nz(last_signal[1]) == -1)
  54. long_cl = shortCond and (nz(last_signal[1]) == 0 or nz(last_signal[1]) == 1)
  55.  
  56. KJlength = input(26, "Kijunsen Length", minval=1)
  57. SBlength = input(52, "SenkouspanB Length", minval=1)
  58. KJ = avg(lowest(KJlength), highest(KJlength))
  59. SB = avg(lowest(SBlength), highest(SBlength))
  60. Buyi = crossover(KJ, SB[26])
  61. Selli = crossover(SB[26], KJ)
  62. cciup =input(title="Trigger cciup", defval=0.3)
  63. ccidown = input(title="Trigger ccidown", defval=-0.4)
  64. vortexBlue = input(title="Trigger vortexBlue", defval=1.1)
  65. vortexRed =input(title="Trigger vortexRed", defval=1.08)
  66. rrsiup = input(title="Trigger RSI long_o", defval=62)
  67. rrsidown = input(title="Trigger RSI long_o", defval=50)
  68. p10 = input(title="Plot adjustment", defval= 0.4)
  69. p11 = v1 + d1
  70. p13 = v1 > 0
  71. p14 = d1 > 0
  72. p15 = v1 < 0
  73. p16 = d1 < 0
  74. p17 = p11 > p10
  75. // (rsi >= rrsiup) (rsi >= rrsidown)
  76. long_o = long_op
  77. long_c = long_cl
  78. Short_o = d1 < 0 and (v1<=ccidown and v21>=vortexRed) and down5 or long_cl and rrsiup // ikinci logn close sonrası
  79. Short_c = d1 > 0 and v21>=vortexRed and (up5 or long_op) and rrsidown
  80. plotshape(long_o, title="Long Open", text="Open", location=location.bottom, style=shape.arrowup, size=size.auto, color=color.green, textcolor=color.white)
  81. plotshape(long_c, title="Long Close", text="Close", location=location.top, style=shape.arrowdown, size=size.auto, color=color.red, textcolor=color.white)
  82. //plotshape(Short_o, title="Short Open", text="Short", location=location.top, style=shape.arrowdown, size=size.auto, color=color.red, textcolor=color.white)
  83. //plotshape(Short_c, title="Short Close", text="Short", location=location.bottom, style=shape.arrowup, size=size.normal, color=color.red, textcolor=color.white)
  84.  
Advertisement
Add Comment
Please, Sign In to add comment