xmd79

Support Resistance Classification (VR) [LuxAlgo]

May 30th, 2023
340
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 34.67 KB | None | 0 0
  1. // This work is licensed under a Attribution-NonCommercial-ShareAlike 4.0 International (CC BY-NC-SA 4.0) https://creativecommons.org/licenses/by-nc-sa/4.0/
  2. // © LuxAlgo
  3.  
  4. //@version=5
  5. indicator(title='Support Resistance Classification (VR) [LuxAlgo]', shorttitle='LuxAlgo - Support Resistance Classification (VR)', max_lines_count=500, overlay=true, max_bars_back=3000)
  6. //------------------------------------------------------------------------------
  7. //Settings
  8. //-----------------------------------------------------------------------------{
  9. set = 'SET (N° – Type – Length – Mult – HTF)'
  10. fade = input.int ( 5 , 'fade' , tooltip='After x breaks\nthe line is invisible')
  11. opt = input.string ('line', 'value' , options= ['value', 'line'] )
  12.  
  13. colU = input.color (color.lime, '              ' , inline='c')
  14. colD = input.color (color.red , '' , inline='c')
  15.  
  16. left = input.int ( 10, 'left' , minval=1, maxval=20 , group='Swings settings' )
  17. right = input.int ( 1, 'right', minval=1, maxval=10 , group='Swings settings' )
  18. showPP = input.bool (false, 'show' , group='Swings settings' )
  19.  
  20. chc1 = input.string ( 'SMA' , '1'
  21. , options = ['NONE','SMA','Upper','Lower','Previous High','Previous Low','Swings','Fibonacci'] , group=set , inline='1')
  22. len1 = input.int ( 50 , '' , group=set , inline='1')
  23. mlt1 = input.float ( 2 , '' , group=set , inline='1')
  24. res1 = input.timeframe( 'D' , '' , group=set , inline='1')
  25. chc2 = input.string ( 'SMA' , '2'
  26. , options = ['NONE','SMA','Upper','Lower','Previous High','Previous Low','Swings','Fibonacci'] , group=set , inline='2')
  27. len2 = input.int ( 100 , '' , group=set , inline='2')
  28. mlt2 = input.float ( 2 , '' , group=set , inline='2')
  29. res2 = input.timeframe( 'D' , '' , group=set , inline='2')
  30. chc3 = input.string ( 'SMA' , '3'
  31. , options = ['NONE','SMA','Upper','Lower','Previous High','Previous Low','Swings','Fibonacci'] , group=set , inline='3')
  32. len3 = input.int ( 20 , '' , group=set , inline='3')
  33. mlt3 = input.float ( 2 , '' , group=set , inline='3')
  34. res3 = input.timeframe( 'W', '' , group=set , inline='3')
  35.  
  36. chc4 = input.string ('Previous High' , '4'
  37. , options = ['NONE','SMA','Upper','Lower','Previous High','Previous Low','Swings','Fibonacci'] , group=set , inline='4')
  38. len4 = input.int ( 20 , '' , group=set , inline='4')
  39. mlt4 = input.float ( 2 , '' , group=set , inline='4')
  40. res4 = input.timeframe( 'W' , '' , group=set , inline='4')
  41. chc5 = input.string ( 'Previous Low' , '5'
  42. , options = ['NONE','SMA','Upper','Lower','Previous High','Previous Low','Swings','Fibonacci'] , group=set , inline='5')
  43. len5 = input.int ( 20 , '' , group=set , inline='5')
  44. mlt5 = input.float ( 2 , '' , group=set , inline='5')
  45. res5 = input.timeframe( 'W' , '' , group=set , inline='5')
  46. chc6 = input.string ('Upper' , '6'
  47. , options = ['NONE','SMA','Upper','Lower','Previous High','Previous Low','Swings','Fibonacci'] , group=set , inline='6')
  48. len6 = input.int ( 20 , '' , group=set , inline='6')
  49. mlt6 = input.float ( 2 , '' , group=set , inline='6')
  50. res6 = input.timeframe( 'D' , '' , group=set , inline='6')
  51. chc7 = input.string ('Lower' , '7'
  52. , options = ['NONE','SMA','Upper','Lower','Previous High','Previous Low','Swings','Fibonacci'] , group=set , inline='7')
  53. len7 = input.int ( 20 , '' , group=set , inline='7')
  54. mlt7 = input.float ( 2 , '' , group=set , inline='7')
  55. res7 = input.timeframe( 'D' , '' , group=set , inline='7')
  56. chc8 = input.string ('Swings' , '8'
  57. , options = ['NONE','SMA','Upper','Lower','Previous High','Previous Low','Swings','Fibonacci'] , group=set , inline='8')
  58. len8 = input.int ( 20 , '' , group=set , inline='8')
  59. mlt8 = input.float ( 2 , '' , group=set , inline='8')
  60. res8 = input.timeframe( 'D' , '' , group=set , inline='8')
  61. chc9 = input.string ('Fibonacci' , '9'
  62. , options = ['NONE','SMA','Upper','Lower','Previous High','Previous Low','Swings','Fibonacci'] , group=set , inline='9')
  63. len9 = input.int ( 20 , '' , group=set , inline='9')
  64. mlt9 = input.float ( 2 , '' , group=set , inline='9')
  65. res9 = input.timeframe( 'W' , '' , group=set , inline='9')
  66.  
  67. pick1 = input.bool (false , 'A' , group='show values', inline='1')
  68. choice1 = input.int ( 1 , '' , minval=1, maxval=9, group='show values', inline='1')
  69. pick2 = input.bool (false , 'B' , group='show values', inline='2')
  70. choice2 = input.int ( 3 , '' , minval=1, maxval=9, group='show values', inline='2')
  71. pick3 = input.bool (false , 'C' , group='show values', inline='3')
  72. choice3 = input.int ( 5 , '' , minval=1, maxval=9, group='show values', inline='3')
  73. pick4 = input.bool (false , 'D' , group='show values', inline='4')
  74. choice4 = input.int ( 7 , '' , minval=1, maxval=9, group='show values', inline='4')
  75. pick5 = input.bool (false , 'E' , group='show values', inline='5')
  76. choice5 = input.int ( 9 , '' , minval=1, maxval=9, group='show values', inline='5')
  77.  
  78. //-----------------------------------------------------------------------------}
  79. //User Defined Types
  80. //-----------------------------------------------------------------------------{
  81. type piv
  82. int b
  83. float p
  84.  
  85. type lab
  86. label lb
  87. float gr
  88.  
  89. //-----------------------------------------------------------------------------}
  90. //Variables
  91. //-----------------------------------------------------------------------------{
  92. n = bar_index
  93. max = array.from(0.)
  94. lab[] lab = array.new<lab>()
  95. float[] aGrade = array.new<float>()
  96. arrChoices = array.from(chc1, chc2, chc3, chc4, chc5, chc6, chc7, chc8, chc9)
  97. var box top = box.new(na, na, na, na, bgcolor=color.new(color.red , 90), border_color=color(na), extend=extend.left)
  98. var box btm = box.new(na, na, na, na, bgcolor=color.new(color.lime, 90), border_color=color(na), extend=extend.left)
  99. var piv[] pivH = array.new<piv>()
  100. var piv[] pivL = array.new<piv>()
  101. var float highest = na
  102. var float lowest = na
  103. var int sBix = na
  104. var float mxPiv = na
  105. var float mnPiv = na
  106.  
  107. //-----------------------------------------------------------------------------}
  108. //General Calculations
  109. //-----------------------------------------------------------------------------{
  110. fromR = opt == 'value'
  111. ph = ta.pivothigh(left, right)
  112. pl = ta.pivotlow (left, right)
  113.  
  114. if time == chart.left_visible_bar_time
  115. highest := high
  116. lowest := high
  117. sBix := n
  118. pivH.unshift(piv.new(n, high))
  119. pivL.unshift(piv.new(n, high))
  120. mxPiv := high
  121. mnPiv := high
  122.  
  123. if time > chart.left_visible_bar_time
  124. if high > highest
  125. highest := high
  126. if low < lowest
  127. lowest := low
  128. if time <= chart.right_visible_bar_time
  129. if ph
  130. if ph > mxPiv
  131. mxPiv := ph
  132. for i = pivH.size() -1 to 0
  133. get = pivH.get(i)
  134. if ph >= get.p
  135. pivH.remove(i)
  136. pivH.unshift(piv.new(n -right, ph))
  137. if pl
  138. if pl < mnPiv
  139. mnPiv := pl
  140. for i = pivL.size() -1 to 0
  141. get = pivL.get(i)
  142. if pl <= get.p
  143. pivL.remove(i)
  144. pivL.unshift(piv.new(n -right, pl))
  145.  
  146. //-----------------------------------------------------------------------------}
  147. //Functions
  148. //-----------------------------------------------------------------------------{
  149. isPP(get) => pp = get == 'Traditional' or get == 'Fibonacci' or get == 'Classic'
  150.  
  151. choiceIsPP(i) => get = arrChoices.get(i), isPP(get)
  152.  
  153. f(choice) =>
  154. c = choice == 1 ? chc1 : choice == 2 ? chc2 : choice == 3 ? chc3 : choice == 4 ? chc4
  155. : choice == 5 ? chc5 : choice == 6 ? chc6 : choice == 7 ? chc7 : choice == 8 ? chc8 : chc9
  156. notPP = c != 'Fibonacci'
  157.  
  158. setLine(e, sBs, chc, len, res) =>
  159. var float val = na
  160. val := sBs
  161. hl = chc == 'Previous High'
  162. or chc == 'Previous Low'
  163. htf = timeframe.in_seconds(res)
  164. >= timeframe.in_seconds(timeframe.period)
  165. tfChange = timeframe.change (res)
  166. bsChange = ta.barssince (tfChange)
  167. bars = hl and fromR ? math.min(last_bar_index - sBix, bsChange)
  168. : last_bar_index - sBix
  169. if time == chart.right_visible_bar_time and val <= highest and val >= lowest and htf
  170. firstPos = sBs > close ? 'r' : 's' // 's/r' support or resistance at chart.right_visible_bar_time
  171. pos = 1 // 1/0 -> 1 = same position as firstPos , 0 = diff pos
  172. breaks = 0
  173. switch firstPos
  174. 'r' =>
  175. for i = 0 to bars // last_bar_index - sBix
  176. v = hl ? val : fromR ? val[i] : val
  177. if pos == 1 and close[i] > v
  178. breaks += 1
  179. pos := 0
  180. if pos == 0 and close[i] < v
  181. pos := 1
  182. 's' =>
  183. for i = 0 to bars // last_bar_index - sBix
  184. v = hl ? val : fromR ? val[i] : val
  185. if pos == 1 and close[i] < v
  186. breaks += 1
  187. pos := 0
  188. if pos == 0 and close[i] > v
  189. pos := 1
  190.  
  191. isAbove = close > val
  192. grade = math.min(100, math.round((100 / fade) * breaks))
  193. max.set(0, math.max(max.get(0), grade))
  194. col = color.new(
  195. isAbove ?
  196. colU
  197. : colD
  198. , grade)
  199. chart = res == ''
  200. s = chart ? 'chart' : res
  201. line.new (n -1, val, n +8, val, color=col, extend=extend.left)
  202. lab.unshift(lab.new(
  203. label.new(n +8 + (e * 5), val, style=label.style_label_left, color=color(na)
  204. , textcolor=col
  205. , tooltip=str.format("N°{0} – HTF: {1} \n{2}", e, s, chc) + (hl ? '' : ', len ' + str.tostring(len))
  206. , size=size.small
  207. , text= (chart ? '' : '(') + res + (chart ? '' : ')')
  208. )
  209. , grade
  210. )
  211. )
  212. aGrade.unshift(grade)
  213.  
  214. calc(e, chc, len, mlt, res) =>
  215. var arrPP = array.from( 0., 0. , 0. , 0. , 0. , 0. , 0. , 0. , 0. , 0. , 0. )
  216. act = chc != 'NONE'
  217. htf = timeframe.in_seconds(res) >= timeframe.in_seconds(timeframe.period)
  218. var float bs = na, var float up = na, var float lo = na
  219. ema1 = ta.ema(close, len)
  220. ema2 = ta.ema(ema1 , len)
  221. ema3 = ta.ema(ema2 , len)
  222. if htf
  223. bs := switch chc
  224. 'SMA' => ta.sma(close, len)
  225. "Swings" => na
  226. "Previous High" => high
  227. "Previous Low" => low
  228. =>
  229. [b, u, l] = ta.bb(close, len, mlt)
  230. switch chc
  231. 'Upper' => u
  232. 'Lower' => l
  233. => na
  234.  
  235. sBs = htf ? request.security(syminfo.tickerid, res, act ? bs[1] : na, lookahead=barmerge.lookahead_on) : na
  236.  
  237. if act
  238. pp = isPP(chc)
  239. st = chc == 'Fibonacci' ? 'Fib.' : chc
  240.  
  241. switch
  242.  
  243. pp and htf =>
  244. var arStr = array.from('P', 'R1', 'S1', 'R2', 'S2', 'R3', 'S3', 'R4', 'S4', 'R5', 'S5')
  245. tfChange = timeframe.change(res)
  246. bsChange = ta.barssince(tfChange)
  247. pivotPointsArray = ta.pivot_point_levels(chc, timeframe.change(res))
  248. if tfChange
  249. for i = 0 to pivotPointsArray.size() -1
  250. arrPP.set(i, pivotPointsArray.get(i))
  251. if time == chart.right_visible_bar_time
  252. for i = 0 to arrPP.size() -1
  253. p = arrPP.get(i)
  254. if p <= highest and p >= lowest
  255. firstPos = p > close ? 'r' : 's' // 's/r' support or resistance at chart.left_visible_bar_time
  256. pos = 1 // 1/0 -> 1 = same position as firstPos , 0 = diff pos
  257. breaks = 0
  258. bars = fromR ? math.min(last_bar_index - sBix, bsChange)
  259. : last_bar_index - sBix
  260. switch firstPos
  261. 'r' =>
  262. for d = 0 to bars
  263. if pos == 1 and close[d] > p
  264. breaks += 1
  265. pos := 0
  266. if pos == 0 and close[d] < p
  267. pos := 1
  268. 's' =>
  269. for d = 0 to bars
  270. if pos == 1 and close[d] < p
  271. breaks += 1
  272. pos := 0
  273. if pos == 0 and close[d] > p
  274. pos := 1
  275. isAbove = close > p
  276. chart = res == ''
  277. s = chart ? 'chart' : res
  278. grade = math.min(100, math.round((100 / fade) * breaks))
  279. max.set(0, math.max(max.get(0), grade))
  280. col =
  281. color.new(
  282. isAbove ?
  283. colU
  284. : colD
  285. , grade)
  286.  
  287. line.new(n -1, p, n +8, p
  288. , color=col, extend=extend.left)
  289. lab.unshift(lab.new(
  290. label.new(n +8 + (e * 5), p, color=color(na)
  291. , tooltip=str.format("N°{0} – HTF: {1} \n{2} ({3})"
  292. , e , s , arStr.get(i) , st )
  293. , style=label.style_label_left
  294. , size=size.small
  295. , textcolor=col
  296. , text= (chart ? '' : '(') + res + (chart ? '' : ')')
  297. )
  298. , grade
  299. )
  300. )
  301. aGrade.unshift(grade)
  302.  
  303. chc != 'Swings' and htf => setLine(e, sBs, chc, len, res)
  304.  
  305. chc == 'Swings' => // Swings
  306. if time == chart.right_visible_bar_time
  307.  
  308. for i = 0 to pivH.size() -1
  309. p = pivH.get(i)
  310. if p.p <= highest and p.p >= lowest
  311. pos = 1
  312. breaks = 0
  313. //only 'line', otherwise 0 breaks (if breaks, Swings would not be included)
  314. for d = 0 to last_bar_index - sBix
  315. if pos == 1 and close[d] > p.p
  316. breaks += 1
  317. pos := 0
  318. if pos == 0 and close[d] < p.p
  319. pos := 1
  320. grade = math.min(100, math.round((100 / fade) * breaks))
  321. max.set(0, math.max(max.get(0) , grade))
  322. line.new(n -1, p.p, n +8, p.p
  323. , color=color.new(colD, grade), extend=extend.left)
  324. lab.unshift(lab.new(
  325. label.new(n +8 + (e * 5), p.p, color=color(na)
  326. , tooltip= 'N°' + str.tostring(e) + ' Swings'
  327. , style=label.style_label_left
  328. , size=size.small
  329. , textcolor=color.new(colD, grade)
  330. , text= ''
  331. )
  332. , grade
  333. )
  334. )
  335. aGrade.unshift(grade)
  336.  
  337. for i = 0 to pivL.size() -1
  338. p = pivL.get(i)
  339. if p.p <= highest and p.p >= lowest
  340. pos = 1
  341. breaks = 0
  342. //only 'line', otherwise 0 breaks (if breaks, Swings would not be included)
  343. for d = 0 to last_bar_index - sBix
  344. if pos == 1 and close[d] < p.p
  345. breaks += 1
  346. pos := 0
  347. if pos == 0 and close[d] > p.p
  348. pos := 1
  349. grade = math.min(100, math.round((100 / fade) * breaks))
  350. max.set(0, math.max(max.get(0) , grade))
  351. line.new(n -1, p.p, n +8, p.p
  352. , color=color.new(colU, grade), extend=extend.left)
  353. lab.unshift(lab.new(
  354. label.new(n +8 + (e * 5), p.p, color=color(na)
  355. , tooltip= 'N°' + str.tostring(e) + ' Swings'
  356. , style=label.style_label_left
  357. , size=size.small
  358. , textcolor=color.new(colU, grade)
  359. , text= ''
  360. )
  361. , grade
  362. )
  363. )
  364. aGrade.unshift(grade)
  365. [sBs, arrPP]
  366.  
  367. //-----------------------------------------------------------------------------}
  368. //Calculations
  369. //-----------------------------------------------------------------------------{
  370. e = 1
  371. [sBs1, arrPP1] = calc(e, chc1 , len1 , mlt1 , res1 ), e +=1
  372. [sBs2, arrPP2] = calc(e, chc2 , len2 , mlt2 , res2 ), e +=1
  373. [sBs3, arrPP3] = calc(e, chc3 , len3 , mlt3 , res3 ), e +=1
  374. [sBs4, arrPP4] = calc(e, chc4 , len4 , mlt4 , res4 ), e +=1
  375. [sBs5, arrPP5] = calc(e, chc5 , len5 , mlt5 , res5 ), e +=1
  376. [sBs6, arrPP6] = calc(e, chc6 , len6 , mlt6 , res6 ), e +=1
  377. [sBs7, arrPP7] = calc(e, chc7 , len7 , mlt7 , res7 ), e +=1
  378. [sBs8, arrPP8] = calc(e, chc8 , len8 , mlt8 , res8 ), e +=1
  379. [sBs9, arrPP9] = calc(e, chc9 , len9 , mlt9 , res9 ), e +=1
  380.  
  381. arrVal = array.from(
  382. sBs1, sBs2, sBs3, sBs4, sBs5, sBs6, sBs7, sBs8, sBs9
  383. )
  384.  
  385. if time == chart.right_visible_bar_time
  386. top.set_lefttop (n -1, highest)
  387. top.set_rightbottom(n +8, highest - ((highest - lowest) / 20))
  388. btm.set_lefttop (n -1, lowest + ((highest - lowest) / 20))
  389. btm.set_rightbottom(n +8, lowest )
  390. sz = lab.size(), arr = aGrade.copy(), arr.sort(), aSz = arr.size()
  391. // sort + rank ~ grade
  392. if aSz > 1
  393. lastValue = arr.get(aSz -1)
  394. for j = arr.size() -2 to 0
  395. if arr.get(j) == lastValue
  396. arr.remove(j)
  397. lastValue := arr.get(j)
  398. // set label (grade)
  399. if sz > 1
  400. for i = 0 to sz -1
  401. get = lab.get(i)
  402. get.lb.set_text(str.tostring(arr.indexof(get.gr) + 1) + ' ' + get.lb.get_text())
  403.  
  404. // Make Swings visible
  405. if showPP
  406. for i = 0 to pivH.size() -1
  407. label.new(pivH.get(i).b, pivH.get(i).p, style=label.style_label_right, size=size.tiny)
  408. l = line.new(pivH.get(i).b, pivH.get(i).p, n +8, pivH.get(i).p)
  409.  
  410. for i = 0 to pivL.size() -1
  411. label.new(pivL.get(i).b, pivL.get(i).p, style=label.style_label_right, size=size.tiny)
  412. l = line.new(pivL.get(i).b, pivL.get(i).p, n +8, pivL.get(i).p)
  413.  
  414. //-----------------------------------------------------------------------------}
  415. //Plot Functions
  416. //-----------------------------------------------------------------------------{
  417. pickArrPP(i, f) =>
  418. out =
  419. i == 1 ? arrPP1.get(f) :
  420. i == 2 ? arrPP2.get(f) :
  421. i == 3 ? arrPP3.get(f) :
  422. i == 4 ? arrPP4.get(f) :
  423. i == 5 ? arrPP5.get(f) :
  424. i == 6 ? arrPP6.get(f) :
  425. i == 7 ? arrPP7.get(f) :
  426. i == 8 ? arrPP8.get(f) :
  427. arrPP9.get(f)
  428.  
  429. plots(pick, choice) =>
  430. p1 = pick ? not choiceIsPP(choice -1) ? arrVal.get(choice -1) : pickArrPP(choice, 0 ) : na
  431. p2 = pick ? not choiceIsPP(choice -1) ? na : pickArrPP(choice, 1 ) : na
  432. p3 = pick ? not choiceIsPP(choice -1) ? na : pickArrPP(choice, 2 ) : na
  433. p4 = pick ? not choiceIsPP(choice -1) ? na : pickArrPP(choice, 3 ) : na
  434. p5 = pick ? not choiceIsPP(choice -1) ? na : pickArrPP(choice, 4 ) : na
  435. p6 = pick ? not choiceIsPP(choice -1) ? na : pickArrPP(choice, 5 ) : na
  436. p7 = pick ? not choiceIsPP(choice -1) ? na : pickArrPP(choice, 6 ) : na
  437. p8 = pick ? not choiceIsPP(choice -1) ? na : pickArrPP(choice, 7 ) : na
  438. p9 = pick ? not choiceIsPP(choice -1) ? na : pickArrPP(choice, 8 ) : na
  439. p10 = pick ? not choiceIsPP(choice -1) ? na : pickArrPP(choice, 9 ) : na
  440. p11 = pick ? not choiceIsPP(choice -1) ? na : pickArrPP(choice, 10) : na
  441. [p1, p2, p3, p4, p5, p6, p7, p8, p9, p10, p11]
  442.  
  443. //-----------------------------------------------------------------------------}
  444. //Plots
  445. //-----------------------------------------------------------------------------{
  446. [plotA1, plotA2, plotA3, plotA4, plotA5, plotA6, plotA7, plotA8, plotA9, plotA10, plotA11] = plots(pick1, choice1)
  447. [plotB1, plotB2, plotB3, plotB4, plotB5, plotB6, plotB7, plotB8, plotB9, plotB10, plotB11] = plots(pick2, choice2)
  448. [plotC1, plotC2, plotC3, plotC4, plotC5, plotC6, plotC7, plotC8, plotC9, plotC10, plotC11] = plots(pick3, choice3)
  449. [plotD1, plotD2, plotD3, plotD4, plotD5, plotD6, plotD7, plotD8, plotD9, plotD10, plotD11] = plots(pick4, choice4)
  450. [plotE1, plotE2, plotE3, plotE4, plotE5, plotE6, plotE7, plotE8, plotE9, plotE10, plotE11] = plots(pick5, choice5)
  451.  
  452.  
  453. plot(plotA1 , 'A', style= f(choice1) ? plot.style_line : plot.style_circles, color=color.blue , display=display.pane)
  454. plot(plotA2 , 'A', style= f(choice1) ? plot.style_line : plot.style_circles, color=color.blue , editable=false, display=display.pane)
  455. plot(plotA3 , 'A', style= f(choice1) ? plot.style_line : plot.style_circles, color=color.blue , editable=false, display=display.pane)
  456. plot(plotA4 , 'A', style= f(choice1) ? plot.style_line : plot.style_circles, color=color.blue , editable=false, display=display.pane)
  457. plot(plotA5 , 'A', style= f(choice1) ? plot.style_line : plot.style_circles, color=color.blue , editable=false, display=display.pane)
  458. plot(plotA6 , 'A', style= f(choice1) ? plot.style_line : plot.style_circles, color=color.blue , editable=false, display=display.pane)
  459. plot(plotA7 , 'A', style= f(choice1) ? plot.style_line : plot.style_circles, color=color.blue , editable=false, display=display.pane)
  460. plot(plotA8 , 'A', style= f(choice1) ? plot.style_line : plot.style_circles, color=color.blue , editable=false, display=display.pane)
  461. plot(plotA9 , 'A', style= f(choice1) ? plot.style_line : plot.style_circles, color=color.blue , editable=false, display=display.pane)
  462. plot(plotA10, 'A', style= f(choice1) ? plot.style_line : plot.style_circles, color=color.blue , editable=false, display=display.pane)
  463. plot(plotA11, 'A', style= f(choice1) ? plot.style_line : plot.style_circles, color=color.blue , editable=false, display=display.pane)
  464.  
  465. plot(plotB1 , 'B', style= f(choice2) ? plot.style_line : plot.style_circles, color=color.yellow, display=display.pane)
  466. plot(plotB2 , 'B', style= f(choice2) ? plot.style_line : plot.style_circles, color=color.yellow, editable=false, display=display.pane)
  467. plot(plotB3 , 'B', style= f(choice2) ? plot.style_line : plot.style_circles, color=color.yellow, editable=false, display=display.pane)
  468. plot(plotB4 , 'B', style= f(choice2) ? plot.style_line : plot.style_circles, color=color.yellow, editable=false, display=display.pane)
  469. plot(plotB5 , 'B', style= f(choice2) ? plot.style_line : plot.style_circles, color=color.yellow, editable=false, display=display.pane)
  470. plot(plotB6 , 'B', style= f(choice2) ? plot.style_line : plot.style_circles, color=color.yellow, editable=false, display=display.pane)
  471. plot(plotB7 , 'B', style= f(choice2) ? plot.style_line : plot.style_circles, color=color.yellow, editable=false, display=display.pane)
  472. plot(plotB8 , 'B', style= f(choice2) ? plot.style_line : plot.style_circles, color=color.yellow, editable=false, display=display.pane)
  473. plot(plotB9 , 'B', style= f(choice2) ? plot.style_line : plot.style_circles, color=color.yellow, editable=false, display=display.pane)
  474. plot(plotB10, 'B', style= f(choice2) ? plot.style_line : plot.style_circles, color=color.yellow, editable=false, display=display.pane)
  475. plot(plotB11, 'B', style= f(choice2) ? plot.style_line : plot.style_circles, color=color.yellow, editable=false, display=display.pane)
  476.  
  477. plot(plotC1 , 'C', style= f(choice3) ? plot.style_line : plot.style_circles, color=color.purple, display=display.pane)
  478. plot(plotC2 , 'C', style= f(choice3) ? plot.style_line : plot.style_circles, color=color.purple, editable=false, display=display.pane)
  479. plot(plotC3 , 'C', style= f(choice3) ? plot.style_line : plot.style_circles, color=color.purple, editable=false, display=display.pane)
  480. plot(plotC4 , 'C', style= f(choice3) ? plot.style_line : plot.style_circles, color=color.purple, editable=false, display=display.pane)
  481. plot(plotC5 , 'C', style= f(choice3) ? plot.style_line : plot.style_circles, color=color.purple, editable=false, display=display.pane)
  482. plot(plotC6 , 'C', style= f(choice3) ? plot.style_line : plot.style_circles, color=color.purple, editable=false, display=display.pane)
  483. plot(plotC7 , 'C', style= f(choice3) ? plot.style_line : plot.style_circles, color=color.purple, editable=false, display=display.pane)
  484. plot(plotC8 , 'C', style= f(choice3) ? plot.style_line : plot.style_circles, color=color.purple, editable=false, display=display.pane)
  485. plot(plotC9 , 'C', style= f(choice3) ? plot.style_line : plot.style_circles, color=color.purple, editable=false, display=display.pane)
  486. plot(plotC10, 'C', style= f(choice3) ? plot.style_line : plot.style_circles, color=color.purple, editable=false, display=display.pane)
  487. plot(plotC11, 'C', style= f(choice3) ? plot.style_line : plot.style_circles, color=color.purple, editable=false, display=display.pane)
  488.  
  489. plot(plotD1 , 'D', style= f(choice4) ? plot.style_line : plot.style_circles, color=color.orange, display=display.pane)
  490. plot(plotD2 , 'D', style= f(choice4) ? plot.style_line : plot.style_circles, color=color.orange, editable=false, display=display.pane)
  491. plot(plotD3 , 'D', style= f(choice4) ? plot.style_line : plot.style_circles, color=color.orange, editable=false, display=display.pane)
  492. plot(plotD4 , 'D', style= f(choice4) ? plot.style_line : plot.style_circles, color=color.orange, editable=false, display=display.pane)
  493. plot(plotD5 , 'D', style= f(choice4) ? plot.style_line : plot.style_circles, color=color.orange, editable=false, display=display.pane)
  494. plot(plotD6 , 'D', style= f(choice4) ? plot.style_line : plot.style_circles, color=color.orange, editable=false, display=display.pane)
  495. plot(plotD7 , 'D', style= f(choice4) ? plot.style_line : plot.style_circles, color=color.orange, editable=false, display=display.pane)
  496. plot(plotD8 , 'D', style= f(choice4) ? plot.style_line : plot.style_circles, color=color.orange, editable=false, display=display.pane)
  497. plot(plotD9 , 'D', style= f(choice4) ? plot.style_line : plot.style_circles, color=color.orange, editable=false, display=display.pane)
  498. plot(plotD10, 'D', style= f(choice4) ? plot.style_line : plot.style_circles, color=color.orange, editable=false, display=display.pane)
  499. plot(plotD11, 'D', style= f(choice4) ? plot.style_line : plot.style_circles, color=color.orange, editable=false, display=display.pane)
  500.  
  501. plot(plotE1 , 'E', style= f(choice5) ? plot.style_line : plot.style_circles, color=color.white , display=display.pane)
  502. plot(plotE2 , 'E', style= f(choice5) ? plot.style_line : plot.style_circles, color=color.white , editable=false, display=display.pane)
  503. plot(plotE3 , 'E', style= f(choice5) ? plot.style_line : plot.style_circles, color=color.white , editable=false, display=display.pane)
  504. plot(plotE4 , 'E', style= f(choice5) ? plot.style_line : plot.style_circles, color=color.white , editable=false, display=display.pane)
  505. plot(plotE5 , 'E', style= f(choice5) ? plot.style_line : plot.style_circles, color=color.white , editable=false, display=display.pane)
  506. plot(plotE6 , 'E', style= f(choice5) ? plot.style_line : plot.style_circles, color=color.white , editable=false, display=display.pane)
  507. plot(plotE7 , 'E', style= f(choice5) ? plot.style_line : plot.style_circles, color=color.white , editable=false, display=display.pane)
  508. plot(plotE8 , 'E', style= f(choice5) ? plot.style_line : plot.style_circles, color=color.white , editable=false, display=display.pane)
  509. plot(plotE9 , 'E', style= f(choice5) ? plot.style_line : plot.style_circles, color=color.white , editable=false, display=display.pane)
  510. plot(plotE10, 'E', style= f(choice5) ? plot.style_line : plot.style_circles, color=color.white , editable=false, display=display.pane)
  511. plot(plotE11, 'E', style= f(choice5) ? plot.style_line : plot.style_circles, color=color.white , editable=false, display=display.pane)
  512. //-----------------------------------------------------------------------------}
Advertisement
Add Comment
Please, Sign In to add comment