xmd79

MrtComboV1.2

Sep 30th, 2021
284
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.37 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. fmal = input(3, "First Average length"), smal = input(1, "Second Average length")
  31. tmal = fmal + smal, Fmal = smal + tmal, Ftmal = tmal + Fmal, Smal = Fmal + Ftmal
  32. M1 = wma(close, fmal),M2 = wma(M1, smal), M3 = wma(M2, tmal), M4 = wma(M3, Fmal), M5 = wma(M4, Ftmal), MAVW = wma(M5, Smal)
  33. col1 = MAVW > MAVW[1], col3 = MAVW < MAVW[1]
  34. MI = input(true, title="BS")
  35. l1 = close > MAVW and close[1] <= MAVW[1], s1 = close < MAVW and close[1] >= MAVW[1]
  36. longCond = MI ? l1 : col1,
  37. shortCond = MI ? s1 : col3
  38. last_signal = 0
  39. long_op = longCond and (nz(last_signal[1]) == 0 or nz(last_signal[1]) == -1)
  40. long_cl = shortCond and (nz(last_signal[1]) == 0 or nz(last_signal[1]) == 1)
  41. cciup =input(title="Trigger cciup", defval=0.3)
  42. ccidown = input(title="Trigger ccidown", defval=-0.4)
  43. long_o = long_op
  44. long_c = long_cl
  45. plotshape(long_o, title="Long Open", text="Open", location=location.bottom, style=shape.arrowup, size=size.auto, color=color.green, textcolor=color.white)
  46. plotshape(long_c, title="Long Close", text="Close", location=location.top, style=shape.arrowdown, size=size.auto, color=color.red, textcolor=color.white)
  47.  
  48.  
Advertisement
Add Comment
Please, Sign In to add comment