Advertisement
xmd79

Pivot Channel

Feb 19th, 2023
204
0
Never
1
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 20.99 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. // © atolelole
  3.  
  4. //@version=5
  5. indicator("Pivot Channel", overlay = true, max_bars_back = 500, max_lines_count = 500, max_labels_count = 500)
  6.  
  7.  
  8. i_pivothigh_len = input.int(21, "Pivot high length(left, right)", group="Pivot points", inline="phb")
  9. i_pivothigh_n = input.int(5 , "Max pivot points" , group="Pivot points", inline="phb")
  10. i_pivotlow_len = input.int(21, "Pivot low length(left, right)", group="Pivot points", inline="plb")
  11. i_pivotlow_n = input.int(5 , "Max pivot points" , group="Pivot points", inline="plb")
  12. i_drawpivots = input.bool(true, "Draw pivot points" , group="Pivot points")
  13. i_hsource_test = input.source(close, "Pivot high test source" , group="Pivot points", tooltip = "Series that is tested for a high pivot point, if yes takes price from Pivot high source")
  14. i_hsource = input.source(high, "Pivot high source" , group="Pivot points")
  15. i_lsource_test = input.source(close, "Pivot low test source" , group="Pivot points", tooltip = "Series that is tested for a low pivot point, if yes takes price from Pivot low source")
  16. i_lsource = input.source(low, "Pivot low source" , group="Pivot points")
  17.  
  18. i_trend_old_method = input.bool(false, "Use old method to find channel lines", group="Trends")
  19. i_htrend_style = input.string(line.style_dashed, "High trend line style", options=[line.style_dotted, line.style_dashed, line.style_solid, line.style_arrow_both, line.style_arrow_left, line.style_arrow_right], group="Trends", inline="htr")
  20. i_htrend_width = input.int(2, "High trend line width", group="Trends", inline="htr")
  21. i_ltrend_style = input.string(line.style_dashed, "Low trend line style" , options=[line.style_dotted, line.style_dashed, line.style_solid, line.style_arrow_both, line.style_arrow_left, line.style_arrow_right], group="Trends", inline="ltr")
  22. i_ltrend_width = input.int(2, "Low trend line width" , group="Trends", inline="ltr")
  23. i_trend_extlen = input.int(5, "Right channel extension length", group="Trends")
  24.  
  25. i_hcolor = input.color(color.new(#99d31b, 0), "High color", group="Colors", inline="clr")
  26. i_lcolor = input.color(color.new(#FA5032, 0), "Low color" , group="Colors", inline="clr")
  27.  
  28. i_drawheatmap = input.bool(false, "Enable" , group = "Heatmap")
  29. i_minrsi_len = input.int(2 , "Min RSI length" , group = "Heatmap", tooltip = "for step = 0 to 10 : rsi = step * (max - min) / 10")
  30. i_maxrsi_len = input.int(22, "Max RSI length" , group = "Heatmap", tooltip = "for step = 0 to 10 : rsi = step * (max - min) / 10")
  31. i_grid_x = input.int(100, "Number of horizontal grid segments", group = "Heatmap", tooltip = "X axis resolution, if > 45 first cells start to get deleted")
  32.  
  33. i_drawfibs = input.bool(true , "Enable" , group = "Fibs", inline="fiblines")
  34. i_drawfibs_extended = input.bool(false, "Draw fib lines > 1.618", group = "Fibs", inline="fiblines")
  35. i_fibline_widths = input.int(1, "Fib line widths" , group="Fibs")
  36. i_fibline_styles = input.string(line.style_dotted, "Fib lines style", options=[line.style_dotted, line.style_dashed, line.style_solid, line.style_arrow_both, line.style_arrow_left, line.style_arrow_right], group="Fibs")
  37.  
  38. i_alerts_enabled = input.bool(false, "Enable", group="Alerts", inline="alrt", tooltip = "WIP, alarms dont trigger so just a label for now")
  39. i_alerts_high_trend_trigger_pct = input.float(0.15, "High trend % trigger", group="Alerts", step=0.1, minval = 0.0, maxval = 1.0)
  40. i_alerts_low_trend_trigger_pct = input.float(0.15, "Low trend % trigger" , group="Alerts", step=0.1, minval = 0.0, maxval = 1.0)
  41. i_alerts_draw_alert_zones = input.bool(false, "Draw alert zones", group="Alerts", inline="alrt")
  42. i_alerts_fill_alert_zones = input.bool(false, "Fill alert zones", group="Alerts", inline="alrt")
  43.  
  44. get_color(rsi) =>
  45. clr = color.white
  46. if rsi >= 0 and rsi <= 25
  47. clr := color.from_gradient(rsi, 0 , 25 , color.rgb(69, 13, 85, 40), color.rgb(64, 70, 137 , 40))
  48. if rsi > 25 and rsi <= 50
  49. clr := color.from_gradient(rsi, 25, 50 , color.rgb(57, 87, 141, 40), color.rgb(35, 139, 140, 40))
  50. if rsi > 50 and rsi <= 75
  51. clr := color.from_gradient(rsi, 50, 75 , color.rgb(30, 150, 138, 40), color.rgb(85, 199, 103, 40))
  52. if rsi > 75 and rsi <= 100
  53. clr := color.from_gradient(rsi, 75, 100, color.rgb(115, 208, 85, 40), color.rgb(253, 230, 36, 40))
  54. clr
  55.  
  56. get_avg_rsi(source, start_index, len) =>
  57. avg = 0.0
  58. for i = start_index to start_index + len
  59. avg += source[i]
  60. avg / len
  61.  
  62. interp(l, h, s) => l + (h - l) * s
  63.  
  64. //PIVOT POINTS
  65. type PivotPoint
  66. float price
  67. int index
  68.  
  69. var high_pivots = array.new<PivotPoint>()
  70. var low_pivots = array.new<PivotPoint>()
  71.  
  72. ph = ta.pivothigh(i_hsource_test, i_pivothigh_len, i_pivothigh_len)
  73. if ph
  74. if array.size(high_pivots) >= i_pivothigh_n
  75. array.shift(high_pivots)
  76. array.push(high_pivots, PivotPoint.new(i_hsource[i_pivothigh_len], bar_index[i_pivothigh_len]))
  77.  
  78. pl = ta.pivotlow(i_lsource_test, i_pivotlow_len, i_pivotlow_len)
  79. if pl
  80. if array.size(low_pivots) >= i_pivotlow_n
  81. array.shift(low_pivots)
  82. array.push(low_pivots, PivotPoint.new(i_lsource[i_pivotlow_len], bar_index[i_pivotlow_len]))
  83.  
  84. //FIND HIGH AND LOW TREND LINE
  85. var low_trend = line(na)
  86. var high_trend = line(na)
  87. var labels = array.new_label()
  88.  
  89. while array.size(labels) > 0
  90. label.delete(array.shift(labels))
  91.  
  92. if array.size(high_pivots) > 1
  93. if i_drawpivots
  94. for pivot in high_pivots
  95. array.push(labels, label.new(pivot.index, pivot.price, "", style=label.style_label_down, size=size.tiny, color=color.new(#99d31b, 70)))
  96.  
  97. tmp = array.new_line()
  98. for i = 0 to array.size(high_pivots) - 1
  99. for j = i to array.size(high_pivots) - 1
  100. if i != j
  101. PivotPoint pp0 = array.get(high_pivots, i)
  102. PivotPoint pp1 = array.get(high_pivots, j)
  103. array.push(tmp, line.new(pp0.index, pp0.price, pp1.index, pp1.price, color=i_hcolor, width = 1, style = line.style_dashed))
  104.  
  105. best_ind = int(na)
  106. if i_trend_old_method
  107. min_val = 10000000.0
  108. for i = 0 to array.size(tmp) - 1
  109. lp = line.get_price(array.get(tmp, i), bar_index)
  110. if lp > high
  111. if min_val > math.abs(lp - close)
  112. min_val := math.abs(lp - close)
  113. best_ind := i
  114. else
  115. best_cnt = 0
  116. for i = 0 to array.size(tmp) - 1
  117. trend = array.get(tmp, i)
  118. cnt = 0
  119.  
  120. for pivot in high_pivots
  121. if line.get_price(trend, pivot.index) >= pivot.price
  122. cnt += 1
  123.  
  124. if cnt > best_cnt
  125. best_cnt := cnt
  126. best_ind := i
  127.  
  128. if cnt == best_cnt
  129. if line.get_price(array.get(tmp, best_ind), bar_index + 1) > line.get_price(trend, bar_index + 1) and line.get_price(trend, bar_index + 1) > i_hsource
  130. best_cnt := cnt
  131. best_ind := i
  132.  
  133. if not na(best_ind)
  134. line.delete(high_trend)
  135. high_trend := array.get(tmp, best_ind)
  136. array.remove(tmp, best_ind)
  137.  
  138. while array.size(tmp) > 0
  139. line.delete(array.shift(tmp))
  140.  
  141. if array.size(low_pivots) > 1
  142. if i_drawpivots
  143. for pivot in low_pivots
  144. array.push(labels, label.new(pivot.index, pivot.price, "", style=label.style_label_up, size=size.tiny, color=color.new(#FA5032, 70)))
  145.  
  146. tmp = array.new_line()
  147. for i = 0 to array.size(low_pivots) - 1
  148. for j = i to array.size(low_pivots) - 1
  149. if i != j
  150. PivotPoint pp0 = array.get(low_pivots, i)
  151. PivotPoint pp1 = array.get(low_pivots, j)
  152. array.push(tmp, line.new(pp0.index, pp0.price, pp1.index, pp1.price, color=i_lcolor, width = 1, style = line.style_dashed))
  153.  
  154. best_ind = int(na)
  155. if i_trend_old_method
  156. min_val = 100000.0
  157. for i = 0 to array.size(tmp) - 1
  158. lp = line.get_price(array.get(tmp, i), bar_index)
  159. if lp < low
  160. if min_val > math.abs(lp - close)
  161. min_val := math.abs(lp - close)
  162. best_ind := i
  163. else
  164. best_cnt = 0
  165. for i = 0 to array.size(tmp) - 1
  166. trend = array.get(tmp, i)
  167. cnt = 0
  168.  
  169. for pivot in low_pivots
  170. if line.get_price(trend, pivot.index) <= pivot.price
  171. cnt += 1
  172.  
  173. if cnt > best_cnt
  174. best_cnt := cnt
  175. best_ind := i
  176.  
  177. if cnt == best_cnt
  178. if line.get_price(array.get(tmp, best_ind), bar_index + 1) < line.get_price(trend, bar_index + 1) and line.get_price(trend, bar_index + 1) < i_lsource
  179. best_cnt := cnt
  180. best_ind := i
  181.  
  182. if not na(best_ind)
  183. line.delete(low_trend)
  184. low_trend := array.get(tmp, best_ind)
  185. array.remove(tmp, best_ind)
  186.  
  187. while array.size(tmp) > 0
  188. line.delete(array.shift(tmp))
  189.  
  190. if not na(low_trend) and not na(high_trend)
  191. for l in labels
  192. if label.get_x(l) == line.get_x1(low_trend) or label.get_x(l) == line.get_x2(low_trend)
  193. label.set_color(l, color.new(#FA5032, 0))
  194. line.set_y2(low_trend, line.get_price(low_trend, bar_index + i_trend_extlen))
  195. line.set_x2(low_trend, bar_index + i_trend_extlen)
  196. line.set_width(low_trend, i_ltrend_width)
  197. line.set_style(low_trend, i_ltrend_style)
  198. if line.get_x1(high_trend) > line.get_x1(low_trend)
  199. line.set_y1(high_trend, line.get_price(high_trend, line.get_x1(low_trend)))
  200. line.set_x1(high_trend, line.get_x1(low_trend))
  201.  
  202. for l in labels
  203. if label.get_x(l) == line.get_x1(high_trend) or label.get_x(l) == line.get_x2(high_trend)
  204. label.set_color(l, color.new(#99d31b, 0))
  205. line.set_y2(high_trend, line.get_price(high_trend, bar_index + i_trend_extlen))
  206. line.set_x2(high_trend, bar_index + i_trend_extlen)
  207. line.set_width(high_trend, i_htrend_width)
  208. line.set_style(high_trend, i_htrend_style)
  209. if line.get_x1(low_trend) > line.get_x1(high_trend)
  210. line.set_y1(low_trend, line.get_price(low_trend, line.get_x1(high_trend)))
  211. line.set_x1(low_trend, line.get_x1(high_trend))
  212.  
  213.  
  214. //you can now use high and low trend line
  215. //if not na(high_trend)
  216. // ...code...
  217.  
  218.  
  219. //HEATMAP
  220. var fills = array.new_linefill()
  221. var lines = array.new_line()
  222.  
  223. while array.size(fills) > 0
  224. linefill.delete(array.shift(fills))
  225. while array.size(lines) > 0
  226. line.delete(array.shift(lines))
  227.  
  228. rsi0 = ta.rsi(close, i_minrsi_len + 0 * (i_maxrsi_len - i_minrsi_len) / 10)
  229. rsi1 = ta.rsi(close, i_minrsi_len + 1 * (i_maxrsi_len - i_minrsi_len) / 10)
  230. rsi2 = ta.rsi(close, i_minrsi_len + 2 * (i_maxrsi_len - i_minrsi_len) / 10)
  231. rsi3 = ta.rsi(close, i_minrsi_len + 3 * (i_maxrsi_len - i_minrsi_len) / 10)
  232. rsi4 = ta.rsi(close, i_minrsi_len + 4 * (i_maxrsi_len - i_minrsi_len) / 10)
  233. rsi5 = ta.rsi(close, i_minrsi_len + 5 * (i_maxrsi_len - i_minrsi_len) / 10)
  234. rsi6 = ta.rsi(close, i_minrsi_len + 6 * (i_maxrsi_len - i_minrsi_len) / 10)
  235. rsi7 = ta.rsi(close, i_minrsi_len + 7 * (i_maxrsi_len - i_minrsi_len) / 10)
  236. rsi8 = ta.rsi(close, i_minrsi_len + 8 * (i_maxrsi_len - i_minrsi_len) / 10)
  237. rsi9 = ta.rsi(close, i_minrsi_len + 9 * (i_maxrsi_len - i_minrsi_len) / 10)
  238. rsi10 = ta.rsi(close, i_minrsi_len + 10 * (i_maxrsi_len - i_minrsi_len) / 10)
  239.  
  240. if not na(high_trend) and not na(low_trend) and barstate.islast and i_drawheatmap
  241. X = i_grid_x //horizontal grid segments OK to change (limited by max_line_count? or something) (max 45 at 500)
  242. Y = 10 //vertical grid segments do NOT change or add rsi11 and so on with other relevant code
  243. for x = 0 to X - 1 by 1
  244. for y = 0 to Y
  245. x0 = int(line.get_x1(low_trend) + x * (bar_index - line.get_x1(low_trend)) / X)
  246. y0 = line.get_price(low_trend, x0) + y * (line.get_price(high_trend, x0) - line.get_price(low_trend, x0)) / Y
  247. x1 = int(line.get_x1(high_trend) + (x + 1) * (bar_index - line.get_x1(high_trend)) / X)
  248. y1 = line.get_price(low_trend, x1) + y * (line.get_price(high_trend, x1) - line.get_price(low_trend, x1)) / Y
  249.  
  250. array.push(lines, line.new(x0, y0, x1, y1, color=na))
  251.  
  252. if array.size(lines) > 1 and y != 0
  253. l0 = array.get(lines, array.size(lines) - 2)
  254. l1 = array.get(lines, array.size(lines) - 1)
  255. if y == 1
  256. array.push(fills, linefill.new(l0, l1, get_color(rsi0[bar_index - x1 + int((x1 - x0) / 2)]))) //get_color(get_avg_rsi(rsi0, bar_index - x1, x1 - x0)) //not working great so lets just take the middle
  257. if y == 2
  258. array.push(fills, linefill.new(l0, l1, get_color(rsi1[bar_index - x1 + int((x1 - x0) / 2)])))
  259. if y == 3
  260. array.push(fills, linefill.new(l0, l1, get_color(rsi2[bar_index - x1 + int((x1 - x0) / 2)])))
  261. if y == 4
  262. array.push(fills, linefill.new(l0, l1, get_color(rsi3[bar_index - x1 + int((x1 - x0) / 2)])))
  263. if y == 5
  264. array.push(fills, linefill.new(l0, l1, get_color(rsi4[bar_index - x1 + int((x1 - x0) / 2)])))
  265. if y == 6
  266. array.push(fills, linefill.new(l0, l1, get_color(rsi5[bar_index - x1 + int((x1 - x0) / 2)])))
  267. if y == 7
  268. array.push(fills, linefill.new(l0, l1, get_color(rsi6[bar_index - x1 + int((x1 - x0) / 2)])))
  269. if y == 8
  270. array.push(fills, linefill.new(l0, l1, get_color(rsi7[bar_index - x1 + int((x1 - x0) / 2)])))
  271. if y == 9
  272. array.push(fills, linefill.new(l0, l1, get_color(rsi8[bar_index - x1 + int((x1 - x0) / 2)])))
  273. if y == 10
  274. array.push(fills, linefill.new(l0, l1, get_color(rsi9[bar_index - x1 + int((x1 - x0) / 2)])))
  275.  
  276.  
  277. //FIBONACI
  278. var fibs = array.new_line()
  279.  
  280. while array.size(fibs) > 0
  281. line.delete(array.shift(fibs))
  282.  
  283. if not na(high_trend) and not na(low_trend) and barstate.islast and i_drawfibs
  284. left = line.get_x1(low_trend)
  285. right = bar_index + i_trend_extlen
  286. left_val = interp(line.get_price(low_trend, left) , line.get_price(high_trend, left) , -0.618)
  287. right_val = interp(line.get_price(low_trend, right), line.get_price(high_trend, right), -0.618)
  288. array.push(fibs, line.new(left, left_val, right, right_val, style=i_fibline_styles, width=i_fibline_widths, color=color.from_gradient(right_val, line.get_price(low_trend, right), line.get_price(high_trend, right), i_lcolor , i_hcolor)))
  289. left_val := interp(line.get_price(low_trend, left) , line.get_price(high_trend, left) , 0.236)
  290. right_val := interp(line.get_price(low_trend, right), line.get_price(high_trend, right), 0.236)
  291. array.push(fibs, line.new(left, left_val, right, right_val, style=i_fibline_styles, width=i_fibline_widths, color=color.from_gradient(right_val, line.get_price(low_trend, right), line.get_price(high_trend, right), i_lcolor , i_hcolor)))
  292. left_val := interp(line.get_price(low_trend, left) , line.get_price(high_trend, left) , 0.382)
  293. right_val := interp(line.get_price(low_trend, right), line.get_price(high_trend, right), 0.382)
  294. array.push(fibs, line.new(left, left_val, right, right_val, style=i_fibline_styles, width=i_fibline_widths, color=color.from_gradient(right_val, line.get_price(low_trend, right), line.get_price(high_trend, right), i_lcolor , i_hcolor)))
  295. left_val := interp(line.get_price(low_trend, left) , line.get_price(high_trend, left) , 0.5)
  296. right_val := interp(line.get_price(low_trend, right), line.get_price(high_trend, right), 0.5)
  297. array.push(fibs, line.new(left, left_val, right, right_val, style=i_fibline_styles, width=i_fibline_widths, color=color.from_gradient(right_val, line.get_price(low_trend, right), line.get_price(high_trend, right), i_lcolor , i_hcolor)))
  298. left_val := interp(line.get_price(low_trend, left) , line.get_price(high_trend, left) , 0.618)
  299. right_val := interp(line.get_price(low_trend, right), line.get_price(high_trend, right), 0.618)
  300. array.push(fibs, line.new(left, left_val, right, right_val, style=i_fibline_styles, width=i_fibline_widths, color=color.from_gradient(right_val, line.get_price(low_trend, right), line.get_price(high_trend, right), i_lcolor , i_hcolor)))
  301. left_val := interp(line.get_price(low_trend, left) , line.get_price(high_trend, left) , 0.75)
  302. right_val := interp(line.get_price(low_trend, right), line.get_price(high_trend, right), 0.75)
  303. array.push(fibs, line.new(left, left_val, right, right_val, style=i_fibline_styles, width=i_fibline_widths, color=color.from_gradient(right_val, line.get_price(low_trend, right), line.get_price(high_trend, right), i_lcolor , i_hcolor)))
  304. left_val := interp(line.get_price(low_trend, left) , line.get_price(high_trend, left) , 1.618)
  305. right_val := interp(line.get_price(low_trend, right), line.get_price(high_trend, right), 1.618)
  306. array.push(fibs, line.new(left, left_val, right, right_val, style=i_fibline_styles, width=i_fibline_widths, color=color.from_gradient(right_val, line.get_price(low_trend, right), line.get_price(high_trend, right), i_lcolor , i_hcolor)))
  307.  
  308. if i_drawfibs_extended
  309. left_val := interp(line.get_price(low_trend, left) , line.get_price(high_trend, left) , 2.618)
  310. right_val := interp(line.get_price(low_trend, right), line.get_price(high_trend, right), 2.618)
  311. array.push(fibs, line.new(left, left_val, right, right_val, style=i_fibline_styles, width=i_fibline_widths, color=color.from_gradient(right_val, line.get_price(low_trend, right), line.get_price(high_trend, right), i_lcolor , i_hcolor)))
  312. left_val := interp(line.get_price(low_trend, left) , line.get_price(high_trend, left) , 3.618)
  313. right_val := interp(line.get_price(low_trend, right), line.get_price(high_trend, right), 3.618)
  314. array.push(fibs, line.new(left, left_val, right, right_val, style=i_fibline_styles, width=i_fibline_widths, color=color.from_gradient(right_val, line.get_price(low_trend, right), line.get_price(high_trend, right), i_lcolor , i_hcolor)))
  315. left_val := interp(line.get_price(low_trend, left) , line.get_price(high_trend, left) , 4.236)
  316. right_val := interp(line.get_price(low_trend, right), line.get_price(high_trend, right), 4.236)
  317. array.push(fibs, line.new(left, left_val, right, right_val, style=i_fibline_styles, width=i_fibline_widths, color=color.from_gradient(right_val, line.get_price(low_trend, right), line.get_price(high_trend, right), i_lcolor , i_hcolor)))
  318.  
  319.  
  320.  
  321.  
  322. //ALERTS
  323. var line alert_zone_low = line(na)
  324. var line alert_zone_high = line(na)
  325. var linefill alert_zone_low_linefill = linefill(na)
  326. var linefill alert_zone_high_linefill = linefill(na)
  327. var label alert_label = label(na)
  328.  
  329. if not na(low_trend) and not na(high_trend) and barstate.islast and i_alerts_enabled
  330. clp = line.get_price(low_trend, bar_index)
  331. chp = line.get_price(high_trend, bar_index)
  332.  
  333. ldiff = (close - clp) / (chp - clp)
  334. hdiff = (chp - close) / (chp - clp)
  335.  
  336. label.delete(alert_label)
  337.  
  338. if ldiff <= i_alerts_low_trend_trigger_pct and ldiff > 0.0
  339. alert_label := label.new(bar_index + 3, close, str.tostring(ldiff, "buy #.##%"), style=label.style_label_left)
  340. alert("Possible bounce incoming " + syminfo.ticker, alert.freq_once_per_bar)
  341. else if hdiff <= i_alerts_high_trend_trigger_pct and hdiff > 0.0
  342. alert_label := label.new(bar_index + 3, close, str.tostring(hdiff, "sell #.##%"), style=label.style_label_left)
  343. alert("Possible drop incoming " + syminfo.ticker, alert.freq_once_per_bar)
  344.  
  345. if i_alerts_draw_alert_zones
  346. line.delete(alert_zone_low)
  347. line.delete(alert_zone_high)
  348.  
  349. x0 = bar_index
  350. y0 = clp + (chp - clp) * i_alerts_low_trend_trigger_pct
  351. x1 = bar_index + i_trend_extlen
  352. y1 = line.get_price(low_trend, x1) + (line.get_price(high_trend, x1) - line.get_price(low_trend, x1)) * i_alerts_low_trend_trigger_pct
  353. alert_zone_low := line.new(x0, y0, x1, y1, color=i_lcolor)
  354. if i_alerts_fill_alert_zones
  355. linefill.delete(alert_zone_low_linefill)
  356. alert_zone_low_linefill := linefill.new(low_trend, alert_zone_low, color.new(i_lcolor, 70))
  357.  
  358. x0 := bar_index
  359. y0 := clp + (chp - clp) * (1.0 - i_alerts_high_trend_trigger_pct)
  360. x1 := bar_index + i_trend_extlen
  361. y1 := line.get_price(low_trend, x1) + (line.get_price(high_trend, x1) - line.get_price(low_trend, x1)) * (1.0 - i_alerts_high_trend_trigger_pct)
  362. alert_zone_high := line.new(x0, y0, x1, y1, color=i_hcolor)
  363. if i_alerts_fill_alert_zones
  364. linefill.delete(alert_zone_high_linefill)
  365. alert_zone_high_linefill := linefill.new(high_trend, alert_zone_high, color.new(i_hcolor, 70))
  366.  
Advertisement
Comments
Add Comment
Please, Sign In to add comment
Advertisement