Guest User

PDDRnotover

a guest
Jan 15th, 2020
113
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. //@version=3
  2. //
  3.  
  4. study(title='Price Divergence Detector V3.2 revised by JustUncleL', shorttitle='PDDR',overlay=false)
  5.  
  6. //
  7. // Revisions: V3 by JustUncleL
  8. // Original Author: RicardoSantos
  9. // Date: 4-Dec-2016
  10. //
  11. // Description:
  12. // Price Divergence detection for various methods : RSI, MACD, STOCH, VOLUME
  13. // ACC-DIST, FISHER, CCI, BB %B, Ehlers IdealRSI and Elders Force Index.
  14. //
  15. //
  16. // Mofidifications:
  17. //
  18. // 3.1 20-Aug-2017
  19. // - Added Trend Volume Accumulation, this option really works only well
  20. // with Renko and HA candles. You have the option to use EMA for trend
  21. // direction change instead of candle bull/bear direction.
  22. // 4-Aug-2017
  23. // - Added Elders Force Index
  24. // 3-Aug-2017
  25. // - Updated to version 3 of Pinescript.
  26. // - Updated with some RichardoSantos revisions.
  27. //
  28. // 3.0 - Added option to disable/enable Hidden and Regular Divergence
  29. // - Added new divergence method BB %B (close only)
  30. // - Added new divergence mothod Ehlers IdealRSI (close only)
  31. //
  32. // 2.0 - original by RicardoSantos
  33. //
  34. // References:
  35. // Information on Divergence Trading:
  36. // - http://www.babypips.com/school/high-school/trading-divergences
  37. // - http://www.incrediblecharts.com/indicators/bollinger_percentage_b_band_width.php (BB %B)
  38. //
  39.  
  40. // === INPUTS
  41.  
  42. // || General Input:
  43. method = input(defval='BB %B', options=['mom','RSI', 'MACD', 'Stochastic', 'Volume', 'Accumulation/Distribution', 'Fisher Transform', 'CCI', 'BB %B', 'Ideal RSI','Elders Force Index','Trend Acc Volume'])
  44. SHOW_LABEL = input(title='Show Labels', type=bool, defval=true)
  45. SHOW_CHANNEL = input(title='Show Channel', type=bool, defval=false)
  46. uHid = input(true,title="Show Hidden Divergence")
  47. uReg = input(true,title="Show Regular Divergence")
  48. uTVAma = input(false,title="Use EMA Trend direction for Trend Acc Volume")
  49. // || RSI / STOCH / VOLUME / ACC/DIST/ FISHER/ CCI/ BB %B Input/Elders Force Index:
  50. rsi_smooth = input(title="Length for Method (except MACD):", type=integer, defval=20)
  51. // || MACD Input:
  52. macd_src = input(title='MACD Source:', type=source, defval=close)
  53. macd_fast = input(title='MACD Fast:', type=integer, defval=12)
  54. macd_slow = input(title='MACD Slow:', type=integer, defval=26)
  55. macd_smooth = input(title='MACD Smooth Signal:', type=integer, defval=9)
  56. //
  57. high_src = input(high,title="High Source")
  58. low_src = input(low,title="Low Source")
  59.  
  60. // === /INPUTS
  61.  
  62.  
  63. // || Functions:
  64. f_top_fractal(_src)=>_src[4] < _src[2] and _src[3] < _src[2] and _src[2] > _src[1] and _src[2] > _src[0]
  65. f_bot_fractal(_src)=>_src[4] > _src[2] and _src[3] > _src[2] and _src[2] < _src[1] and _src[2] < _src[0]
  66. f_fractalize(_src)=>f_top_fractal(_src) ? 1 : f_bot_fractal(_src) ? -1 : 0
  67.  
  68. // ||••> START MACD FUNCTION
  69. f_macd(_src, _fast, _slow, _smooth)=>
  70. _fast_ma = sma(_src, _fast)
  71. _slow_ma = sma(_src, _slow)
  72. _macd = _fast_ma-_slow_ma
  73. _signal = ema(_macd, _smooth)
  74. _hist = _macd - _signal
  75. // ||<•• END MACD FUNCTION
  76.  
  77. // ||••> START ACC/DIST FUNCTION
  78. f_accdist(_smooth)=>_return=sma(cum(close==high and close==low or high==low ? 0 : ((2*close-low-high)/(high-low))*volume), _smooth)
  79. // ||<•• END ACC/DIST FUNCTION
  80.  
  81. // ||••> START FISHER FUNCTION
  82. f_fisher(_src, _window)=>
  83. _h = highest(_src, _window)
  84. _l = lowest(_src, _window)
  85. _value0 = 0.0
  86. _value0 := .66 * ((_src - _l) / max(_h - _l, .001) - .5) + .67 * nz(_value0[1])
  87. _value1 = _value0 > .99 ? .999 : _value0 < -.99 ? -.999 : _value0
  88. _fisher = 0.0
  89. _fisher := .5 * log((1 + _value1) / max(1 - _value1, .001)) + .5 * nz(_fisher[1])
  90. // ||<•• END FISHER FUNCTION
  91.  
  92. // Rolling Moving Average (or Wells Wilders MA)
  93. irma(p,l) =>
  94. irma = 0.0
  95. irma := (nz(irma[1]) * (l - 1) + p) / l
  96.  
  97.  
  98. // RSI function.
  99. irsi(p, l) =>
  100. up = irma(max(change(p), 0), l)
  101. down = irma(-min(change(p), 0), l)
  102. irsi = down == 0 ? 100 : up == 0 ? 0 : 100 - (100 / (1 + up / down))
  103. //
  104.  
  105. //
  106. // --- Start the Homodyne Discriminator Caculations
  107. //
  108. idealRSI(p) =>
  109. C1 = 0.0962
  110. C2 = 0.5769
  111. Df = 0.5
  112. Period = 0.0
  113. I2 = 0.0
  114. Q2 = 0.0
  115. Re = 0.0
  116. Im = 0.0
  117. SmoothPeriod = 0.0
  118. C3 = (nz(Period[1])*0.075+0.54)
  119. smooth = ((hl2*4.0) + (hl2[1]*3.0) + (hl2[2]*2.0) + (hl2[3]))/10.0
  120. dDeTrend = (smooth*C1 + nz(smooth[2])*C2 - nz(smooth[4])*C2 - nz(smooth[6])*C1)*C3
  121. Q1 = (dDeTrend*C1 + nz(dDeTrend[2])*C2 - nz(dDeTrend[4])*C2 - nz(dDeTrend[6])*C1)*C3
  122. I1 = nz(dDeTrend[3])
  123. jI = (I1*C1 + nz(I1[2])*C2 - nz(I1[4])*C2 - nz(I1[6])*C1)*C3
  124. jQ = (Q1*C1 + nz(Q1[2])*C2 - nz(Q1[4])*C2 - nz(Q1[6])*C1)*C3
  125. I2_ = I1 - jQ
  126. Q2_ = Q1 + jI
  127. I2 := 0.2*I2_ + 0.8*nz(I2[1])
  128. Q2 := 0.2*Q2_ + 0.8*nz(Q2[1])
  129. Re_ = I2*nz(I2[1]) + Q2*nz(Q2[1])
  130. Im_ = I2*nz(Q2[1]) - Q2*nz(I2[1])
  131. Re := 0.2*Re_ + 0.8*nz(Re[1])
  132. Im := 0.2*Im_ + 0.8*nz(Im[1])
  133. dp_ = iff(Re!=0 and Im!=0 , 6.28318/atan(Im/Re) , 0)
  134. II = nz(Period[1])
  135. dp = max(max(min(min(dp_,1.5*II),50),0.6667*II),6)
  136. Period := dp*0.2 + nz(Period[1])*0.8
  137. SmoothPeriod := 0.33*Period + nz(SmoothPeriod[1])*0.67
  138. rsiLen = round((SmoothPeriod*Df)-1) // Get variable RSI length from discriminator
  139. idealRSI = irsi(p,rsiLen) // Generate RSI.
  140.  
  141. // --- Bollinger Band Vdub BB %B
  142. pcBB(p,l) =>
  143. basis = sma(p, l)
  144. dev = 0.1*stdev(p, l)
  145. upper = basis + dev
  146. lower = basis - dev
  147. pcBB = (p - lower)/(upper - lower)
  148.  
  149. forceIndex(p,l) =>
  150. f = (p-p[1])*volume
  151. f
  152.  
  153. //Trend Volume Accumulation
  154. TVA(p,l) =>
  155. ma1 = ema(p,l) // Get the MA series
  156. direction = 0
  157. direction := uTVAma ? ( rising(ma1,3) ? 1 : falling(ma1,3)?-1 : nz(direction[1])) : ( (open<close)? 1 : open>close? -1 : nz(direction[1]) )
  158. tva = 0.0
  159. tva := direction>0? (nz(tva[1])>=0? nz(tva[1])+volume : volume) : direction<0 ? (nz(tva[1])<=0? nz(tva[1])-volume : -volume) : nz(tva[1])
  160. tva
  161.  
  162. //
  163. // === End of Functions.
  164.  
  165.  
  166. // || Method selection
  167. oscilator_high = na
  168. oscilator_low = na
  169. if method == 'RSI'
  170. oscilator_high := rsi(high_src, rsi_smooth)
  171. oscilator_low := rsi(low_src, rsi_smooth)
  172. if method == 'MACD'
  173. oscilator_high := f_macd(macd_src, macd_fast, macd_slow, macd_smooth)
  174. oscilator_low := f_macd(macd_src, macd_fast, macd_slow, macd_smooth)
  175. if method == 'Stochastic'
  176. oscilator_high := stoch(close, high, low, rsi_smooth)
  177. oscilator_low := stoch(close, high, low, rsi_smooth)
  178. if method == 'Volume'
  179. oscilator_high := sma(volume, rsi_smooth)
  180. oscilator_low := sma(volume, rsi_smooth)
  181. if method == 'mom'
  182. oscilator_high := mom(high_src, rsi_smooth)
  183. oscilator_low := mom(low_src, rsi_smooth)
  184. if method == 'Accumulation/Distribution'
  185. oscilator_high := f_accdist(rsi_smooth)
  186. oscilator_low := f_accdist(rsi_smooth)
  187. if method == 'Fisher Transform'
  188. oscilator_high := f_fisher(high_src, rsi_smooth)
  189. oscilator_low := f_fisher(low_src, rsi_smooth)
  190. if method == 'CCI'
  191. oscilator_high := cci(high_src, rsi_smooth)
  192. oscilator_low := cci(low_src, rsi_smooth)
  193. if method == 'BB %B'
  194. oscilator_high := pcBB(high_src, rsi_smooth)
  195. oscilator_low := pcBB(low_src, rsi_smooth)
  196. if method == 'Ideal RSI'
  197. oscilator_high := idealRSI(high_src)
  198. oscilator_low := idealRSI(low_src)
  199. if method == 'Elders Force Index'
  200. oscilator_high := forceIndex(high_src,rsi_smooth)
  201. oscilator_low := forceIndex(low_src,rsi_smooth)
  202. if method == 'Trend Acc Volume'
  203. oscilator_high := TVA(high_src,rsi_smooth)
  204. oscilator_low := TVA(low_src,rsi_smooth)
  205.  
  206. //
  207. fractal_top = f_fractalize(oscilator_high) > 0 ? oscilator_high[2] : na
  208. fractal_bot = f_fractalize(oscilator_low) < 0 ? oscilator_low[2] : na
  209.  
  210. mark_top=1
  211. mark_top2=0
  212. mark_top:=f_fractalize(oscilator_high) > 0? nz(mark_top[1])<=1?2 :1:nz(mark_top[1])
  213. mark_top2 := f_fractalize(oscilator_high) > 0? nz(mark_top2[1])==0 or nz(mark_top2[1])==3?1 :nz(mark_top2[1])+1:nz(mark_top2[1])
  214.  
  215. mark_bot=1
  216. mark_bot2=0
  217. mark_bot:=f_fractalize(oscilator_low) < 0? nz(mark_bot[1])<=1?2 :1:nz(mark_bot[1])
  218. mark_bot2 := f_fractalize(oscilator_low) < 0? nz(mark_bot2[1])==0 or nz(mark_bot2[1])==3?1 :nz(mark_bot2[1])+1:nz(mark_bot2[1])
  219.  
  220. fractal_top1 = f_fractalize(oscilator_high) > 0 and mark_top==1 ? oscilator_high[2] : na
  221. fractal_bot1 = f_fractalize(oscilator_low) < 0 and mark_bot==1? oscilator_low[2] : na
  222. fractal_top2 = f_fractalize(oscilator_high) > 0 and mark_top==2? oscilator_high[2] : na
  223. fractal_bot2 = f_fractalize(oscilator_low) < 0 and mark_bot==2? oscilator_low[2] : na
  224. fractal_top21 = f_fractalize(oscilator_high) > 0 and mark_top2==1 ? oscilator_high[2] : na
  225. fractal_bot21 = f_fractalize(oscilator_low) < 0 and mark_bot2==1 ? oscilator_low[2] : na
  226. fractal_top22 = f_fractalize(oscilator_high) > 0 and mark_top2==2 ? oscilator_high[2] : na
  227. fractal_bot22 = f_fractalize(oscilator_low) < 0 and mark_bot2==2 ? oscilator_low[2] : na
  228. fractal_top23 = f_fractalize(oscilator_high) > 0 and mark_top2==3 ? oscilator_high[2] : na
  229. fractal_bot23 = f_fractalize(oscilator_low) < 0 and mark_bot2==3 ? oscilator_low[2] : na
  230.  
  231. high_prev = valuewhen(fractal_top, oscilator_high[2], 0)[2]
  232. high_price = valuewhen(fractal_top, high[2], 0)[2]
  233. low_prev = valuewhen(fractal_bot, oscilator_low[2], 0)[2]
  234. low_price = valuewhen(fractal_bot, low[2], 0)[2]
  235.  
  236. regular_bearish_div = fractal_top and high[2] > high_price and oscilator_high[2] < high_prev
  237. hidden_bearish_div = fractal_top and high[2] < high_price and oscilator_high[2] > high_prev
  238. regular_bullish_div = fractal_bot and low[2] < low_price and oscilator_low[2] > low_prev
  239. hidden_bullish_div = fractal_bot and low[2] > low_price and oscilator_low[2] < low_prev
  240.  
  241. high_prev1 = valuewhen(fractal_top1, oscilator_high[2], 0)[2]
  242. high_price1 = valuewhen(fractal_top1, high_src[2], 0)[2]
  243. low_prev1 = valuewhen(fractal_bot1, oscilator_low[2], 0)[2]
  244. low_price1 = valuewhen(fractal_bot1, low_src[2], 0)[2]
  245.  
  246. regular_bearish_div1 = fractal_top1 and high_src[2] > high_price1 and oscilator_high[2] < high_prev1
  247. hidden_bearish_div1 = fractal_top1 and high_src[2] < high_price1 and oscilator_high[2] > high_prev1
  248. regular_bullish_div1 = fractal_bot1 and low_src[2] < low_price1 and oscilator_low[2] > low_prev1
  249. hidden_bullish_div1 = fractal_bot1 and low_src[2] > low_price1 and oscilator_low[2] < low_prev1
  250.  
  251. high_prev2 = valuewhen(fractal_top2, oscilator_high[2], 0)[2]
  252. high_price2 = valuewhen(fractal_top2, high_src[2], 0)[2]
  253. low_prev2 = valuewhen(fractal_bot2, oscilator_low[2], 0)[2]
  254. low_price2 = valuewhen(fractal_bot2, low_src[2], 0)[2]
  255.  
  256. regular_bearish_div2 = fractal_top2 and high_src[2] > high_price2 and oscilator_high[2] < high_prev2
  257. hidden_bearish_div2 = fractal_top2 and high_src[2] < high_price2 and oscilator_high[2] > high_prev2
  258. regular_bullish_div2 = fractal_bot2 and low_src[2] < low_price2 and oscilator_low[2] > low_prev2
  259. hidden_bullish_div2 = fractal_bot2 and low_src[2] > low_price2 and oscilator_low[2] < low_prev2
  260.  
  261. //------------------------------------------------
  262. high_prev21 = valuewhen(fractal_top21, oscilator_high[2], 0)[2]
  263. high_price21 = valuewhen(fractal_top21, high_src[2], 0)[2]
  264. low_prev21 = valuewhen(fractal_bot21, oscilator_low[2], 0)[2]
  265. low_price21 = valuewhen(fractal_bot21, low_src[2], 0)[2]
  266.  
  267. regular_bearish_div21 = fractal_top21 and high_src[2] > high_price21 and oscilator_high[2] < high_prev21
  268. hidden_bearish_div21 = fractal_top21 and high_src[2] < high_price21 and oscilator_high[2] > high_prev21
  269. regular_bullish_div21 = fractal_bot21 and low_src[2] < low_price21 and oscilator_low[2] > low_prev21
  270. hidden_bullish_div21 = fractal_bot21 and low_src[2] > low_price21 and oscilator_low[2] < low_prev21
  271.  
  272. high_prev22 = valuewhen(fractal_top22, oscilator_high[2], 0)[2]
  273. high_price22 = valuewhen(fractal_top22, high_src[2], 0)[2]
  274. low_prev22 = valuewhen(fractal_bot22, oscilator_low[2], 0)[2]
  275. low_price22 = valuewhen(fractal_bot22, low_src[2], 0)[2]
  276.  
  277. regular_bearish_div22 = fractal_top22 and high_src[2] > high_price22 and oscilator_high[2] < high_prev22
  278. hidden_bearish_div22 = fractal_top22 and high_src[2] < high_price22 and oscilator_high[2] > high_prev22
  279. regular_bullish_div22 = fractal_bot22 and low_src[2] < low_price22 and oscilator_low[2] > low_prev22
  280. hidden_bullish_div22 = fractal_bot22 and low_src[2] > low_price22 and oscilator_low[2] < low_prev22
  281.  
  282. high_prev23 = valuewhen(fractal_top23, oscilator_high[2], 0)[2]
  283. high_price23 = valuewhen(fractal_top23, high_src[2], 0)[2]
  284. low_prev23 = valuewhen(fractal_bot23, oscilator_low[2], 0)[2]
  285. low_price23 = valuewhen(fractal_bot23, low_src[2], 0)[2]
  286.  
  287. regular_bearish_div23 = fractal_top23 and high_src[2] > high_price23 and oscilator_high[2] < high_prev23
  288. hidden_bearish_div23 = fractal_top23 and high_src[2] < high_price23 and oscilator_high[2] > high_prev23
  289. regular_bullish_div23 = fractal_bot23 and low_src[2] < low_price23 and oscilator_low[2] > low_prev23
  290. hidden_bullish_div23 = fractal_bot23 and low_src[2] > low_price23 and oscilator_low[2] < low_prev23
  291.  
  292.  
  293.  
  294.  
  295. // Plotting
  296.  
  297. plot(title='oscH', series=oscilator_high, color=blue, style=line)
  298. plot(title='oscL', series=oscilator_low, color=red, style=line)
  299.  
  300. plot(title='H F', series=fractal_top ? oscilator_high[2] : na, color=(regular_bearish_div and uReg) or (hidden_bearish_div and uHid)? maroon : not SHOW_CHANNEL ? na : silver, offset=-2)
  301. plot(title='L F', series=fractal_bot ? oscilator_low[2] : na, color=(regular_bullish_div and uReg) or (hidden_bullish_div and uHid) ? green : not SHOW_CHANNEL ? na : silver, offset=-2)
  302. //---------------------
  303. plot(title='H F11', series=fractal_top1 ? oscilator_high[2] : na, color=(regular_bearish_div1 and uReg) or (hidden_bearish_div1 and uHid)? maroon : not SHOW_CHANNEL ? na : silver, offset=-2)
  304. plot(title='L F11', series=fractal_bot1 ? oscilator_low[2] : na, color=(regular_bullish_div1 and uReg) or (hidden_bullish_div1 and uHid) ? green : not SHOW_CHANNEL ? na : silver, offset=-2)
  305.  
  306. plot(title='H F12', series=fractal_top2 ? oscilator_high[2] : na, color=(regular_bearish_div2 and uReg) or (hidden_bearish_div2 and uHid)? maroon : not SHOW_CHANNEL ? na : silver, offset=-2)
  307. plot(title='L F12', series=fractal_bot2 ? oscilator_low[2] : na, color=(regular_bullish_div2 and uReg) or (hidden_bullish_div2 and uHid) ? green : not SHOW_CHANNEL ? na : silver, offset=-2)
  308. //---------------------
  309.  
  310. plot(title='H F21', series=fractal_top21 ? oscilator_high[2] : na, color=(regular_bearish_div21 and uReg) or (hidden_bearish_div21 and uHid)? maroon : not SHOW_CHANNEL ? na : silver, offset=-2)
  311. plot(title='L F21', series=fractal_bot21 ? oscilator_low[2] : na, color=(regular_bullish_div21 and uReg) or (hidden_bullish_div21 and uHid) ? green : not SHOW_CHANNEL ? na : silver, offset=-2)
  312.  
  313. plot(title='H F22', series=fractal_top22 ? oscilator_high[2] : na, color=(regular_bearish_div22 and uReg) or (hidden_bearish_div22 and uHid)? maroon : not SHOW_CHANNEL ? na : silver, offset=-2)
  314. plot(title='L F22', series=fractal_bot22 ? oscilator_low[2] : na, color=(regular_bullish_div22 and uReg) or (hidden_bullish_div22 and uHid) ? green : not SHOW_CHANNEL ? na : silver, offset=-2)
  315.  
  316. plot(title='H F23', series=fractal_top23 ? oscilator_high[2] : na, color=(regular_bearish_div23 and uReg) or (hidden_bearish_div23 and uHid)? maroon : not SHOW_CHANNEL ? na : silver, offset=-2)
  317. plot(title='L F23', series=fractal_bot23 ? oscilator_low[2] : na, color=(regular_bullish_div23 and uReg) or (hidden_bullish_div23 and uHid) ? green : not SHOW_CHANNEL ? na : silver, offset=-2)
  318. //-------------------------------------
  319.  
  320.  
  321. plotshape(title='+RBD2', series=not SHOW_LABEL or not uReg ? na : regular_bearish_div21 or regular_bearish_div22 or regular_bearish_div23 ? oscilator_high[2] : na, text='R2\n\n', style=shape.labeldown, location=location.absolute, color=maroon, textcolor=white, offset=-2)
  322. plotshape(title='+HBD2', series=not SHOW_LABEL or not uHid ? na : hidden_bearish_div21 or hidden_bearish_div22 or hidden_bearish_div23 ? oscilator_high[2] : na, text='H2\n\n', style=shape.labeldown, location=location.absolute, color=maroon, textcolor=white, offset=-2)
  323. plotshape(title='-RBD2', series=not SHOW_LABEL or not uReg ? na : regular_bullish_div21 or regular_bullish_div22 or regular_bullish_div23 ? oscilator_low[2] : na, text='\n\nR2', style=shape.labelup, location=location.absolute, color=green, textcolor=white, offset=-2)
  324. plotshape(title='-HBD2', series=not SHOW_LABEL or not uHid ? na : hidden_bullish_div21 or hidden_bullish_div22 or hidden_bullish_div23 ? oscilator_low[2] : na, text='\n\nH2', style=shape.labelup, location=location.absolute, color=green, textcolor=white, offset=-2)
  325.  
  326. plotshape(title='+RBD1', series=not SHOW_LABEL or not uReg ? na : regular_bearish_div1 or regular_bearish_div2 ? oscilator_high[2] : na, text='R1\n', style=shape.labeldown, location=location.absolute, color=maroon, textcolor=white, offset=-2)
  327. plotshape(title='+HBD1', series=not SHOW_LABEL or not uHid ? na : hidden_bearish_div1 or hidden_bearish_div2 ? oscilator_high[2] : na, text='H1\n', style=shape.labeldown, location=location.absolute, color=maroon, textcolor=white, offset=-2)
  328. plotshape(title='-RBD1', series=not SHOW_LABEL or not uReg ? na : regular_bullish_div1 or regular_bullish_div2 ? oscilator_low[2] : na, text='\nR1', style=shape.labelup, location=location.absolute, color=green, textcolor=white, offset=-2)
  329. plotshape(title='-HBD1', series=not SHOW_LABEL or not uHid ? na : hidden_bullish_div1 or hidden_bullish_div2 ? oscilator_low[2] : na, text='\nH1', style=shape.labelup, location=location.absolute, color=green, textcolor=white, offset=-2)
  330.  
  331. plotshape(title='+RBD', series=not SHOW_LABEL or not uReg? na : regular_bearish_div ? oscilator_high[2] : na, text='R', style=shape.labeldown, location=location.absolute, color=maroon, textcolor=white, offset=-2)
  332. plotshape(title='+HBD', series=not SHOW_LABEL or not uHid? na : hidden_bearish_div ? oscilator_high[2] : na, text='H', style=shape.labeldown, location=location.absolute, color=maroon, textcolor=white, offset=-2)
  333. plotshape(title='-RBD', series=not SHOW_LABEL or not uReg? na : regular_bullish_div ? oscilator_low[2] : na, text='R', style=shape.labelup, location=location.absolute, color=green, textcolor=white, offset=-2)
  334. plotshape(title='-HBD', series=not SHOW_LABEL or not uHid? na : hidden_bullish_div ? oscilator_low[2] : na, text='H', style=shape.labelup, location=location.absolute, color=green, textcolor=white, offset=-2)
  335.  
  336.  
  337.  
  338. //EOF
RAW Paste Data