Advertisement
Nick42_for_win

FREE ALGOs [007 Swing System]

Jul 2nd, 2022
3,244
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 60.81 KB | None | 0 0
  1. // 8888888888 8888888b. 8888888888 8888888888 d8888 888 .d8888b. .d88888b. As you
  2. // 888 888 Y88b 888 888 d88888 888 d88P Y88b d88P" "Y88b Can see
  3. // 888 888 888 888 888 d88P888 888 888 888 888 888 Are all
  4. // 8888888 888 d88P 8888888 8888888 d88P 888 888 888 888 888 .d8888b Basic free
  5. // 888 8888888P" 888 888 d88P 888 888 888 88888 888 888 88K tradingview
  6. // 888 888 T88b 888 888 d88P 888 888 888 888 888 888 "Y8888b. indicators
  7. // 888 888 T88b 888 888 d8888888888 888 Y88b d88P Y88b. .d88P X88 repackaged
  8. // 888 888 T88b 8888888888 8888888888 d88P 888 88888888 "Y8888P88 "Y88888P" 88888P' into one
  9. //
  10. // FAQ
  11. //
  12. // Why?
  13. // I want you to see what you are willing to pay hundereds of dollars a month
  14.  
  15. // Has the code been leaked/hacked?
  16. // No, this code has been created only using common sense and public information from the internet
  17.  
  18. // What's the accuracy I can expect from this version of the indicator?
  19. // I'd say it's about 95% the same as the one you would pay
  20.  
  21. // The indicator needs to be updated?
  22. // Write me a private message on TradingView (Nick42_for_win)
  23.  
  24. // Can I suggest an indicator to get a FREE ALGOs version?
  25. // Write me a private message on TradingView (Nick42_for_win)
  26.  
  27. // Do you get any monetary return from this project?
  28. // Nope, 0$
  29.  
  30. // Enjoy ;)
  31.  
  32. //@version=5
  33. indicator("FREE ALGOs [007 Swing System]", overlay=true)
  34.  
  35. //------------ 007 Swing System | app.beta.xtrades.net/xhub/list -------------//
  36. // Get user input
  37. tolBuy = input.float (0.07 , "Tolerance for buy" , group="CHART")
  38. col1 = input.color (color.new(color.green , 50), "" , inline="COL0", group="CHART")
  39. col2 = input.color (color.new(color.red , 50), "" , inline="COL0", group="CHART")
  40. col3 = input.color (color.new(color.blue , 20), "" , inline="COL0", group="CHART")
  41. col4 = input.color (color.new(color.purple, 20), "" , inline="COL0", group="CHART")
  42. col5 = input.color (color.new(color.yellow, 20), "" , inline="COL0", group="CHART")
  43. sizeBlock = input.int (200 , "Bars in profile block" , 10, 500 , group="VOLUME PROFILE")
  44. slices = input.int (40 , "Slices" , 1, 40 , group="VOLUME PROFILE")
  45. rowWidth = input.int (100 , "Visual row width" , 10 , group="VOLUME PROFILE")
  46. showPeaks = input (true , "Show peaks" , group="VOLUME PROFILE")
  47. customSrcVol = input (false , "Use custom volume source" , group="VOLUME PROFILE")
  48. srcVolSym = input.symbol("" , "Custom volume source symbol" , group="VOLUME PROFILE")
  49. colBounds = input.color (color.new(color.blue , 20), "" , inline="COL1", group="VOLUME PROFILE")
  50. colProfile = input.color (color.new(color.blue , 20), "" , inline="COL1", group="VOLUME PROFILE")
  51. colPeak = input.color (color.new(color.purple, 20), "" , inline="COL1", group="VOLUME PROFILE")
  52. // Get components
  53. maFast = ta.ema(close, 24)
  54. maSlow = ta.ema(close, 52)
  55. maMorB = ta.sma(close, 103)
  56. custom_volume = customSrcVol ? request.security(srcVolSym, timeframe.period, volume, lookahead=barmerge.lookahead_on) : volume
  57. block_high = ta.highest(high, sizeBlock)
  58. block_low = ta.lowest(low, sizeBlock)
  59. float highest_row_value = 0
  60. float row0_price = na
  61. int row0_width = 0
  62. float row0_value = 0.0
  63. row0_is_peak = false
  64. float row1_price = na
  65. int row1_width = 0
  66. float row1_value = 0.0
  67. row1_is_peak = false
  68. float row2_price = na
  69. int row2_width = 0
  70. float row2_value = 0.0
  71. row2_is_peak = false
  72. float row3_price = na
  73. int row3_width = 0
  74. float row3_value = 0.0
  75. row3_is_peak = false
  76. float row4_price = na
  77. int row4_width = 0
  78. float row4_value = 0.0
  79. row4_is_peak = false
  80. float row5_price = na
  81. int row5_width = 0
  82. float row5_value = 0.0
  83. row5_is_peak = false
  84. float row6_price = na
  85. int row6_width = 0
  86. float row6_value = 0.0
  87. row6_is_peak = false
  88. float row7_price = na
  89. int row7_width = 0
  90. float row7_value = 0.0
  91. row7_is_peak = false
  92. float row8_price = na
  93. int row8_width = 0
  94. float row8_value = 0.0
  95. row8_is_peak = false
  96. float row9_price = na
  97. int row9_width = 0
  98. float row9_value = 0.0
  99. row9_is_peak = false
  100. float row10_price = na
  101. int row10_width = 0
  102. float row10_value = 0.0
  103. row10_is_peak = false
  104. float row11_price = na
  105. int row11_width = 0
  106. float row11_value = 0.0
  107. row11_is_peak = false
  108. float row12_price = na
  109. int row12_width = 0
  110. float row12_value = 0.0
  111. row12_is_peak = false
  112. float row13_price = na
  113. int row13_width = 0
  114. float row13_value = 0.0
  115. row13_is_peak = false
  116. float row14_price = na
  117. int row14_width = 0
  118. float row14_value = 0.0
  119. row14_is_peak = false
  120. float row15_price = na
  121. int row15_width = 0
  122. float row15_value = 0.0
  123. row15_is_peak = false
  124. float row16_price = na
  125. int row16_width = 0
  126. float row16_value = 0.0
  127. row16_is_peak = false
  128. float row17_price = na
  129. int row17_width = 0
  130. float row17_value = 0.0
  131. row17_is_peak = false
  132. float row18_price = na
  133. int row18_width = 0
  134. float row18_value = 0.0
  135. row18_is_peak = false
  136. float row19_price = na
  137. int row19_width = 0
  138. float row19_value = 0.0
  139. row19_is_peak = false
  140. float row20_price = na
  141. int row20_width = 0
  142. float row20_value = 0.0
  143. row20_is_peak = false
  144. float row21_price = na
  145. int row21_width = 0
  146. float row21_value = 0.0
  147. row21_is_peak = false
  148. float row22_price = na
  149. int row22_width = 0
  150. float row22_value = 0.0
  151. row22_is_peak = false
  152. float row23_price = na
  153. int row23_width = 0
  154. float row23_value = 0.0
  155. row23_is_peak = false
  156. float row24_price = na
  157. int row24_width = 0
  158. float row24_value = 0.0
  159. row24_is_peak = false
  160. float row25_price = na
  161. int row25_width = 0
  162. float row25_value = 0.0
  163. row25_is_peak = false
  164. float row26_price = na
  165. int row26_width = 0
  166. float row26_value = 0.0
  167. row26_is_peak = false
  168. float row27_price = na
  169. int row27_width = 0
  170. float row27_value = 0.0
  171. row27_is_peak = false
  172. float row28_price = na
  173. int row28_width = 0
  174. float row28_value = 0.0
  175. row28_is_peak = false
  176. float row29_price = na
  177. int row29_width = 0
  178. float row29_value = 0.0
  179. row29_is_peak = false
  180. float row30_price = na
  181. int row30_width = 0
  182. float row30_value = 0.0
  183. row30_is_peak = false
  184. float row31_price = na
  185. int row31_width = 0
  186. float row31_value = 0.0
  187. row31_is_peak = false
  188. float row32_price = na
  189. int row32_width = 0
  190. float row32_value = 0.0
  191. row32_is_peak = false
  192. float row33_price = na
  193. int row33_width = 0
  194. float row33_value = 0.0
  195. row33_is_peak = false
  196. float row34_price = na
  197. int row34_width = 0
  198. float row34_value = 0.0
  199. row34_is_peak = false
  200. float row35_price = na
  201. int row35_width = 0
  202. float row35_value = 0.0
  203. row35_is_peak = false
  204. float row36_price = na
  205. int row36_width = 0
  206. float row36_value = 0.0
  207. row36_is_peak = false
  208. float row37_price = na
  209. int row37_width = 0
  210. float row37_value = 0.0
  211. row37_is_peak = false
  212. float row38_price = na
  213. int row38_width = 0
  214. float row38_value = 0.0
  215. row38_is_peak = false
  216. float row39_price = na
  217. int row39_width = 0
  218. float row39_value = 0.0
  219. row39_is_peak = false
  220. if barstate.islast
  221. block_height = block_high - block_low
  222. row_height = block_height / slices
  223. row0_low = block_low + row_height * 0
  224. row0_high = block_low + row_height * 1
  225. row1_low = block_low + row_height * 1
  226. row1_high = block_low + row_height * 2
  227. row2_low = block_low + row_height * 2
  228. row2_high = block_low + row_height * 3
  229. row3_low = block_low + row_height * 3
  230. row3_high = block_low + row_height * 4
  231. row4_low = block_low + row_height * 4
  232. row4_high = block_low + row_height * 5
  233. row5_low = block_low + row_height * 5
  234. row5_high = block_low + row_height * 6
  235. row6_low = block_low + row_height * 6
  236. row6_high = block_low + row_height * 7
  237. row7_low = block_low + row_height * 7
  238. row7_high = block_low + row_height * 8
  239. row8_low = block_low + row_height * 8
  240. row8_high = block_low + row_height * 9
  241. row9_low = block_low + row_height * 9
  242. row9_high = block_low + row_height * 10
  243. row10_low = block_low + row_height * 10
  244. row10_high = block_low + row_height * 11
  245. row11_low = block_low + row_height * 11
  246. row11_high = block_low + row_height * 12
  247. row12_low = block_low + row_height * 12
  248. row12_high = block_low + row_height * 13
  249. row13_low = block_low + row_height * 13
  250. row13_high = block_low + row_height * 14
  251. row14_low = block_low + row_height * 14
  252. row14_high = block_low + row_height * 15
  253. row15_low = block_low + row_height * 15
  254. row15_high = block_low + row_height * 16
  255. row16_low = block_low + row_height * 16
  256. row16_high = block_low + row_height * 17
  257. row17_low = block_low + row_height * 17
  258. row17_high = block_low + row_height * 18
  259. row18_low = block_low + row_height * 18
  260. row18_high = block_low + row_height * 19
  261. row19_low = block_low + row_height * 19
  262. row19_high = block_low + row_height * 20
  263. row20_low = block_low + row_height * 20
  264. row20_high = block_low + row_height * 21
  265. row21_low = block_low + row_height * 21
  266. row21_high = block_low + row_height * 22
  267. row22_low = block_low + row_height * 22
  268. row22_high = block_low + row_height * 23
  269. row23_low = block_low + row_height * 23
  270. row23_high = block_low + row_height * 24
  271. row24_low = block_low + row_height * 24
  272. row24_high = block_low + row_height * 25
  273. row25_low = block_low + row_height * 25
  274. row25_high = block_low + row_height * 26
  275. row26_low = block_low + row_height * 26
  276. row26_high = block_low + row_height * 27
  277. row27_low = block_low + row_height * 27
  278. row27_high = block_low + row_height * 28
  279. row28_low = block_low + row_height * 28
  280. row28_high = block_low + row_height * 29
  281. row29_low = block_low + row_height * 29
  282. row29_high = block_low + row_height * 30
  283. row30_low = block_low + row_height * 30
  284. row30_high = block_low + row_height * 31
  285. row31_low = block_low + row_height * 31
  286. row31_high = block_low + row_height * 32
  287. row32_low = block_low + row_height * 32
  288. row32_high = block_low + row_height * 33
  289. row33_low = block_low + row_height * 33
  290. row33_high = block_low + row_height * 34
  291. row34_low = block_low + row_height * 34
  292. row34_high = block_low + row_height * 35
  293. row35_low = block_low + row_height * 35
  294. row35_high = block_low + row_height * 36
  295. row36_low = block_low + row_height * 36
  296. row36_high = block_low + row_height * 37
  297. row37_low = block_low + row_height * 37
  298. row37_high = block_low + row_height * 38
  299. row38_low = block_low + row_height * 38
  300. row38_high = block_low + row_height * 39
  301. row39_low = block_low + row_height * 39
  302. row39_high = block_low + row_height * 40
  303. for i = 0 to sizeBlock + 1 by 1
  304. n_rows_affected = 0
  305. bar_row0_value = 0.0
  306. if low[i] < row0_high and high[i] > row0_low
  307. bar_row0_value := nz(custom_volume[i])
  308. n_rows_affected += 1
  309. bar_row1_value = 0.0
  310. if low[i] < row1_high and high[i] > row1_low
  311. bar_row1_value := nz(custom_volume[i])
  312. n_rows_affected += 1
  313. bar_row2_value = 0.0
  314. if low[i] < row2_high and high[i] > row2_low
  315. bar_row2_value := nz(custom_volume[i])
  316. n_rows_affected += 1
  317. bar_row3_value = 0.0
  318. if low[i] < row3_high and high[i] > row3_low
  319. bar_row3_value := nz(custom_volume[i])
  320. n_rows_affected += 1
  321. bar_row4_value = 0.0
  322. if low[i] < row4_high and high[i] > row4_low
  323. bar_row4_value := nz(custom_volume[i])
  324. n_rows_affected += 1
  325. bar_row5_value = 0.0
  326. if low[i] < row5_high and high[i] > row5_low
  327. bar_row5_value := nz(custom_volume[i])
  328. n_rows_affected += 1
  329. bar_row6_value = 0.0
  330. if low[i] < row6_high and high[i] > row6_low
  331. bar_row6_value := nz(custom_volume[i])
  332. n_rows_affected += 1
  333. bar_row7_value = 0.0
  334. if low[i] < row7_high and high[i] > row7_low
  335. bar_row7_value := nz(custom_volume[i])
  336. n_rows_affected += 1
  337. bar_row8_value = 0.0
  338. if low[i] < row8_high and high[i] > row8_low
  339. bar_row8_value := nz(custom_volume[i])
  340. n_rows_affected += 1
  341. bar_row9_value = 0.0
  342. if low[i] < row9_high and high[i] > row9_low
  343. bar_row9_value := nz(custom_volume[i])
  344. n_rows_affected += 1
  345. bar_row10_value = 0.0
  346. if low[i] < row10_high and high[i] > row10_low
  347. bar_row10_value := nz(custom_volume[i])
  348. n_rows_affected += 1
  349. bar_row11_value = 0.0
  350. if low[i] < row11_high and high[i] > row11_low
  351. bar_row11_value := nz(custom_volume[i])
  352. n_rows_affected += 1
  353. bar_row12_value = 0.0
  354. if low[i] < row12_high and high[i] > row12_low
  355. bar_row12_value := nz(custom_volume[i])
  356. n_rows_affected += 1
  357. bar_row13_value = 0.0
  358. if low[i] < row13_high and high[i] > row13_low
  359. bar_row13_value := nz(custom_volume[i])
  360. n_rows_affected += 1
  361. bar_row14_value = 0.0
  362. if low[i] < row14_high and high[i] > row14_low
  363. bar_row14_value := nz(custom_volume[i])
  364. n_rows_affected += 1
  365. bar_row15_value = 0.0
  366. if low[i] < row15_high and high[i] > row15_low
  367. bar_row15_value := nz(custom_volume[i])
  368. n_rows_affected += 1
  369. bar_row16_value = 0.0
  370. if low[i] < row16_high and high[i] > row16_low
  371. bar_row16_value := nz(custom_volume[i])
  372. n_rows_affected += 1
  373. bar_row17_value = 0.0
  374. if low[i] < row17_high and high[i] > row17_low
  375. bar_row17_value := nz(custom_volume[i])
  376. n_rows_affected += 1
  377. bar_row18_value = 0.0
  378. if low[i] < row18_high and high[i] > row18_low
  379. bar_row18_value := nz(custom_volume[i])
  380. n_rows_affected += 1
  381. bar_row19_value = 0.0
  382. if low[i] < row19_high and high[i] > row19_low
  383. bar_row19_value := nz(custom_volume[i])
  384. n_rows_affected += 1
  385. bar_row20_value = 0.0
  386. if low[i] < row20_high and high[i] > row20_low
  387. bar_row20_value := nz(custom_volume[i])
  388. n_rows_affected += 1
  389. bar_row21_value = 0.0
  390. if low[i] < row21_high and high[i] > row21_low
  391. bar_row21_value := nz(custom_volume[i])
  392. n_rows_affected += 1
  393. bar_row22_value = 0.0
  394. if low[i] < row22_high and high[i] > row22_low
  395. bar_row22_value := nz(custom_volume[i])
  396. n_rows_affected += 1
  397. bar_row23_value = 0.0
  398. if low[i] < row23_high and high[i] > row23_low
  399. bar_row23_value := nz(custom_volume[i])
  400. n_rows_affected += 1
  401. bar_row24_value = 0.0
  402. if low[i] < row24_high and high[i] > row24_low
  403. bar_row24_value := nz(custom_volume[i])
  404. n_rows_affected += 1
  405. bar_row25_value = 0.0
  406. if low[i] < row25_high and high[i] > row25_low
  407. bar_row25_value := nz(custom_volume[i])
  408. n_rows_affected += 1
  409. bar_row26_value = 0.0
  410. if low[i] < row26_high and high[i] > row26_low
  411. bar_row26_value := nz(custom_volume[i])
  412. n_rows_affected += 1
  413. bar_row27_value = 0.0
  414. if low[i] < row27_high and high[i] > row27_low
  415. bar_row27_value := nz(custom_volume[i])
  416. n_rows_affected += 1
  417. bar_row28_value = 0.0
  418. if low[i] < row28_high and high[i] > row28_low
  419. bar_row28_value := nz(custom_volume[i])
  420. n_rows_affected += 1
  421. bar_row29_value = 0.0
  422. if low[i] < row29_high and high[i] > row29_low
  423. bar_row29_value := nz(custom_volume[i])
  424. n_rows_affected += 1
  425. bar_row30_value = 0.0
  426. if low[i] < row30_high and high[i] > row30_low
  427. bar_row30_value := nz(custom_volume[i])
  428. n_rows_affected += 1
  429. bar_row31_value = 0.0
  430. if low[i] < row31_high and high[i] > row31_low
  431. bar_row31_value := nz(custom_volume[i])
  432. n_rows_affected += 1
  433. bar_row32_value = 0.0
  434. if low[i] < row32_high and high[i] > row32_low
  435. bar_row32_value := nz(custom_volume[i])
  436. n_rows_affected += 1
  437. bar_row33_value = 0.0
  438. if low[i] < row33_high and high[i] > row33_low
  439. bar_row33_value := nz(custom_volume[i])
  440. n_rows_affected += 1
  441. bar_row34_value = 0.0
  442. if low[i] < row34_high and high[i] > row34_low
  443. bar_row34_value := nz(custom_volume[i])
  444. n_rows_affected += 1
  445. bar_row35_value = 0.0
  446. if low[i] < row35_high and high[i] > row35_low
  447. bar_row35_value := nz(custom_volume[i])
  448. n_rows_affected += 1
  449. bar_row36_value = 0.0
  450. if low[i] < row36_high and high[i] > row36_low
  451. bar_row36_value := nz(custom_volume[i])
  452. n_rows_affected += 1
  453. bar_row37_value = 0.0
  454. if low[i] < row37_high and high[i] > row37_low
  455. bar_row37_value := nz(custom_volume[i])
  456. n_rows_affected += 1
  457. bar_row38_value = 0.0
  458. if low[i] < row38_high and high[i] > row38_low
  459. bar_row38_value := nz(custom_volume[i])
  460. n_rows_affected += 1
  461. bar_row39_value = 0.0
  462. if low[i] < row39_high and high[i] > row39_low
  463. bar_row39_value := nz(custom_volume[i])
  464. n_rows_affected += 1
  465. row0_value += (n_rows_affected != 0 ? bar_row0_value / n_rows_affected : 0)
  466. row1_value += (n_rows_affected != 0 ? bar_row1_value / n_rows_affected : 0)
  467. row2_value += (n_rows_affected != 0 ? bar_row2_value / n_rows_affected : 0)
  468. row3_value += (n_rows_affected != 0 ? bar_row3_value / n_rows_affected : 0)
  469. row4_value += (n_rows_affected != 0 ? bar_row4_value / n_rows_affected : 0)
  470. row5_value += (n_rows_affected != 0 ? bar_row5_value / n_rows_affected : 0)
  471. row6_value += (n_rows_affected != 0 ? bar_row6_value / n_rows_affected : 0)
  472. row7_value += (n_rows_affected != 0 ? bar_row7_value / n_rows_affected : 0)
  473. row8_value += (n_rows_affected != 0 ? bar_row8_value / n_rows_affected : 0)
  474. row9_value += (n_rows_affected != 0 ? bar_row9_value / n_rows_affected : 0)
  475. row10_value += (n_rows_affected != 0 ? bar_row10_value / n_rows_affected : 0)
  476. row11_value += (n_rows_affected != 0 ? bar_row11_value / n_rows_affected : 0)
  477. row12_value += (n_rows_affected != 0 ? bar_row12_value / n_rows_affected : 0)
  478. row13_value += (n_rows_affected != 0 ? bar_row13_value / n_rows_affected : 0)
  479. row14_value += (n_rows_affected != 0 ? bar_row14_value / n_rows_affected : 0)
  480. row15_value += (n_rows_affected != 0 ? bar_row15_value / n_rows_affected : 0)
  481. row16_value += (n_rows_affected != 0 ? bar_row16_value / n_rows_affected : 0)
  482. row17_value += (n_rows_affected != 0 ? bar_row17_value / n_rows_affected : 0)
  483. row18_value += (n_rows_affected != 0 ? bar_row18_value / n_rows_affected : 0)
  484. row19_value += (n_rows_affected != 0 ? bar_row19_value / n_rows_affected : 0)
  485. row20_value += (n_rows_affected != 0 ? bar_row20_value / n_rows_affected : 0)
  486. row21_value += (n_rows_affected != 0 ? bar_row21_value / n_rows_affected : 0)
  487. row22_value += (n_rows_affected != 0 ? bar_row22_value / n_rows_affected : 0)
  488. row23_value += (n_rows_affected != 0 ? bar_row23_value / n_rows_affected : 0)
  489. row24_value += (n_rows_affected != 0 ? bar_row24_value / n_rows_affected : 0)
  490. row25_value += (n_rows_affected != 0 ? bar_row25_value / n_rows_affected : 0)
  491. row26_value += (n_rows_affected != 0 ? bar_row26_value / n_rows_affected : 0)
  492. row27_value += (n_rows_affected != 0 ? bar_row27_value / n_rows_affected : 0)
  493. row28_value += (n_rows_affected != 0 ? bar_row28_value / n_rows_affected : 0)
  494. row29_value += (n_rows_affected != 0 ? bar_row29_value / n_rows_affected : 0)
  495. row30_value += (n_rows_affected != 0 ? bar_row30_value / n_rows_affected : 0)
  496. row31_value += (n_rows_affected != 0 ? bar_row31_value / n_rows_affected : 0)
  497. row32_value += (n_rows_affected != 0 ? bar_row32_value / n_rows_affected : 0)
  498. row33_value += (n_rows_affected != 0 ? bar_row33_value / n_rows_affected : 0)
  499. row34_value += (n_rows_affected != 0 ? bar_row34_value / n_rows_affected : 0)
  500. row35_value += (n_rows_affected != 0 ? bar_row35_value / n_rows_affected : 0)
  501. row36_value += (n_rows_affected != 0 ? bar_row36_value / n_rows_affected : 0)
  502. row37_value += (n_rows_affected != 0 ? bar_row37_value / n_rows_affected : 0)
  503. row38_value += (n_rows_affected != 0 ? bar_row38_value / n_rows_affected : 0)
  504. row39_value += (n_rows_affected != 0 ? bar_row39_value / n_rows_affected : 0)
  505. highest_row_value := math.max(highest_row_value, row0_value, row1_value, row2_value, row3_value, row4_value, row5_value, row6_value, row7_value, row8_value, row9_value, row10_value, row11_value, row12_value, row13_value, row14_value, row15_value, row16_value, row17_value, row18_value, row19_value, row20_value, row21_value, row22_value, row23_value, row24_value, row25_value, row26_value, row27_value, row28_value, row29_value, row30_value, row31_value, row32_value, row33_value, row34_value, row35_value, row36_value, row37_value, row38_value, row39_value)
  506. row0_price := (row0_low + row0_high) / 2
  507. row0_width := math.floor(rowWidth * row0_value / highest_row_value)
  508. row1_price := (row1_low + row1_high) / 2
  509. row1_width := math.floor(rowWidth * row1_value / highest_row_value)
  510. row2_price := (row2_low + row2_high) / 2
  511. row2_width := math.floor(rowWidth * row2_value / highest_row_value)
  512. row3_price := (row3_low + row3_high) / 2
  513. row3_width := math.floor(rowWidth * row3_value / highest_row_value)
  514. row4_price := (row4_low + row4_high) / 2
  515. row4_width := math.floor(rowWidth * row4_value / highest_row_value)
  516. row5_price := (row5_low + row5_high) / 2
  517. row5_width := math.floor(rowWidth * row5_value / highest_row_value)
  518. row6_price := (row6_low + row6_high) / 2
  519. row6_width := math.floor(rowWidth * row6_value / highest_row_value)
  520. row7_price := (row7_low + row7_high) / 2
  521. row7_width := math.floor(rowWidth * row7_value / highest_row_value)
  522. row8_price := (row8_low + row8_high) / 2
  523. row8_width := math.floor(rowWidth * row8_value / highest_row_value)
  524. row9_price := (row9_low + row9_high) / 2
  525. row9_width := math.floor(rowWidth * row9_value / highest_row_value)
  526. row10_price := (row10_low + row10_high) / 2
  527. row10_width := math.floor(rowWidth * row10_value / highest_row_value)
  528. row11_price := (row11_low + row11_high) / 2
  529. row11_width := math.floor(rowWidth * row11_value / highest_row_value)
  530. row12_price := (row12_low + row12_high) / 2
  531. row12_width := math.floor(rowWidth * row12_value / highest_row_value)
  532. row13_price := (row13_low + row13_high) / 2
  533. row13_width := math.floor(rowWidth * row13_value / highest_row_value)
  534. row14_price := (row14_low + row14_high) / 2
  535. row14_width := math.floor(rowWidth * row14_value / highest_row_value)
  536. row15_price := (row15_low + row15_high) / 2
  537. row15_width := math.floor(rowWidth * row15_value / highest_row_value)
  538. row16_price := (row16_low + row16_high) / 2
  539. row16_width := math.floor(rowWidth * row16_value / highest_row_value)
  540. row17_price := (row17_low + row17_high) / 2
  541. row17_width := math.floor(rowWidth * row17_value / highest_row_value)
  542. row18_price := (row18_low + row18_high) / 2
  543. row18_width := math.floor(rowWidth * row18_value / highest_row_value)
  544. row19_price := (row19_low + row19_high) / 2
  545. row19_width := math.floor(rowWidth * row19_value / highest_row_value)
  546. row20_price := (row20_low + row20_high) / 2
  547. row20_width := math.floor(rowWidth * row20_value / highest_row_value)
  548. row21_price := (row21_low + row21_high) / 2
  549. row21_width := math.floor(rowWidth * row21_value / highest_row_value)
  550. row22_price := (row22_low + row22_high) / 2
  551. row22_width := math.floor(rowWidth * row22_value / highest_row_value)
  552. row23_price := (row23_low + row23_high) / 2
  553. row23_width := math.floor(rowWidth * row23_value / highest_row_value)
  554. row24_price := (row24_low + row24_high) / 2
  555. row24_width := math.floor(rowWidth * row24_value / highest_row_value)
  556. row25_price := (row25_low + row25_high) / 2
  557. row25_width := math.floor(rowWidth * row25_value / highest_row_value)
  558. row26_price := (row26_low + row26_high) / 2
  559. row26_width := math.floor(rowWidth * row26_value / highest_row_value)
  560. row27_price := (row27_low + row27_high) / 2
  561. row27_width := math.floor(rowWidth * row27_value / highest_row_value)
  562. row28_price := (row28_low + row28_high) / 2
  563. row28_width := math.floor(rowWidth * row28_value / highest_row_value)
  564. row29_price := (row29_low + row29_high) / 2
  565. row29_width := math.floor(rowWidth * row29_value / highest_row_value)
  566. row30_price := (row30_low + row30_high) / 2
  567. row30_width := math.floor(rowWidth * row30_value / highest_row_value)
  568. row31_price := (row31_low + row31_high) / 2
  569. row31_width := math.floor(rowWidth * row31_value / highest_row_value)
  570. row32_price := (row32_low + row32_high) / 2
  571. row32_width := math.floor(rowWidth * row32_value / highest_row_value)
  572. row33_price := (row33_low + row33_high) / 2
  573. row33_width := math.floor(rowWidth * row33_value / highest_row_value)
  574. row34_price := (row34_low + row34_high) / 2
  575. row34_width := math.floor(rowWidth * row34_value / highest_row_value)
  576. row35_price := (row35_low + row35_high) / 2
  577. row35_width := math.floor(rowWidth * row35_value / highest_row_value)
  578. row36_price := (row36_low + row36_high) / 2
  579. row36_width := math.floor(rowWidth * row36_value / highest_row_value)
  580. row37_price := (row37_low + row37_high) / 2
  581. row37_width := math.floor(rowWidth * row37_value / highest_row_value)
  582. row38_price := (row38_low + row38_high) / 2
  583. row38_width := math.floor(rowWidth * row38_value / highest_row_value)
  584. row39_price := (row39_low + row39_high) / 2
  585. row39_width := math.floor(rowWidth * row39_value / highest_row_value)
  586. if row0_value >= row1_value and row0_value >= row2_value and row0_value >= row3_value and row0_value >= row4_value and row0_value >= row5_value
  587. row0_is_peak := true
  588. row0_is_peak
  589. if row1_value >= row0_value and row1_value >= row2_value and row1_value >= row3_value and row1_value >= row4_value and row1_value >= row5_value and row1_value >= row6_value
  590. row1_is_peak := true
  591. row1_is_peak
  592. if row2_value >= row0_value and row2_value >= row1_value and row2_value >= row3_value and row2_value >= row4_value and row2_value >= row5_value and row2_value >= row6_value and row2_value >= row7_value
  593. row2_is_peak := true
  594. row2_is_peak
  595. if row3_value >= row0_value and row3_value >= row1_value and row3_value >= row2_value and row3_value >= row4_value and row3_value >= row5_value and row3_value >= row6_value and row3_value >= row7_value and row3_value >= row8_value
  596. row3_is_peak := true
  597. row3_is_peak
  598. if row4_value >= row0_value and row4_value >= row1_value and row4_value >= row2_value and row4_value >= row3_value and row4_value >= row5_value and row4_value >= row6_value and row4_value >= row7_value and row4_value >= row8_value and row4_value >= row9_value
  599. row4_is_peak := true
  600. row4_is_peak
  601. if row5_value >= row0_value and row5_value >= row1_value and row5_value >= row2_value and row5_value >= row3_value and row5_value >= row4_value and row5_value >= row6_value and row5_value >= row7_value and row5_value >= row8_value and row5_value >= row9_value and row5_value >= row10_value
  602. row5_is_peak := true
  603. row5_is_peak
  604. if row6_value >= row1_value and row6_value >= row2_value and row6_value >= row3_value and row6_value >= row4_value and row6_value >= row5_value and row6_value >= row7_value and row6_value >= row8_value and row6_value >= row9_value and row6_value >= row10_value and row6_value >= row11_value
  605. row6_is_peak := true
  606. row6_is_peak
  607. if row7_value >= row2_value and row7_value >= row3_value and row7_value >= row4_value and row7_value >= row5_value and row7_value >= row6_value and row7_value >= row8_value and row7_value >= row9_value and row7_value >= row10_value and row7_value >= row11_value and row7_value >= row12_value
  608. row7_is_peak := true
  609. row7_is_peak
  610. if row8_value >= row3_value and row8_value >= row4_value and row8_value >= row5_value and row8_value >= row6_value and row8_value >= row7_value and row8_value >= row9_value and row8_value >= row10_value and row8_value >= row11_value and row8_value >= row12_value and row8_value >= row13_value
  611. row8_is_peak := true
  612. row8_is_peak
  613. if row9_value >= row4_value and row9_value >= row5_value and row9_value >= row6_value and row9_value >= row7_value and row9_value >= row8_value and row9_value >= row10_value and row9_value >= row11_value and row9_value >= row12_value and row9_value >= row13_value and row9_value >= row14_value
  614. row9_is_peak := true
  615. row9_is_peak
  616. if row10_value >= row5_value and row10_value >= row6_value and row10_value >= row7_value and row10_value >= row8_value and row10_value >= row9_value and row10_value >= row11_value and row10_value >= row12_value and row10_value >= row13_value and row10_value >= row14_value and row10_value >= row15_value
  617. row10_is_peak := true
  618. row10_is_peak
  619. if row11_value >= row6_value and row11_value >= row7_value and row11_value >= row8_value and row11_value >= row9_value and row11_value >= row10_value and row11_value >= row12_value and row11_value >= row13_value and row11_value >= row14_value and row11_value >= row15_value and row11_value >= row16_value
  620. row11_is_peak := true
  621. row11_is_peak
  622. if row12_value >= row7_value and row12_value >= row8_value and row12_value >= row9_value and row12_value >= row10_value and row12_value >= row11_value and row12_value >= row13_value and row12_value >= row14_value and row12_value >= row15_value and row12_value >= row16_value and row12_value >= row17_value
  623. row12_is_peak := true
  624. row12_is_peak
  625. if row13_value >= row8_value and row13_value >= row9_value and row13_value >= row10_value and row13_value >= row11_value and row13_value >= row12_value and row13_value >= row14_value and row13_value >= row15_value and row13_value >= row16_value and row13_value >= row17_value and row13_value >= row18_value
  626. row13_is_peak := true
  627. row13_is_peak
  628. if row14_value >= row9_value and row14_value >= row10_value and row14_value >= row11_value and row14_value >= row12_value and row14_value >= row13_value and row14_value >= row15_value and row14_value >= row16_value and row14_value >= row17_value and row14_value >= row18_value and row14_value >= row19_value
  629. row14_is_peak := true
  630. row14_is_peak
  631. if row15_value >= row10_value and row15_value >= row11_value and row15_value >= row12_value and row15_value >= row13_value and row15_value >= row14_value and row15_value >= row16_value and row15_value >= row17_value and row15_value >= row18_value and row15_value >= row19_value and row15_value >= row20_value
  632. row15_is_peak := true
  633. row15_is_peak
  634. if row16_value >= row11_value and row16_value >= row12_value and row16_value >= row13_value and row16_value >= row14_value and row16_value >= row15_value and row16_value >= row17_value and row16_value >= row18_value and row16_value >= row19_value and row16_value >= row20_value and row16_value >= row21_value
  635. row16_is_peak := true
  636. row16_is_peak
  637. if row17_value >= row12_value and row17_value >= row13_value and row17_value >= row14_value and row17_value >= row15_value and row17_value >= row16_value and row17_value >= row18_value and row17_value >= row19_value and row17_value >= row20_value and row17_value >= row21_value and row17_value >= row22_value
  638. row17_is_peak := true
  639. row17_is_peak
  640. if row18_value >= row13_value and row18_value >= row14_value and row18_value >= row15_value and row18_value >= row16_value and row18_value >= row17_value and row18_value >= row19_value and row18_value >= row20_value and row18_value >= row21_value and row18_value >= row22_value and row18_value >= row23_value
  641. row18_is_peak := true
  642. row18_is_peak
  643. if row19_value >= row14_value and row19_value >= row15_value and row19_value >= row16_value and row19_value >= row17_value and row19_value >= row18_value and row19_value >= row20_value and row19_value >= row21_value and row19_value >= row22_value and row19_value >= row23_value and row19_value >= row24_value
  644. row19_is_peak := true
  645. row19_is_peak
  646. if row20_value >= row15_value and row20_value >= row16_value and row20_value >= row17_value and row20_value >= row18_value and row20_value >= row19_value and row20_value >= row21_value and row20_value >= row22_value and row20_value >= row23_value and row20_value >= row24_value and row20_value >= row25_value
  647. row20_is_peak := true
  648. row20_is_peak
  649. if row21_value >= row16_value and row21_value >= row17_value and row21_value >= row18_value and row21_value >= row19_value and row21_value >= row20_value and row21_value >= row22_value and row21_value >= row23_value and row21_value >= row24_value and row21_value >= row25_value and row21_value >= row26_value
  650. row21_is_peak := true
  651. row21_is_peak
  652. if row22_value >= row17_value and row22_value >= row18_value and row22_value >= row19_value and row22_value >= row20_value and row22_value >= row21_value and row22_value >= row23_value and row22_value >= row24_value and row22_value >= row25_value and row22_value >= row26_value and row22_value >= row27_value
  653. row22_is_peak := true
  654. row22_is_peak
  655. if row23_value >= row18_value and row23_value >= row19_value and row23_value >= row20_value and row23_value >= row21_value and row23_value >= row22_value and row23_value >= row24_value and row23_value >= row25_value and row23_value >= row26_value and row23_value >= row27_value and row23_value >= row28_value
  656. row23_is_peak := true
  657. row23_is_peak
  658. if row24_value >= row19_value and row24_value >= row20_value and row24_value >= row21_value and row24_value >= row22_value and row24_value >= row23_value and row24_value >= row25_value and row24_value >= row26_value and row24_value >= row27_value and row24_value >= row28_value and row24_value >= row29_value
  659. row24_is_peak := true
  660. row24_is_peak
  661. if row25_value >= row20_value and row25_value >= row21_value and row25_value >= row22_value and row25_value >= row23_value and row25_value >= row24_value and row25_value >= row26_value and row25_value >= row27_value and row25_value >= row28_value and row25_value >= row29_value and row25_value >= row30_value
  662. row25_is_peak := true
  663. row25_is_peak
  664. if row26_value >= row21_value and row26_value >= row22_value and row26_value >= row23_value and row26_value >= row24_value and row26_value >= row25_value and row26_value >= row27_value and row26_value >= row28_value and row26_value >= row29_value and row26_value >= row30_value and row26_value >= row31_value
  665. row26_is_peak := true
  666. row26_is_peak
  667. if row27_value >= row22_value and row27_value >= row23_value and row27_value >= row24_value and row27_value >= row25_value and row27_value >= row26_value and row27_value >= row28_value and row27_value >= row29_value and row27_value >= row30_value and row27_value >= row31_value and row27_value >= row32_value
  668. row27_is_peak := true
  669. row27_is_peak
  670. if row28_value >= row23_value and row28_value >= row24_value and row28_value >= row25_value and row28_value >= row26_value and row28_value >= row27_value and row28_value >= row29_value and row28_value >= row30_value and row28_value >= row31_value and row28_value >= row32_value and row28_value >= row33_value
  671. row28_is_peak := true
  672. row28_is_peak
  673. if row29_value >= row24_value and row29_value >= row25_value and row29_value >= row26_value and row29_value >= row27_value and row29_value >= row28_value and row29_value >= row30_value and row29_value >= row31_value and row29_value >= row32_value and row29_value >= row33_value and row29_value >= row34_value
  674. row29_is_peak := true
  675. row29_is_peak
  676. if row30_value >= row25_value and row30_value >= row26_value and row30_value >= row27_value and row30_value >= row28_value and row30_value >= row29_value and row30_value >= row31_value and row30_value >= row32_value and row30_value >= row33_value and row30_value >= row34_value and row30_value >= row35_value
  677. row30_is_peak := true
  678. row30_is_peak
  679. if row31_value >= row26_value and row31_value >= row27_value and row31_value >= row28_value and row31_value >= row29_value and row31_value >= row30_value and row31_value >= row32_value and row31_value >= row33_value and row31_value >= row34_value and row31_value >= row35_value and row31_value >= row36_value
  680. row31_is_peak := true
  681. row31_is_peak
  682. if row32_value >= row27_value and row32_value >= row28_value and row32_value >= row29_value and row32_value >= row30_value and row32_value >= row31_value and row32_value >= row33_value and row32_value >= row34_value and row32_value >= row35_value and row32_value >= row36_value and row32_value >= row37_value
  683. row32_is_peak := true
  684. row32_is_peak
  685. if row33_value >= row28_value and row33_value >= row29_value and row33_value >= row30_value and row33_value >= row31_value and row33_value >= row32_value and row33_value >= row34_value and row33_value >= row35_value and row33_value >= row36_value and row33_value >= row37_value and row33_value >= row38_value
  686. row33_is_peak := true
  687. row33_is_peak
  688. if row34_value >= row29_value and row34_value >= row30_value and row34_value >= row31_value and row34_value >= row32_value and row34_value >= row33_value and row34_value >= row35_value and row34_value >= row36_value and row34_value >= row37_value and row34_value >= row38_value and row34_value >= row39_value
  689. row34_is_peak := true
  690. row34_is_peak
  691. if row35_value >= row30_value and row35_value >= row31_value and row35_value >= row32_value and row35_value >= row33_value and row35_value >= row34_value and row35_value >= row36_value and row35_value >= row37_value and row35_value >= row38_value and row35_value >= row39_value
  692. row35_is_peak := true
  693. row35_is_peak
  694. if row36_value >= row31_value and row36_value >= row32_value and row36_value >= row33_value and row36_value >= row34_value and row36_value >= row35_value and row36_value >= row37_value and row36_value >= row38_value and row36_value >= row39_value
  695. row36_is_peak := true
  696. row36_is_peak
  697. if row37_value >= row32_value and row37_value >= row33_value and row37_value >= row34_value and row37_value >= row35_value and row37_value >= row36_value and row37_value >= row38_value and row37_value >= row39_value
  698. row37_is_peak := true
  699. row37_is_peak
  700. if row38_value >= row33_value and row38_value >= row34_value and row38_value >= row35_value and row38_value >= row36_value and row38_value >= row37_value and row38_value >= row39_value
  701. row38_is_peak := true
  702. row38_is_peak
  703. if row39_value >= row34_value and row39_value >= row35_value and row39_value >= row36_value and row39_value >= row37_value and row39_value >= row38_value
  704. row39_is_peak := true
  705. row39_is_peak
  706. // Signals
  707. trendBull = maFast > maSlow and ta.rising (maFast, 2) and ta.rising (maSlow, 2)
  708. trendBear = maFast < maSlow and ta.falling(maFast, 2) and ta.falling(maSlow, 2)
  709. // Colors
  710. none = color.new(#FFFFFF, 100)
  711. // Plots
  712. plot(maFast, "MA Fast", col3, 2)
  713. plot(maSlow, "MA Slow", col4, 2)
  714. plot(maMorB, "Make or Break", col5, 4)
  715. bgcolor(trendBull ? col1 : (trendBear ? col2 : na))
  716. var int first_bar_time = time
  717. if barstate.isfirst
  718. first_bar_time := time
  719. var line block_high_line = line.new(bar_index, high, bar_index, high, color=colBounds)
  720. var line block_low_line = line.new(bar_index, low, bar_index, low, color=colBounds)
  721. var label row0_label = slices > 0 ? label.new(time_close, close, "", xloc.bar_time, yloc.price, colProfile, label.style_label_left, none, size.auto) : na
  722. var label row1_label = slices > 1 ? label.new(time_close, close, "", xloc.bar_time, yloc.price, colProfile, label.style_label_left, none, size.auto) : na
  723. var label row2_label = slices > 2 ? label.new(time_close, close, "", xloc.bar_time, yloc.price, colProfile, label.style_label_left, none, size.auto) : na
  724. var label row3_label = slices > 3 ? label.new(time_close, close, "", xloc.bar_time, yloc.price, colProfile, label.style_label_left, none, size.auto) : na
  725. var label row4_label = slices > 4 ? label.new(time_close, close, "", xloc.bar_time, yloc.price, colProfile, label.style_label_left, none, size.auto) : na
  726. var label row5_label = slices > 5 ? label.new(time_close, close, "", xloc.bar_time, yloc.price, colProfile, label.style_label_left, none, size.auto) : na
  727. var label row6_label = slices > 6 ? label.new(time_close, close, "", xloc.bar_time, yloc.price, colProfile, label.style_label_left, none, size.auto) : na
  728. var label row7_label = slices > 7 ? label.new(time_close, close, "", xloc.bar_time, yloc.price, colProfile, label.style_label_left, none, size.auto) : na
  729. var label row8_label = slices > 8 ? label.new(time_close, close, "", xloc.bar_time, yloc.price, colProfile, label.style_label_left, none, size.auto) : na
  730. var label row9_label = slices > 9 ? label.new(time_close, close, "", xloc.bar_time, yloc.price, colProfile, label.style_label_left, none, size.auto) : na
  731. var label row10_label = slices > 10 ? label.new(time_close, close, "", xloc.bar_time, yloc.price, colProfile, label.style_label_left, none, size.auto) : na
  732. var label row11_label = slices > 11 ? label.new(time_close, close, "", xloc.bar_time, yloc.price, colProfile, label.style_label_left, none, size.auto) : na
  733. var label row12_label = slices > 12 ? label.new(time_close, close, "", xloc.bar_time, yloc.price, colProfile, label.style_label_left, none, size.auto) : na
  734. var label row13_label = slices > 13 ? label.new(time_close, close, "", xloc.bar_time, yloc.price, colProfile, label.style_label_left, none, size.auto) : na
  735. var label row14_label = slices > 14 ? label.new(time_close, close, "", xloc.bar_time, yloc.price, colProfile, label.style_label_left, none, size.auto) : na
  736. var label row15_label = slices > 15 ? label.new(time_close, close, "", xloc.bar_time, yloc.price, colProfile, label.style_label_left, none, size.auto) : na
  737. var label row16_label = slices > 16 ? label.new(time_close, close, "", xloc.bar_time, yloc.price, colProfile, label.style_label_left, none, size.auto) : na
  738. var label row17_label = slices > 17 ? label.new(time_close, close, "", xloc.bar_time, yloc.price, colProfile, label.style_label_left, none, size.auto) : na
  739. var label row18_label = slices > 18 ? label.new(time_close, close, "", xloc.bar_time, yloc.price, colProfile, label.style_label_left, none, size.auto) : na
  740. var label row19_label = slices > 19 ? label.new(time_close, close, "", xloc.bar_time, yloc.price, colProfile, label.style_label_left, none, size.auto) : na
  741. var label row20_label = slices > 20 ? label.new(time_close, close, "", xloc.bar_time, yloc.price, colProfile, label.style_label_left, none, size.auto) : na
  742. var label row21_label = slices > 21 ? label.new(time_close, close, "", xloc.bar_time, yloc.price, colProfile, label.style_label_left, none, size.auto) : na
  743. var label row22_label = slices > 22 ? label.new(time_close, close, "", xloc.bar_time, yloc.price, colProfile, label.style_label_left, none, size.auto) : na
  744. var label row23_label = slices > 23 ? label.new(time_close, close, "", xloc.bar_time, yloc.price, colProfile, label.style_label_left, none, size.auto) : na
  745. var label row24_label = slices > 24 ? label.new(time_close, close, "", xloc.bar_time, yloc.price, colProfile, label.style_label_left, none, size.auto) : na
  746. var label row25_label = slices > 25 ? label.new(time_close, close, "", xloc.bar_time, yloc.price, colProfile, label.style_label_left, none, size.auto) : na
  747. var label row26_label = slices > 26 ? label.new(time_close, close, "", xloc.bar_time, yloc.price, colProfile, label.style_label_left, none, size.auto) : na
  748. var label row27_label = slices > 27 ? label.new(time_close, close, "", xloc.bar_time, yloc.price, colProfile, label.style_label_left, none, size.auto) : na
  749. var label row28_label = slices > 28 ? label.new(time_close, close, "", xloc.bar_time, yloc.price, colProfile, label.style_label_left, none, size.auto) : na
  750. var label row29_label = slices > 29 ? label.new(time_close, close, "", xloc.bar_time, yloc.price, colProfile, label.style_label_left, none, size.auto) : na
  751. var label row30_label = slices > 30 ? label.new(time_close, close, "", xloc.bar_time, yloc.price, colProfile, label.style_label_left, none, size.auto) : na
  752. var label row31_label = slices > 31 ? label.new(time_close, close, "", xloc.bar_time, yloc.price, colProfile, label.style_label_left, none, size.auto) : na
  753. var label row32_label = slices > 32 ? label.new(time_close, close, "", xloc.bar_time, yloc.price, colProfile, label.style_label_left, none, size.auto) : na
  754. var label row33_label = slices > 33 ? label.new(time_close, close, "", xloc.bar_time, yloc.price, colProfile, label.style_label_left, none, size.auto) : na
  755. var label row34_label = slices > 34 ? label.new(time_close, close, "", xloc.bar_time, yloc.price, colProfile, label.style_label_left, none, size.auto) : na
  756. var label row35_label = slices > 35 ? label.new(time_close, close, "", xloc.bar_time, yloc.price, colProfile, label.style_label_left, none, size.auto) : na
  757. var label row36_label = slices > 36 ? label.new(time_close, close, "", xloc.bar_time, yloc.price, colProfile, label.style_label_left, none, size.auto) : na
  758. var label row37_label = slices > 37 ? label.new(time_close, close, "", xloc.bar_time, yloc.price, colProfile, label.style_label_left, none, size.auto) : na
  759. var label row38_label = slices > 38 ? label.new(time_close, close, "", xloc.bar_time, yloc.price, colProfile, label.style_label_left, none, size.auto) : na
  760. var label row39_label = slices > 39 ? label.new(time_close, close, "", xloc.bar_time, yloc.price, colProfile, label.style_label_left, none, size.auto) : na
  761. if barstate.islast
  762. line.set_xloc(block_high_line, math.max(time[sizeBlock], first_bar_time), time_close, xloc.bar_time)
  763. line.set_y1(block_high_line, block_high)
  764. line.set_y2(block_high_line, block_high)
  765. line.set_xloc(block_low_line, math.max(time[sizeBlock], first_bar_time), time_close, xloc.bar_time)
  766. line.set_y1(block_low_line, block_low)
  767. line.set_y2(block_low_line, block_low)
  768. row0_text = ""
  769. for i = 0 to row0_width + 1 by 1
  770. row0_text += "#"
  771. row0_text
  772. row0_color = showPeaks and row0_is_peak ? colPeak : colProfile
  773. label.set_x(row0_label, time_close)
  774. label.set_y(row0_label, row0_price)
  775. label.set_color(row0_label, row0_color)
  776. label.set_text(row0_label, row0_text)
  777. row1_text = ""
  778. for i = 0 to row1_width + 1 by 1
  779. row1_text += "#"
  780. row1_text
  781. row1_color = showPeaks and row1_is_peak ? colPeak : colProfile
  782. label.set_x(row1_label, time_close)
  783. label.set_y(row1_label, row1_price)
  784. label.set_color(row1_label, row1_color)
  785. label.set_text(row1_label, row1_text)
  786. row2_text = ""
  787. for i = 0 to row2_width + 1 by 1
  788. row2_text += "#"
  789. row2_text
  790. row2_color = showPeaks and row2_is_peak ? colPeak : colProfile
  791. label.set_x(row2_label, time_close)
  792. label.set_y(row2_label, row2_price)
  793. label.set_color(row2_label, row2_color)
  794. label.set_text(row2_label, row2_text)
  795. row3_text = ""
  796. for i = 0 to row3_width + 1 by 1
  797. row3_text += "#"
  798. row3_text
  799. row3_color = showPeaks and row3_is_peak ? colPeak : colProfile
  800. label.set_x(row3_label, time_close)
  801. label.set_y(row3_label, row3_price)
  802. label.set_color(row3_label, row3_color)
  803. label.set_text(row3_label, row3_text)
  804. row4_text = ""
  805. for i = 0 to row4_width + 1 by 1
  806. row4_text += "#"
  807. row4_text
  808. row4_color = showPeaks and row4_is_peak ? colPeak : colProfile
  809. label.set_x(row4_label, time_close)
  810. label.set_y(row4_label, row4_price)
  811. label.set_color(row4_label, row4_color)
  812. label.set_text(row4_label, row4_text)
  813. row5_text = ""
  814. for i = 0 to row5_width + 1 by 1
  815. row5_text += "#"
  816. row5_text
  817. row5_color = showPeaks and row5_is_peak ? colPeak : colProfile
  818. label.set_x(row5_label, time_close)
  819. label.set_y(row5_label, row5_price)
  820. label.set_color(row5_label, row5_color)
  821. label.set_text(row5_label, row5_text)
  822. row6_text = ""
  823. for i = 0 to row6_width + 1 by 1
  824. row6_text += "#"
  825. row6_text
  826. row6_color = showPeaks and row6_is_peak ? colPeak : colProfile
  827. label.set_x(row6_label, time_close)
  828. label.set_y(row6_label, row6_price)
  829. label.set_color(row6_label, row6_color)
  830. label.set_text(row6_label, row6_text)
  831. row7_text = ""
  832. for i = 0 to row7_width + 1 by 1
  833. row7_text += "#"
  834. row7_text
  835. row7_color = showPeaks and row7_is_peak ? colPeak : colProfile
  836. label.set_x(row7_label, time_close)
  837. label.set_y(row7_label, row7_price)
  838. label.set_color(row7_label, row7_color)
  839. label.set_text(row7_label, row7_text)
  840. row8_text = ""
  841. for i = 0 to row8_width + 1 by 1
  842. row8_text += "#"
  843. row8_text
  844. row8_color = showPeaks and row8_is_peak ? colPeak : colProfile
  845. label.set_x(row8_label, time_close)
  846. label.set_y(row8_label, row8_price)
  847. label.set_color(row8_label, row8_color)
  848. label.set_text(row8_label, row8_text)
  849. row9_text = ""
  850. for i = 0 to row9_width + 1 by 1
  851. row9_text += "#"
  852. row9_text
  853. row9_color = showPeaks and row9_is_peak ? colPeak : colProfile
  854. label.set_x(row9_label, time_close)
  855. label.set_y(row9_label, row9_price)
  856. label.set_color(row9_label, row9_color)
  857. label.set_text(row9_label, row9_text)
  858. row10_text = ""
  859. for i = 0 to row10_width + 1 by 1
  860. row10_text += "#"
  861. row10_text
  862. row10_color = showPeaks and row10_is_peak ? colPeak : colProfile
  863. label.set_x(row10_label, time_close)
  864. label.set_y(row10_label, row10_price)
  865. label.set_color(row10_label, row10_color)
  866. label.set_text(row10_label, row10_text)
  867. row11_text = ""
  868. for i = 0 to row11_width + 1 by 1
  869. row11_text += "#"
  870. row11_text
  871. row11_color = showPeaks and row11_is_peak ? colPeak : colProfile
  872. label.set_x(row11_label, time_close)
  873. label.set_y(row11_label, row11_price)
  874. label.set_color(row11_label, row11_color)
  875. label.set_text(row11_label, row11_text)
  876. row12_text = ""
  877. for i = 0 to row12_width + 1 by 1
  878. row12_text += "#"
  879. row12_text
  880. row12_color = showPeaks and row12_is_peak ? colPeak : colProfile
  881. label.set_x(row12_label, time_close)
  882. label.set_y(row12_label, row12_price)
  883. label.set_color(row12_label, row12_color)
  884. label.set_text(row12_label, row12_text)
  885. row13_text = ""
  886. for i = 0 to row13_width + 1 by 1
  887. row13_text += "#"
  888. row13_text
  889. row13_color = showPeaks and row13_is_peak ? colPeak : colProfile
  890. label.set_x(row13_label, time_close)
  891. label.set_y(row13_label, row13_price)
  892. label.set_color(row13_label, row13_color)
  893. label.set_text(row13_label, row13_text)
  894. row14_text = ""
  895. for i = 0 to row14_width + 1 by 1
  896. row14_text += "#"
  897. row14_text
  898. row14_color = showPeaks and row14_is_peak ? colPeak : colProfile
  899. label.set_x(row14_label, time_close)
  900. label.set_y(row14_label, row14_price)
  901. label.set_color(row14_label, row14_color)
  902. label.set_text(row14_label, row14_text)
  903. row15_text = ""
  904. for i = 0 to row15_width + 1 by 1
  905. row15_text += "#"
  906. row15_text
  907. row15_color = showPeaks and row15_is_peak ? colPeak : colProfile
  908. label.set_x(row15_label, time_close)
  909. label.set_y(row15_label, row15_price)
  910. label.set_color(row15_label, row15_color)
  911. label.set_text(row15_label, row15_text)
  912. row16_text = ""
  913. for i = 0 to row16_width + 1 by 1
  914. row16_text += "#"
  915. row16_text
  916. row16_color = showPeaks and row16_is_peak ? colPeak : colProfile
  917. label.set_x(row16_label, time_close)
  918. label.set_y(row16_label, row16_price)
  919. label.set_color(row16_label, row16_color)
  920. label.set_text(row16_label, row16_text)
  921. row17_text = ""
  922. for i = 0 to row17_width + 1 by 1
  923. row17_text += "#"
  924. row17_text
  925. row17_color = showPeaks and row17_is_peak ? colPeak : colProfile
  926. label.set_x(row17_label, time_close)
  927. label.set_y(row17_label, row17_price)
  928. label.set_color(row17_label, row17_color)
  929. label.set_text(row17_label, row17_text)
  930. row18_text = ""
  931. for i = 0 to row18_width + 1 by 1
  932. row18_text += "#"
  933. row18_text
  934. row18_color = showPeaks and row18_is_peak ? colPeak : colProfile
  935. label.set_x(row18_label, time_close)
  936. label.set_y(row18_label, row18_price)
  937. label.set_color(row18_label, row18_color)
  938. label.set_text(row18_label, row18_text)
  939. row19_text = ""
  940. for i = 0 to row19_width + 1 by 1
  941. row19_text += "#"
  942. row19_text
  943. row19_color = showPeaks and row19_is_peak ? colPeak : colProfile
  944. label.set_x(row19_label, time_close)
  945. label.set_y(row19_label, row19_price)
  946. label.set_color(row19_label, row19_color)
  947. label.set_text(row19_label, row19_text)
  948. row20_text = ""
  949. for i = 0 to row20_width + 1 by 1
  950. row20_text += "#"
  951. row20_text
  952. row20_color = showPeaks and row20_is_peak ? colPeak : colProfile
  953. label.set_x(row20_label, time_close)
  954. label.set_y(row20_label, row20_price)
  955. label.set_color(row20_label, row20_color)
  956. label.set_text(row20_label, row20_text)
  957. row21_text = ""
  958. for i = 0 to row21_width + 1 by 1
  959. row21_text += "#"
  960. row21_text
  961. row21_color = showPeaks and row21_is_peak ? colPeak : colProfile
  962. label.set_x(row21_label, time_close)
  963. label.set_y(row21_label, row21_price)
  964. label.set_color(row21_label, row21_color)
  965. label.set_text(row21_label, row21_text)
  966. row22_text = ""
  967. for i = 0 to row22_width + 1 by 1
  968. row22_text += "#"
  969. row22_text
  970. row22_color = showPeaks and row22_is_peak ? colPeak : colProfile
  971. label.set_x(row22_label, time_close)
  972. label.set_y(row22_label, row22_price)
  973. label.set_color(row22_label, row22_color)
  974. label.set_text(row22_label, row22_text)
  975. row23_text = ""
  976. for i = 0 to row23_width + 1 by 1
  977. row23_text += "#"
  978. row23_text
  979. row23_color = showPeaks and row23_is_peak ? colPeak : colProfile
  980. label.set_x(row23_label, time_close)
  981. label.set_y(row23_label, row23_price)
  982. label.set_color(row23_label, row23_color)
  983. label.set_text(row23_label, row23_text)
  984. row24_text = ""
  985. for i = 0 to row24_width + 1 by 1
  986. row24_text += "#"
  987. row24_text
  988. row24_color = showPeaks and row24_is_peak ? colPeak : colProfile
  989. label.set_x(row24_label, time_close)
  990. label.set_y(row24_label, row24_price)
  991. label.set_color(row24_label, row24_color)
  992. label.set_text(row24_label, row24_text)
  993. row25_text = ""
  994. for i = 0 to row25_width + 1 by 1
  995. row25_text += "#"
  996. row25_text
  997. row25_color = showPeaks and row25_is_peak ? colPeak : colProfile
  998. label.set_x(row25_label, time_close)
  999. label.set_y(row25_label, row25_price)
  1000. label.set_color(row25_label, row25_color)
  1001. label.set_text(row25_label, row25_text)
  1002. row26_text = ""
  1003. for i = 0 to row26_width + 1 by 1
  1004. row26_text += "#"
  1005. row26_text
  1006. row26_color = showPeaks and row26_is_peak ? colPeak : colProfile
  1007. label.set_x(row26_label, time_close)
  1008. label.set_y(row26_label, row26_price)
  1009. label.set_color(row26_label, row26_color)
  1010. label.set_text(row26_label, row26_text)
  1011. row27_text = ""
  1012. for i = 0 to row27_width + 1 by 1
  1013. row27_text += "#"
  1014. row27_text
  1015. row27_color = showPeaks and row27_is_peak ? colPeak : colProfile
  1016. label.set_x(row27_label, time_close)
  1017. label.set_y(row27_label, row27_price)
  1018. label.set_color(row27_label, row27_color)
  1019. label.set_text(row27_label, row27_text)
  1020. row28_text = ""
  1021. for i = 0 to row28_width + 1 by 1
  1022. row28_text += "#"
  1023. row28_text
  1024. row28_color = showPeaks and row28_is_peak ? colPeak : colProfile
  1025. label.set_x(row28_label, time_close)
  1026. label.set_y(row28_label, row28_price)
  1027. label.set_color(row28_label, row28_color)
  1028. label.set_text(row28_label, row28_text)
  1029. row29_text = ""
  1030. for i = 0 to row29_width + 1 by 1
  1031. row29_text += "#"
  1032. row29_text
  1033. row29_color = showPeaks and row29_is_peak ? colPeak : colProfile
  1034. label.set_x(row29_label, time_close)
  1035. label.set_y(row29_label, row29_price)
  1036. label.set_color(row29_label, row29_color)
  1037. label.set_text(row29_label, row29_text)
  1038. row30_text = ""
  1039. for i = 0 to row30_width + 1 by 1
  1040. row30_text += "#"
  1041. row30_text
  1042. row30_color = showPeaks and row30_is_peak ? colPeak : colProfile
  1043. label.set_x(row30_label, time_close)
  1044. label.set_y(row30_label, row30_price)
  1045. label.set_color(row30_label, row30_color)
  1046. label.set_text(row30_label, row30_text)
  1047. row31_text = ""
  1048. for i = 0 to row31_width + 1 by 1
  1049. row31_text += "#"
  1050. row31_text
  1051. row31_color = showPeaks and row31_is_peak ? colPeak : colProfile
  1052. label.set_x(row31_label, time_close)
  1053. label.set_y(row31_label, row31_price)
  1054. label.set_color(row31_label, row31_color)
  1055. label.set_text(row31_label, row31_text)
  1056. row32_text = ""
  1057. for i = 0 to row32_width + 1 by 1
  1058. row32_text += "#"
  1059. row32_text
  1060. row32_color = showPeaks and row32_is_peak ? colPeak : colProfile
  1061. label.set_x(row32_label, time_close)
  1062. label.set_y(row32_label, row32_price)
  1063. label.set_color(row32_label, row32_color)
  1064. label.set_text(row32_label, row32_text)
  1065. row33_text = ""
  1066. for i = 0 to row33_width + 1 by 1
  1067. row33_text += "#"
  1068. row33_text
  1069. row33_color = showPeaks and row33_is_peak ? colPeak : colProfile
  1070. label.set_x(row33_label, time_close)
  1071. label.set_y(row33_label, row33_price)
  1072. label.set_color(row33_label, row33_color)
  1073. label.set_text(row33_label, row33_text)
  1074. row34_text = ""
  1075. for i = 0 to row34_width + 1 by 1
  1076. row34_text += "#"
  1077. row34_text
  1078. row34_color = showPeaks and row34_is_peak ? colPeak : colProfile
  1079. label.set_x(row34_label, time_close)
  1080. label.set_y(row34_label, row34_price)
  1081. label.set_color(row34_label, row34_color)
  1082. label.set_text(row34_label, row34_text)
  1083. row35_text = ""
  1084. for i = 0 to row35_width + 1 by 1
  1085. row35_text += "#"
  1086. row35_text
  1087. row35_color = showPeaks and row35_is_peak ? colPeak : colProfile
  1088. label.set_x(row35_label, time_close)
  1089. label.set_y(row35_label, row35_price)
  1090. label.set_color(row35_label, row35_color)
  1091. label.set_text(row35_label, row35_text)
  1092. row36_text = ""
  1093. for i = 0 to row36_width + 1 by 1
  1094. row36_text += "#"
  1095. row36_text
  1096. row36_color = showPeaks and row36_is_peak ? colPeak : colProfile
  1097. label.set_x(row36_label, time_close)
  1098. label.set_y(row36_label, row36_price)
  1099. label.set_color(row36_label, row36_color)
  1100. label.set_text(row36_label, row36_text)
  1101. row37_text = ""
  1102. for i = 0 to row37_width + 1 by 1
  1103. row37_text += "#"
  1104. row37_text
  1105. row37_color = showPeaks and row37_is_peak ? colPeak : colProfile
  1106. label.set_x(row37_label, time_close)
  1107. label.set_y(row37_label, row37_price)
  1108. label.set_color(row37_label, row37_color)
  1109. label.set_text(row37_label, row37_text)
  1110. row38_text = ""
  1111. for i = 0 to row38_width + 1 by 1
  1112. row38_text += "#"
  1113. row38_text
  1114. row38_color = showPeaks and row38_is_peak ? colPeak : colProfile
  1115. label.set_x(row38_label, time_close)
  1116. label.set_y(row38_label, row38_price)
  1117. label.set_color(row38_label, row38_color)
  1118. label.set_text(row38_label, row38_text)
  1119. row39_text = ""
  1120. for i = 0 to row39_width + 1 by 1
  1121. row39_text += "#"
  1122. row39_text
  1123. row39_color = showPeaks and row39_is_peak ? colPeak : colProfile
  1124. label.set_x(row39_label, time_close)
  1125. label.set_y(row39_label, row39_price)
  1126. label.set_color(row39_label, row39_color)
  1127. label.set_text(row39_label, row39_text)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement