Advertisement
Guest User

Sector RS 0.1

a guest
Sep 7th, 2022
113
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 19.03 KB | None | 0 0
  1. // This script is a modified version of the original script from axg_ or u/squattingsquid
  2. // Get the original : https://www.tradingview.com/script/EJ1aJKOg-Relative-Strength-Screener-V2-Top-100-volume-leaders/
  3.  
  4. // The sorting system was inspired by LuxGecko an his Bubble Sort function
  5. // Get the original : https://www.tradingview.com/script/mMF7fVKO-Pinescript-Bubble-Sort-using-Arrays/
  6.  
  7. //@version=5
  8.  
  9. // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
  10.  
  11.  
  12. indicator("Sector Relative Strength", shorttitle = "Sector RS", overlay = true)
  13.  
  14.  
  15. // INPUTS // ---------------------------------------------------------------
  16.  
  17. // Parameters //
  18.  
  19.  
  20. var string cl = "Price", var string ch = "Change", var string rs = "Relative strength", var string rv = "Relative volume", var string nan = "Empty"
  21. var string co1 = "Column 1", var string co2 = "Column 2", var string co3 = "Column 3", var string co4 = "Column 4", var string co5 = "Column 5", var string des = "Desactivated"
  22. var string l = "Left", var string c = "Center", var string r = "Right"
  23. var string s = "Small", var string m = "Medium"
  24.  
  25.  
  26. in_n = input.symbol (defval = "SPY", title = "Comparison Symbol", group = "Calculation inputs")
  27.  
  28. //co_n = input.string (defval = ch, title = "Number of columns", group = "Table size parameters")
  29.  
  30. co_1 = input.string (defval = ch, title = "First column content", group = "First column parameters", options = [des, cl, ch, rs, rv])
  31. tf_1 = input.timeframe (defval = "5", title = "First column timeframe", group = "First column parameters")
  32. le_1 = input.int (defval = 12, title = "First column period", group = "First column parameters")
  33.  
  34. co_2 = input.string (defval = rs, title = "Second column content", group = "Second column parameters", options = [des, cl, ch, rs, rv])
  35. tf_2 = input.timeframe (defval = "5", title = "Second column timeframe", group = "Second column parameters")
  36. le_2 = input.int (defval = 12, title = "Second column period", group = "Second column parameters")
  37.  
  38. co_3 = input.string (defval = rs, title = "Third column content", group = "Third column parameters", options = [des, cl, ch, rs, rv])
  39. tf_3 = input.timeframe (defval = "15", title = "Third column timeframe", group = "Third column parameters")
  40. le_3 = input.int (defval = 12, title = "Third column period", group = "Third column parameters")
  41.  
  42. co_4 = input.string (defval = rs, title = "Fourth column content", group = "Fourth column parameters", options = [des, cl, ch, rs, rv])
  43. tf_4 = input.timeframe (defval = "30", title = "Fourth column timeframe", group = "Fourth column parameters")
  44. le_4 = input.int (defval = 12, title = "Fourth column period", group = "Fourth column parameters")
  45.  
  46. co_5 = input.string (defval = rv, title = "Fifth column content", group = "Fifth column parameters", options = [des, cl, ch, rs, rv])
  47. tf_5 = input.timeframe (defval = "5", title = "Fifth column timeframe", group = "Fifth column parameters")
  48. le_5 = input.int (defval = 78, title = "Fifth column period", group = "Fifth column parameters")
  49.  
  50. so_p = input.string (defval = co1, title = "Activate sorting using", group = "Sorting parameters", options = [des, co1, co2, co3, co4, co5])
  51.  
  52. cl_1 = input.float (defval = 0.75, title = "Upper limit", group = "Heatmap parameters")
  53. cl_2 = input.float (defval = 0.50, title = "Middle limit", group = "Heatmap parameters")
  54. cl_3 = input.float (defval = 0.25, title = "Lower limit", group = "Heatmap parameters")
  55.  
  56. cl_s = input.bool (defval = true, title = "Dark mode", group = "Color theme")
  57.  
  58. ta_s = input.string (defval = s, title = "Text size", group = "Table display setting", options = [s, m])
  59. ta_p = input.string (defval = r, title = "Position of table", group = "Table display setting", options = [l, c, r])
  60.  
  61.  
  62. // Symbol selection //
  63.  
  64.  
  65. s01 = "XLC", s02 = "XLY", s03 = "XLP", s04 = "XLE", s05 = "XLF", s06 = "XLV", s07 = "XLI", s08 = "XLB", s09 = "XLRE", s10 = "XLK", s11 = "XLU"
  66.  
  67.  
  68. // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
  69.  
  70. // TIMEFRAME // ------------------------------------------------------------
  71.  
  72. // Timeframes converter //
  73.  
  74.  
  75. bi = (time - time_tradingday) / (60000 * 5) - (96 + 78)
  76.  
  77. tf_f (co_x, tf_x) =>
  78. tf_v = (
  79. tf_x == "5" ? 1 :
  80. tf_x == "15" ? 3 :
  81. tf_x == "30" ? 6 :
  82. tf_x == "45" ? 9 :
  83. tf_x == "60" ? 12 :
  84. tf_x == "120" ? 24 :
  85. tf_x == "180" ? 36 :
  86. tf_x == "240" ? 48 :
  87. tf_x == "1D" ? 78 : na)
  88.  
  89. tf_b = co_x == rs ? bi - int(bi / tf_v) * tf_v : na
  90. tf_bc = co_x == rs ? tf_b > 0 ? tf_b + 1 : 1 : na
  91.  
  92. [tf_v, tf_bc]
  93.  
  94.  
  95. [tf1_v, tf1_b] = tf_f (co_1, tf_1)
  96. [tf2_v, tf2_b] = tf_f (co_2, tf_2)
  97. [tf3_v, tf3_b] = tf_f (co_3, tf_3)
  98. [tf4_v, tf4_b] = tf_f (co_4, tf_4)
  99. [tf5_v, tf5_b] = tf_f (co_5, tf_5)
  100.  
  101.  
  102. // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
  103.  
  104. // FORMULAS // -------------------------------------------------------------
  105.  
  106. // Power index formula //
  107.  
  108.  
  109. pi_f (tf_v, tf_b, le_x) =>
  110.  
  111. tf_h = ta.highest (high, tf_b)
  112. tf_l = ta.lowest (low, tf_b)
  113. tf_c = ta.change (close, tf_v * (le_x - 1) + tf_b)
  114.  
  115. tf_tr = math.max(tf_h - tf_l, math.abs(tf_h - close[tf_b]), math.abs(tf_l - close[tf_b]))
  116.  
  117. tf_atr = 0.0
  118. tf_atr := (1 / le_x) * tf_tr + (1 - (1 / le_x)) * nz(tf_atr[tf_b])
  119.  
  120. tf_pi = tf_c / tf_atr
  121.  
  122.  
  123. // Relative strength formula //
  124.  
  125.  
  126. rs_f (tf_v, tf_b, le_x, co_i) =>
  127.  
  128. tf_h = ta.highest (high, tf_b)
  129. tf_l = ta.lowest (low, tf_b)
  130. tf_c = ta.change (close, tf_v * (le_x - 1) + tf_b)
  131.  
  132. tf_tr = math.max(tf_h - tf_l, math.abs(tf_h - close[tf_b]), math.abs(tf_l - close[tf_b]))
  133.  
  134. tf_atr = 0.0
  135. tf_atr := (1 / le_x) * tf_tr + (1 - (1 / le_x)) * nz(tf_atr[tf_b])
  136.  
  137. tf_rs = (tf_c - co_i * tf_atr) / tf_atr
  138.  
  139.  
  140. // Relative volume formula //
  141.  
  142.  
  143. rv_f (tf_v, le_x) => math.round(math.sum (volume, tf_v) / (ta.sma(volume, le_x) * tf_v), 2)
  144.  
  145.  
  146. // Change formula //
  147.  
  148.  
  149. ch_f (tf_v) => math.round(ta.change (close, tf_v) / close [tf_v] * 100, 2)
  150.  
  151.  
  152. // Index request controler //
  153.  
  154.  
  155. ir_co (co_x, tf_v, tf_b, le_x) => co_x == cl ? close : co_x == ch ? ch_f(tf_v) : co_x == rs ? pi_f(tf_v, tf_b, le_x) : co_x == rv ? rv_f(tf_v, le_x) : na
  156.  
  157.  
  158. // Symbol request controler //
  159.  
  160.  
  161. sr_co (co_x, tf_v, tf_b, le_x, co_i) => co_x == cl ? close : co_x == ch ? ch_f(tf_v) : co_x == rs ? rs_f(tf_v, tf_b, le_x, co_i) : co_x == rv ? rv_f(tf_v, le_x) : na
  162.  
  163.  
  164. // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
  165.  
  166. // REQUESTS // -------------------------------------------------------------
  167.  
  168. // Index requests //
  169.  
  170.  
  171. in_r () =>
  172.  
  173. co1_i = ir_co (co_1, tf1_v, tf1_b, le_1)
  174. co2_i = ir_co (co_2, tf2_v, tf2_b, le_2)
  175. co3_i = ir_co (co_3, tf3_v, tf3_b, le_3)
  176. co4_i = ir_co (co_4, tf4_v, tf4_b, le_4)
  177. co5_i = ir_co (co_5, tf5_v, tf5_b, le_5)
  178.  
  179. [co1_i, co2_i ,co3_i, co4_i, co5_i]
  180.  
  181. [co1_i, co2_i ,co3_i, co4_i, co5_i] = request.security(in_n, "5", in_r())
  182.  
  183.  
  184. // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
  185.  
  186. // Symbol requests //
  187.  
  188.  
  189. sy_r () =>
  190.  
  191. co1_s = sr_co (co_1, tf1_v, tf1_b, le_1, co1_i)
  192. co2_s = sr_co (co_2, tf2_v, tf2_b, le_2, co2_i)
  193. co3_s = sr_co (co_3, tf3_v, tf3_b, le_3, co3_i)
  194. co4_s = sr_co (co_4, tf4_v, tf4_b, le_4, co4_i)
  195. co5_s = sr_co (co_5, tf5_v, tf5_b, le_5, co5_i)
  196.  
  197. [co1_s, co2_s ,co3_s, co4_s, co5_s]
  198.  
  199. [co1_01, co2_01, co3_01, co4_01, co5_01] = request.security(s01, "5", sy_r())
  200. [co1_02, co2_02, co3_02, co4_02, co5_02] = request.security(s02, "5", sy_r())
  201. [co1_03, co2_03, co3_03, co4_03, co5_03] = request.security(s03, "5", sy_r())
  202. [co1_04, co2_04, co3_04, co4_04, co5_04] = request.security(s04, "5", sy_r())
  203. [co1_05, co2_05, co3_05, co4_05, co5_05] = request.security(s05, "5", sy_r())
  204. [co1_06, co2_06, co3_06, co4_06, co5_06] = request.security(s06, "5", sy_r())
  205. [co1_07, co2_07, co3_07, co4_07, co5_07] = request.security(s07, "5", sy_r())
  206. [co1_08, co2_08, co3_08, co4_08, co5_08] = request.security(s08, "5", sy_r())
  207. [co1_09, co2_09, co3_09, co4_09, co5_09] = request.security(s09, "5", sy_r())
  208. [co1_10, co2_10, co3_10, co4_10, co5_10] = request.security(s10, "5", sy_r())
  209. [co1_11, co2_11, co3_11, co4_11, co5_11] = request.security(s11, "5", sy_r())
  210.  
  211.  
  212. // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
  213.  
  214. // ARRAYS // ---------------------------------------------------------------
  215.  
  216.  
  217. s_arr = array.new_string (0)
  218. co1_arr = array.new_float (0), co2_arr = array.new_float (0)
  219. co3_arr = array.new_float (0), co4_arr = array.new_float (0)
  220. co5_arr = array.new_float (0)
  221.  
  222.  
  223. // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
  224.  
  225. // Filling the arrays //
  226.  
  227.  
  228. array.push(s_arr, "Communication - XLC"), array.push(co1_arr, co1_01), array.push(co2_arr, co2_01), array.push(co3_arr, co3_01), array.push(co4_arr, co4_01), array.push(co5_arr, co5_01)
  229. array.push(s_arr, "Cons Disctret - XLY"), array.push(co1_arr, co1_02), array.push(co2_arr, co2_02), array.push(co3_arr, co3_02), array.push(co4_arr, co4_02), array.push(co5_arr, co5_02)
  230. array.push(s_arr, "Cons Staples - XLP"), array.push(co1_arr, co1_03), array.push(co2_arr, co2_03), array.push(co3_arr, co3_03), array.push(co4_arr, co4_03), array.push(co5_arr, co5_03)
  231. array.push(s_arr, "Energy - XLE"), array.push(co1_arr, co1_04), array.push(co2_arr, co2_04), array.push(co3_arr, co3_04), array.push(co4_arr, co4_04), array.push(co5_arr, co5_04)
  232. array.push(s_arr, "Financial - XLF"), array.push(co1_arr, co1_05), array.push(co2_arr, co2_05), array.push(co3_arr, co3_05), array.push(co4_arr, co4_05), array.push(co5_arr, co5_05)
  233. array.push(s_arr, "Healthcare - XLV"), array.push(co1_arr, co1_06), array.push(co2_arr, co2_06), array.push(co3_arr, co3_06), array.push(co4_arr, co4_06), array.push(co5_arr, co5_06)
  234. array.push(s_arr, "Industrials - XLI"), array.push(co1_arr, co1_07), array.push(co2_arr, co2_07), array.push(co3_arr, co3_07), array.push(co4_arr, co4_07), array.push(co5_arr, co5_07)
  235. array.push(s_arr, "Materials - XLB"), array.push(co1_arr, co1_08), array.push(co2_arr, co2_08), array.push(co3_arr, co3_08), array.push(co4_arr, co4_08), array.push(co5_arr, co5_08)
  236. array.push(s_arr, "Real Estate - XLRE"), array.push(co1_arr, co1_09), array.push(co2_arr, co2_09), array.push(co3_arr, co3_09), array.push(co4_arr, co4_09), array.push(co5_arr, co5_09)
  237. array.push(s_arr, "Technology - XLK"), array.push(co1_arr, co1_10), array.push(co2_arr, co2_10), array.push(co3_arr, co3_10), array.push(co4_arr, co4_10), array.push(co5_arr, co5_10)
  238. array.push(s_arr, "Utilities - XLU"), array.push(co1_arr, co1_11), array.push(co2_arr, co2_11), array.push(co3_arr, co3_11), array.push(co4_arr, co4_11), array.push(co5_arr, co5_11)
  239.  
  240.  
  241. // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
  242.  
  243. // Sorting the arrays //
  244.  
  245.  
  246. if so_p != des
  247. so_c = so_p == co1 ? co1_arr : so_p == co2 ? co2_arr : so_p == co3 ? co3_arr : so_p == co4 ? co4_arr : co5_arr
  248. n = array.size(so_c) - 1
  249. for i = 0 to n - 1
  250. for j = 0 to n - i - 1
  251. if array.get(so_c , j) < array.get(so_c, j+1)
  252.  
  253. s_temp = array.get(s_arr, j)
  254. array.set(s_arr, j, array.get(s_arr, j + 1))
  255. array.set(s_arr, j + 1, s_temp)
  256.  
  257. co1_temp = array.get(co1_arr, j)
  258. array.set(co1_arr, j, array.get(co1_arr, j + 1))
  259. array.set(co1_arr, j + 1, co1_temp)
  260.  
  261. co2_temp = array.get(co2_arr, j)
  262. array.set(co2_arr, j, array.get(co2_arr, j + 1))
  263. array.set(co2_arr, j + 1, co2_temp)
  264.  
  265. co3_temp = array.get(co3_arr, j)
  266. array.set(co3_arr, j, array.get(co3_arr, j + 1))
  267. array.set(co3_arr, j + 1, co3_temp)
  268.  
  269. co4_temp = array.get(co4_arr, j)
  270. array.set(co4_arr, j, array.get(co4_arr, j + 1))
  271. array.set(co4_arr, j + 1, co4_temp)
  272.  
  273. co5_temp = array.get(co5_arr, j)
  274. array.set(co5_arr, j, array.get(co5_arr, j + 1))
  275. array.set(co5_arr, j + 1, co5_temp)
  276.  
  277.  
  278. // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
  279.  
  280. // TABLE // ----------------------------------------------------------------
  281.  
  282. // Graphical variables //
  283.  
  284.  
  285. g_1 = color.rgb(016, 158, 119), r_1 = color.rgb(239, 083, 080)
  286. g_2 = cl_s ? color.rgb(017, 124, 098) : color.rgb(076, 182, 153), r_2 = cl_s ? color.rgb(184, 068, 069) : color.rgb(245, 126, 124)
  287. g_3 = cl_s ? color.rgb(017, 090, 077) : color.rgb(135, 206, 187), r_3 = cl_s ? color.rgb(129, 053, 057) : color.rgb(247, 169, 167)
  288. g_4 = cl_s ? color.rgb(018, 057, 055) : color.rgb(195, 231, 221), r_4 = cl_s ? color.rgb(073, 037, 046) : color.rgb(249, 193, 192)
  289. bkg = cl_s ? color.rgb(019, 023, 034) : color.white, txt = cl_s ? color.white : color.black
  290.  
  291. cl_f1 (val) => val > 0 ? g_1 : val < 0 ? r_1 : txt
  292. cl_f2 (val) => val > cl_1 ? g_1 : val > cl_2 ? g_2 : val > cl_3 ? g_3 : val > 0.0 ? g_4 : val > -cl_3 ? r_4 : val > -cl_2 ? r_3 : val > -cl_1 ? r_2 : r_1
  293.  
  294. brd_s = ta_s == s ? 2 : 3
  295. txt_s = ta_s == s ? size.small : size.normal
  296.  
  297. ta_pl = ta_p == r ? position.top_right : ta_p == c ? position.top_center : position.top_left
  298.  
  299.  
  300. // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
  301.  
  302. // Columns calculator //
  303.  
  304.  
  305. co1_pl = (co_1 != des ? 1 : 0)
  306. co2_pl = (co_2 != des ? 1 : 0) + co1_pl
  307. co3_pl = (co_3 != des ? 1 : 0) + co2_pl
  308. co4_pl = (co_4 != des ? 1 : 0) + co3_pl
  309. co5_pl = (co_4 != des ? 1 : 0) + co4_pl
  310.  
  311. // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
  312.  
  313. // Filling the table //
  314.  
  315.  
  316. co_n (co_x, tf_x) => co_x == cl ? "Price" : co_x == ch ? "Change " + tf_x : co_x == rs ? " RS " + tf_x + " ": co_x == rv ? " RV " + tf_x + " " : na
  317.  
  318. in_ns = str.substring(in_n, str.pos(in_n, ":") + 1)
  319.  
  320. var tbl = table.new(ta_pl, co5_pl + 1, 14, border_width = brd_s, border_color = bkg)
  321.  
  322. if barstate.islast
  323.  
  324. table.cell(tbl, 0, 0, "Symbol", text_halign = text.align_right, bgcolor = bkg, text_color = txt, text_size = size.normal)
  325. table.cell(tbl, 0, 1, str.tostring(in_ns), text_halign = text.align_right, bgcolor = bkg, text_color = txt, text_size = txt_s)
  326.  
  327. for i = 0 to 10
  328. table.cell(tbl, 0, i + 2, array.get(s_arr, i), text_halign = text.align_right, bgcolor = bkg, text_color = txt, text_size = txt_s)
  329.  
  330. if co_1 != des
  331.  
  332. table.cell(tbl, co1_pl, 0, co_n (co_1, tf_1), text_halign = text.align_center, bgcolor = bkg, text_color = txt, text_size = size.normal)
  333. table.cell(tbl, co1_pl, 1, str.tostring(co1_i, "#.##") + (co_1 == ch ? " %" : na), text_halign = text.align_center, bgcolor = co_1 == rs ? cl_f2 (co1_i) : bkg, text_color = co_1 == rs ? txt : co_1 == cl ? txt : cl_f1 (co1_i), text_size = txt_s)
  334.  
  335. for i = 0 to 10
  336. table.cell(tbl, co1_pl, i + 2, str.tostring(array.get(co1_arr, i), "#.##") + (co_1 == ch ? " %" : na), text_halign = text.align_center, bgcolor = co_1 == rs ? cl_f2 (array.get(co1_arr, i)) : bkg, text_color = co_1 == rs ? txt : cl_f1 (array.get(co1_arr, i)), text_size = txt_s)
  337.  
  338. if co_2 != des
  339.  
  340. table.cell(tbl, co2_pl, 0, co_n (co_2, tf_2), text_halign = text.align_center, bgcolor = bkg, text_color = txt, text_size = size.normal)
  341. table.cell(tbl, co2_pl, 1, str.tostring(co2_i, "#.##") + (co_2 == ch ? " %" : na), text_halign = text.align_center, bgcolor = co_2 == rs ? cl_f2 (co2_i) : bkg, text_color = co_2 == rs ? txt : co_2== cl ? txt : cl_f1 (co2_i), text_size = txt_s)
  342.  
  343. for i = 0 to 10
  344. table.cell(tbl, co2_pl, i + 2, str.tostring(array.get(co2_arr, i), "#.##") + (co_2 == ch ? " %" : na), text_halign = text.align_center, bgcolor = co_2 == rs ? cl_f2 (array.get(co2_arr, i)) : bkg, text_color = co_2 == rs ? txt : cl_f1 (array.get(co2_arr, i)), text_size = txt_s)
  345.  
  346. if co_3 != des
  347.  
  348. table.cell(tbl, co3_pl, 0, co_n (co_3, tf_3), text_halign = text.align_center, bgcolor = bkg, text_color = txt, text_size = size.normal)
  349. table.cell(tbl, co3_pl, 1, str.tostring(co3_i, "#.##") + (co_3 == ch ? " %" : na), text_halign = text.align_center, bgcolor = co_3 == rs ? cl_f2 (co3_i) : bkg, text_color = co_3 == rs ? txt : co_3 == cl ? txt : cl_f1 (co3_i), text_size = txt_s)
  350.  
  351. for i = 0 to 10
  352. table.cell(tbl, co3_pl, i + 2, str.tostring(array.get(co3_arr, i), "#.##") + (co_3 == ch ? " %" : na), text_halign = text.align_center, bgcolor = co_3 == rs ? cl_f2 (array.get(co3_arr, i)) : bkg, text_color = co_3 == rs ? txt : cl_f1 (array.get(co3_arr, i)), text_size = txt_s)
  353.  
  354. if co_4 != des
  355.  
  356. table.cell(tbl, co4_pl, 0, co_n (co_4, tf_4), text_halign = text.align_center, bgcolor = bkg, text_color = txt, text_size = size.normal)
  357. table.cell(tbl, co4_pl, 1, str.tostring(co4_i, "#.##") + (co_4 == ch ? " %" : na), text_halign = text.align_center, bgcolor = co_4 == rs ? cl_f2 (co4_i) : bkg, text_color = co_4 == rs ? txt : co_4 == cl ? txt : cl_f1 (co4_i), text_size = txt_s)
  358.  
  359. for i = 0 to 10
  360. table.cell(tbl, co4_pl, i + 2, str.tostring(array.get(co4_arr, i), "#.##") + (co_4 == ch ? " %" : na), text_halign = text.align_center, bgcolor = co_4 == rs ? cl_f2 (array.get(co4_arr, i)) : bkg, text_color = co_4 == rs ? txt : cl_f1 (array.get(co4_arr, i)), text_size = txt_s)
  361.  
  362. if co_5 != des
  363.  
  364. table.cell(tbl, co5_pl, 0, co_n (co_5, tf_5), text_halign = text.align_center, bgcolor = bkg, text_color = txt, text_size = size.normal)
  365. table.cell(tbl, co5_pl, 1, str.tostring(co5_i, "#.##") + (co_5 == ch ? " %" : na), text_halign = text.align_center, bgcolor = co_5 == rs ? cl_f2 (co5_i) : bkg, text_color = co_5 == rs ? txt : co_5 == cl ? txt : cl_f1 (co5_i), text_size = txt_s)
  366.  
  367. for i = 0 to 10
  368. table.cell(tbl, co5_pl, i + 2, str.tostring(array.get(co5_arr, i), "#.##") + (co_5 == ch ? " %" : na), text_halign = text.align_center, bgcolor = co_5 == rs ? cl_f2 (array.get(co5_arr, i)) : bkg, text_color = co_5 == rs ? txt : cl_f1 (array.get(co5_arr, i)), text_size = txt_s)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement