xmd79

MULTIRSI+2022 By BD

Sep 24th, 2021
159
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 4.62 KB | None | 0 0
  1. // This source code is subject to the terms of the Mozilla Public License 2.0 at https://mozilla.org/MPL/2.0/
  2. // © bilgindurmaz
  3.  
  4. //@version=4
  5.  
  6. study("MULTIRSI+2022 By BD", shorttitle="MR+22",resolution="")
  7.  
  8.  
  9. RSI1L = input(true , "RSI1" , inline="RSI1")
  10. RSI1_period = input(14 , "" , inline="RSI1", minval=1)
  11. RSI1_source = input(close , "" , inline="RSI1")
  12. RSI1_color = input(#363A45 , "" , inline="RSI1")
  13.  
  14. RSI1 = rsi(RSI1_source, RSI1_period)
  15. plot(RSI1L and RSI1? RSI1 : na, color=#363A45, linewidth=1, title= "RSI1")
  16.  
  17.  
  18. RSI1MAVW = input(true , "RSI1MAVW" ,inline="RSI1MAVW")
  19. fmal =input(0 , "" ,inline="RSI1MAVW")
  20. smal =input(1 , "" ,inline="RSI1MAVW")
  21.  
  22. tmal=fmal+smal
  23. Fmal=smal+tmal
  24. Ftmal=tmal+Fmal
  25. Smal=Fmal+Ftmal
  26.  
  27. M1= RSI1
  28. M2= wma(M1, smal)
  29. M3= wma(M2, tmal)
  30. M4= wma(M3, Fmal)
  31. M5= wma(M4, Ftmal)
  32. R1MAVW= wma(M5, Smal)
  33. col1= R1MAVW>R1MAVW[1]
  34. col2= R1MAVW<R1MAVW[1]
  35.  
  36. color = col1 ? #4CAF50 : col2 ? #FF5252 : #FFEB3B
  37.  
  38. plot(RSI1MAVW and R1MAVW ? R1MAVW : na, color=color, linewidth=1, title="R1MAVW")
  39.  
  40. ma(RSI1, length, type) =>
  41. type == "SMA" ? sma(RSI1, length) :
  42. type == "EMA" ? ema(RSI1, length) :
  43. type == "SMMA (RMA)" ? rma(RSI1, length) :
  44. type == "WMA" ? wma(RSI1, length) :
  45. type == "VWMA" ? vwma(RSI1, length) :
  46. na
  47.  
  48. show_ma1 = input(true , "RSI1 MA1" , inline="MA #1")
  49. ma1_type = input("SMA" , "" , inline="MA #1", options=["SMA", "EMA", "SMMA (RMA)", "WMA", "VWMA"])
  50. ma1_length = input(20 , "" , inline="MA #1", minval=1)
  51. ma1_color = input(#FF9800, "" , inline="MA #1")
  52. ma1 = ma(RSI1, ma1_length, ma1_type)
  53. plot(show_ma1 ? ma1 : na, color = ma1_color, title="MA №1")
  54.  
  55. show_ma2 = input(false , "RSI1 MA2" , inline="MA #2")
  56. ma2_type = input("SMA" , "" , inline="MA #2", options=["SMA", "EMA", "SMMA (RMA)", "WMA", "VWMA"])
  57. ma2_length = input(30 , "" , inline="MA #2", minval=1)
  58. ma2_color = input(#FF5252, "" , inline="MA #2")
  59. ma2 = ma(RSI1, ma2_length, ma2_type)
  60. plot(show_ma2 ? ma2 : na, color = ma2_color, title="MA №2")
  61.  
  62. /////////
  63.  
  64.  
  65. RSI2L = input(false , "RSI2" , inline="RSI2")
  66. RSI2_period = input(9 , "" , inline="RSI2", minval=1)
  67. RSI2_source = input(close , "" , inline="RSI2")
  68. RSI2_color = input(#787B86 , "" , inline="RSI2")
  69.  
  70. RSI2 = rsi(RSI2_source, RSI2_period)
  71. plot(RSI2L and RSI2? RSI2 : na, color=#787B86, linewidth=1, title= "RSI2")
  72.  
  73.  
  74. RSI2MAVW = input(false , "RSI2MAVW" ,inline="RSI2MAVW")
  75. a1 = input(0 , "" ,inline="RSI2MAVW")
  76. a2 = input(1 , "" ,inline="RSI2MAVW")
  77.  
  78. a3=a1+a2
  79. a4=a2+a3
  80. a5=a3+a4
  81. a6=a4+a5
  82.  
  83. M21= RSI2
  84. M22= wma(M21, a2)
  85. M23= wma(M22, a3)
  86. M24= wma(M23, a4)
  87. M25= wma(M24, a5)
  88. R2MAVW= wma(M25, a6)
  89. col21= R2MAVW>R2MAVW[1]
  90. col22= R2MAVW<R2MAVW[1]
  91.  
  92.  
  93. color22 = col21 ? #4CAF50 : col22 ? #FF5252 : #FFEB3B
  94.  
  95. plot(RSI2MAVW and R2MAVW ? R2MAVW : na, color=color22, linewidth=1, title="R2MAVW")
  96.  
  97. mar(RSI2, length2, type2) =>
  98. type2 == "SMA" ? sma(RSI2, length2) :
  99. type2 == "EMA" ? ema(RSI2, length2) :
  100. type2 == "SMMA (RMA)" ? rma(RSI2, length2) :
  101. type2 == "WMA" ? wma(RSI2, length2) :
  102. type2 == "VWMA" ? vwma(RSI2, length2) :
  103. na
  104.  
  105. show_ma21 = input(false , "RSI2 MA1" , inline="MA #21")
  106. ma21_type = input("SMA" , "" , inline="MA #21", options=["SMA", "EMA", "SMMA (RMA)", "WMA", "VWMA"])
  107. ma21_length = input(20 , "" , inline="MA #21", minval=1)
  108. ma21_color = input(#00BCD4, "" , inline="MA #21")
  109. ma21 = mar(RSI2, ma21_length, ma21_type)
  110. plot(show_ma21 ? ma21 : na, color = ma21_color, title="MA №21")
  111.  
  112. show_ma22 = input(false , "RSI2 MA2", inline="MA #22")
  113. ma22_type = input("SMA" , "" , inline="MA #22", options=["SMA", "EMA", "SMMA (RMA)", "WMA", "VWMA"])
  114. ma22_length = input(30 , "" , inline="MA #22", minval=1)
  115. ma22_color = input(#2196F3, "" , inline="MA #22")
  116. ma22 = mar(RSI2, ma22_length, ma22_type)
  117. plot(show_ma22 ? ma22 : na, color = ma22_color, title="MA №22")
  118.  
  119. ////////
  120.  
  121. p1=hline(70, color=#FF9800, linestyle=hline.style_dashed, linewidth=1)
  122. p2=hline(60, color=#FF5252, linestyle=hline.style_dashed, linewidth=1)
  123. hline(50, color=#9C27B0, linestyle=hline.style_dotted, linewidth=1)
  124. p3=hline(40, color=#4CAF50, linestyle=hline.style_dashed, linewidth=1)
  125. p4=hline(30, color=#00E676, linestyle=hline.style_dashed, linewidth=1)
  126.  
  127. fill(p1,p2, color=color.new(color.red, 88), title="sel area")
  128. fill(p3,p4, color=color.new(color.green, 88), title="buy area")
Advertisement
Add Comment
Please, Sign In to add comment