Advertisement
xmd79

My FX Market Sessions

Jan 7th, 2023
81
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 21.22 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. // © boitoki
  3.  
  4. //@version=5
  5. indicator('My FX Market Sessions', overlay=true, max_boxes_count=500, max_labels_count=500, max_lines_count=500, max_bars_back=1000)
  6.  
  7. import boitoki/AwesomeColor/4 as ac
  8.  
  9. ///////////////
  10. // Groups
  11. ///////////////
  12. g0 = 'General'
  13. g1 = '♯1 Session'
  14. g2 = '♯2 Session'
  15. g3 = '♯3 Session'
  16. g4 = 'Box'
  17. g6 = 'Labels'
  18. g5 = 'Opening Range'
  19. g7 = 'Fibonacci Levels'
  20. g8 = 'Options'
  21. g10 = 'Oscillator Mode'
  22. g11 = 'Candle'
  23. g12 = '♯4 Session'
  24.  
  25. ///////////////
  26. // Defined
  27. ///////////////
  28. show = true
  29. pips = syminfo.mintick * 10
  30. max_bars = 500
  31.  
  32. option_yes = 'Yes'
  33. option_no = '× No'
  34. option_extend1 = 'Extend'
  35. option_hide = '× Hide'
  36.  
  37. fmt_price = '{0,number,#.#####}'
  38. fmt_pips = '{0,number,#.#}'
  39.  
  40. icon_separator = ' • '
  41.  
  42. c_none = color.new(color.black, 100)
  43.  
  44. is_weekends = dayofweek == 7 or dayofweek == 1
  45.  
  46. ///////////////
  47. // Functions
  48. ///////////////
  49. f_get_time_by_bar(bar_count) => timeframe.multiplier * bar_count * 60 * 1000
  50.  
  51. f_get_period (_session, _start, _lookback) =>
  52. result = math.max(_start, 1)
  53. for i = result to _lookback
  54. if na(_session[i+1]) and _session[i]
  55. result := i+1
  56. break
  57. result
  58.  
  59. f_get_label_position (_y, _side) =>
  60. switch _y
  61. 'top' => _side == 'outside' ? label.style_label_lower_left : label.style_label_upper_left
  62. 'bottom' => _side == 'outside' ? label.style_label_upper_left : label.style_label_lower_left
  63.  
  64. f_get_day (n) =>
  65. switch n
  66. 1 => 'Sun'
  67. 2 => 'Mon'
  68. 3 => 'Tue'
  69. 4 => 'Wed'
  70. 5 => 'Thu'
  71. 6 => 'Fri'
  72. 7 => 'Sat'
  73.  
  74. f_get_started (_session) => na(_session[1]) and _session
  75.  
  76. f_get_ended (_session) => na(_session) and _session[1]
  77.  
  78. ///////////////
  79. // Inputs
  80. ///////////////
  81. // Timezone
  82. i_tz = input.string('GMT+2', title='Timezone', options=['GMT-11', 'GMT-10', 'GMT-9', 'GMT-8', 'GMT-7', 'GMT-6', 'GMT-5', 'GMT-4', 'GMT-3', 'GMT-2', 'GMT-1', 'GMT', 'GMT+1', 'GMT+2', 'GMT+3', 'GMT+330', 'GMT+4', 'GMT+430', 'GMT+5', 'GMT+530', 'GMT+6', 'GMT+7', 'GMT+8', 'GMT+9', 'GMT+10', 'GMT+11', 'GMT+12'], tooltip='e.g. \'America/New_York\', \'Asia/Tokyo\', \'GMT-4\', \'GMT+9\'...', group=g0)
  83. i_show_history = input.string(option_yes, 'History', options=[option_yes, option_no], group=g0) == option_yes
  84. i_lookback = 12 * 60
  85.  
  86. // Sessions
  87. i_show_sess1 = input.bool(true, 'Session 1: ', group=g1, inline='session1_1') and show
  88. i_sess1_label = input.string('London', ' ', group=g1, inline='session1_1')
  89. i_sess1_color = input.color(#66D9EF, ' ', group=g1, inline='session1_1')
  90. i_sess1 = input.session('1000-1900', 'Time', group=g1)
  91. i_sess1_extend = input.string(option_no, option_extend1, options=[option_no, option_extend1], group=g1)
  92. i_sess1_fib = input.string(option_no, 'Fibonacci levels', group=g1, options=[option_yes, option_no]) != option_no
  93. i_sess1_op = input.string(option_no, 'Opening range', group=g1, options=[option_yes, option_no]) != option_no and show
  94.  
  95. i_show_sess2 = input.bool(true, 'Session 2: ', group=g2, inline='session2_1') and show
  96. i_sess2_label = input.string('New York', ' ', group=g2, inline='session2_1')
  97. i_sess2_color = input.color(#FD971F, ' ', group=g2, inline='session2_1')
  98. i_sess2 = input.session('1630-0000', 'Time', group=g2)
  99. i_sess2_extend = input.string(option_no, option_extend1, options=[option_no, option_extend1], group=g2)
  100. i_sess2_fib = input.string(option_no, 'Fibonacci levels', group=g2, options=[option_yes, option_no]) != option_no
  101. i_sess2_op = input.string(option_no, 'Opening range', group=g2, options=[option_yes, option_no]) != option_no and show
  102.  
  103. i_show_sess3 = input.bool(true, 'Session 3: ', group=g3, inline='session3_1') and show
  104. i_sess3_label = input.string('Tokyo', ' ', group=g3, inline='session3_1')
  105. i_sess3_color = input.color(#AE81FF, ' ', group=g3, inline='session3_1')
  106. i_sess3 = input.session('0200-1100', 'Time', group=g3)
  107. i_sess3_extend = input.string(option_no, option_extend1, options=[option_no, option_extend1], group=g3)
  108. i_sess3_fib = input.string(option_no, 'Fibonacci levels', group=g3, options=[option_yes, option_no]) != option_no
  109. i_sess3_op = input.string(option_no, 'Opening range', group=g3, options=[option_yes, option_no]) != option_no and show
  110.  
  111. i_show_sess4 = input.bool(true, 'Session 4: ', group=g12, inline='session4_1') and show
  112. i_sess4_label = input.string('Pre-London', ' ', group=g12, inline='session4_1')
  113. i_sess4_color = input.color(#FD971F, ' ', group=g12, inline='session4_1')
  114. i_sess4 = input.session('0900-1000', 'Time', group=g12)
  115. i_sess4_extend = input.string(option_no, option_extend1, options=[option_no, option_extend1], group=g12)
  116. i_sess4_fib = input.string(option_no, 'Fibonacci levels', group=g12, options=[option_yes, option_no]) != option_no
  117. i_sess4_op = input.string(option_no, 'Opening range', group=g12, options=[option_yes, option_no]) != option_no and show
  118.  
  119. // Show & Styles
  120. i_sess_border_style = input.string(line.style_dashed, 'Style', options=[line.style_solid, line.style_dotted, line.style_dashed], group=g4)
  121. i_sess_border_width = input.int(1, 'Thickness', minval=0, group=g4)
  122. i_sess_bgopacity = input.int(94, 'Transp', minval=0, maxval=100, step=1, group=g4, tooltip='Setting the 100 is no background color')
  123.  
  124. // Candle
  125. option_candle_body = 'Show (Body only)'
  126. option_candle_wick = 'Show'
  127. i_candle = input.string(option_hide, 'Display', options=[option_candle_wick, option_candle_body, option_hide], group=g11)
  128. i_show_candle = i_candle != option_hide
  129. i_show_candle_wick = i_candle == option_candle_wick
  130. i_candle_border_width = input.int(2, 'Thickness', minval=0, group=g11)
  131. option_candle_color1 = 'Session\'s'
  132. option_candle_color2 = 'Red/Green'
  133. i_candle_color = input.string(option_candle_color2, 'Candle color', options=[option_candle_color1, option_candle_color2], group=g11, inline='candle_color')
  134. i_candle_color_g = input.color(#A6E22E, '', group=g11, inline='candle_color')
  135. i_candle_color_r = input.color(#F92672, '', group=g11, inline='candle_color')
  136.  
  137. // Labels
  138. i_label_show = input.bool(true, 'Show labels', inline='label_show', group=g6) and show
  139. i_label_size = str.lower(input.string('Small', '', options=['Auto', 'Tiny', 'Small', 'Normal', 'Large', 'Huge'], inline='label_show', group=g6))
  140. i_label_position_y = str.lower(input.string('Top', '', options=['Top', 'Bottom'], inline='label_show', group=g6))
  141. i_label_position_s = str.lower(input.string('Outside', '', options=['Inside', 'Outside'], inline='label_show', group=g6))
  142. i_label_position = f_get_label_position(i_label_position_y, i_label_position_s)
  143. i_label_format_name = input.bool(true, 'Name', inline='label_format', group=g6)
  144. i_label_format_day = input.bool(false, 'Day', inline='label_format', group=g6)
  145. i_label_format_price = input.bool(false, 'Price', inline='label_format', group=g6)
  146. i_label_format_pips = input.bool(false, 'Pips', inline='label_format', group=g6)
  147.  
  148. // Fibonacci levels
  149. i_f_linestyle = input.string(line.style_solid, title="Style", options=[line.style_solid, line.style_dotted, line.style_dashed], group=g7)
  150. i_f_linewidth = input.int(1, title="Thickness", minval=1, group=g7)
  151.  
  152. // Opening range
  153. i_o_minutes = input.int(15, title='Periods (minutes)', minval=1, step=1, group=g5)
  154. i_o_minutes := math.max(i_o_minutes, timeframe.multiplier + 1)
  155. i_o_transp = input.int(88, title='Transp', minval=0, maxval=100, step=1, group=g5)
  156.  
  157. // Oscillator mode
  158. i_osc = input.bool(false, 'Oscillator', inline='osc', group=g10)
  159. i_osc_min = input.float(0, '', inline='osc', group=g10)
  160. i_osc_max = input.float(100, '-', inline='osc', group=g10)
  161.  
  162. // Alerts
  163. i_alert1_show = input.bool(false, 'Alerts - Sessions stard/end', group='Alerts visualized')
  164. i_alert2_show = input.bool(false, 'Alerts - Opening range breakouts', group='Alerts visualized')
  165. i_alert3_show = input.bool(false, 'Alerts - Price crossed session\'s High/Low after session closed', group='Alerts visualized')
  166.  
  167. // ------------------------
  168. // Drawing labels
  169. // ------------------------
  170. f_render_label (_show, _session, _is_started, _color, _top, _bottom, _text, _delete_history) =>
  171. var label my_label = na
  172. var int start_time = na
  173.  
  174. v_position_y = (i_label_position_y == 'top') ? _top : _bottom
  175. v_label = array.new_string()
  176. v_chg = _top - _bottom
  177.  
  178. if _is_started
  179. start_time := time
  180.  
  181. if i_label_format_name and not na(_text)
  182. array.push(v_label, _text)
  183.  
  184. if i_label_format_day
  185. array.push(v_label, f_get_day(dayofweek(start_time, i_tz)))
  186.  
  187. if i_label_format_price
  188. array.push(v_label, str.format(fmt_price, v_chg))
  189.  
  190. if i_label_format_pips
  191. array.push(v_label, str.format(fmt_pips, v_chg / pips) + ' pips')
  192.  
  193. if _show
  194. if _is_started
  195. my_label := label.new(time, v_position_y, array.join(v_label, icon_separator), textcolor=_color, color=c_none, size=i_label_size, style=i_label_position, xloc=xloc.bar_time)
  196.  
  197. if _delete_history
  198. label.delete(my_label[1])
  199.  
  200. if _session
  201. label.set_y(my_label, v_position_y)
  202. label.set_text(my_label, array.join(v_label, icon_separator))
  203.  
  204. // ------------------------
  205. // Drawing Fibonacci levels
  206. // ------------------------
  207. f_render_fibonacci (_show, _session, _is_started, _x1, _x2, _color, _top, _bottom, _level, _width, _style, _is_extend, _delete_history) =>
  208. var line my_line = na
  209.  
  210. if _show
  211. y = (_top - _bottom) * _level + _bottom
  212.  
  213. if _is_started
  214. my_line := line.new(_x1, y, _x2, y, width=_width, color=color.new(_color, 30), style=_style)
  215.  
  216. if _is_extend
  217. line.set_extend(my_line, extend.right)
  218.  
  219. if _delete_history
  220. line.delete(my_line[1])
  221.  
  222. if _session
  223. line.set_y1(my_line, y)
  224. line.set_y2(my_line, y)
  225.  
  226.  
  227. // ------------------------
  228. // Drawing Opening range
  229. // ------------------------
  230. f_render_oprange (_show, _session, _is_started, _x1, _x2, _color, _max, _is_extend, _delete_history) =>
  231. var int start_time = na
  232. var box my_box = na
  233. top = ta.highest(high, _max)
  234. bottom = ta.lowest(low, _max)
  235. is_crossover = ta.crossover(close, box.get_top(my_box))
  236. is_crossunder = ta.crossunder(close, box.get_bottom(my_box))
  237.  
  238. if _show
  239. if _is_started
  240. start_time := time
  241. my_box := na
  242.  
  243. if _delete_history
  244. box.delete(my_box[1])
  245.  
  246. if _session
  247. time_op = start_time + (i_o_minutes * 60 * 1000)
  248. time_op_delay = time_op - f_get_time_by_bar(1)
  249.  
  250. if time <= time_op and time > time_op_delay
  251. my_box := box.new(_x1, top, _x2, bottom, border_width=0, bgcolor=color.new(_color, i_o_transp))
  252.  
  253. if _is_extend
  254. box.set_extend(my_box, extend.right)
  255. my_box
  256.  
  257. else
  258. //box.set_right(my_box, bar_index + 1)
  259.  
  260. if is_crossover
  261. alert('Price crossed over the opening range', alert.freq_once_per_bar)
  262.  
  263. if i_alert2_show
  264. label.new(bar_index, box.get_top(my_box), "×", color=color.blue, textcolor=ac.tradingview('blue'), style=label.style_none, size=size.large)
  265.  
  266. if is_crossunder
  267. alert('Price crossed under the opening range', alert.freq_once_per_bar)
  268.  
  269. if i_alert2_show
  270. label.new(bar_index, box.get_bottom(my_box), "×", color=color.red, textcolor=ac.tradingview('red'), style=label.style_none, size=size.large)
  271.  
  272. my_box
  273.  
  274.  
  275. // ------------------------
  276. // Drawing candle
  277. // ------------------------
  278. f_render_candle (_show, _session, _is_started, _is_ended, _color, _top, _bottom, _open, _x1, _x2, _delete_history) =>
  279. var box body = na
  280. var line wick1 = na
  281. var line wick2 = na
  282. border_width = i_candle_border_width
  283. cx = math.round(math.avg(_x2, _x1)) - math.round(border_width / 2)
  284.  
  285. body_color = i_candle_color == option_candle_color2 ? close > _open ? i_candle_color_g : i_candle_color_r : _color
  286.  
  287. if _show
  288. if _is_started
  289. body := box.new(_x1, _top, _x2, _bottom, body_color, border_width, line.style_solid, bgcolor=color.new(color.black, 100))
  290. wick1 := i_show_candle_wick ? line.new(cx, _top, cx, _top, color=_color, width=border_width, style=line.style_solid) : na
  291. wick2 := i_show_candle_wick ? line.new(cx, _bottom, cx, _bottom, color=_color, width=border_width, style=line.style_solid) : na
  292.  
  293. if _delete_history
  294. box.delete(body[1])
  295. line.delete(wick1[1])
  296. line.delete(wick2[1])
  297.  
  298. else if _session
  299. top = math.max(_open, close)
  300. bottom = math.min(_open, close)
  301.  
  302. box.set_top(body, top)
  303. box.set_bottom(body, bottom)
  304. box.set_border_color(body, body_color)
  305.  
  306. line.set_y1(wick1, _top)
  307. line.set_y2(wick1, top)
  308. line.set_color(wick1, body_color)
  309. line.set_y1(wick2, _bottom)
  310. line.set_y2(wick2, bottom)
  311. line.set_color(wick2, body_color)
  312.  
  313. else if _is_ended
  314. box.set_right(body, bar_index)
  315.  
  316.  
  317. // ------------------------
  318. // Drawing market
  319. // ------------------------
  320. f_render_session (_show, _session, _is_started, _is_ended, _color, _top, _bottom, _extend, _is_extend, _delete_history) =>
  321. var box my_box = na
  322.  
  323. x0_1 = ta.valuewhen(na(_session[1]) and _session, bar_index, 1)
  324. x0_2 = ta.valuewhen(na(_session) and _session[1], bar_index, 0)
  325. var x1 = 0
  326. var x2 = 0
  327. var session_open = 0.0
  328. var session_high = 0.0
  329. var session_low = 0.0
  330.  
  331. if _show
  332. if _is_started
  333. diff = math.abs(x0_2 - x0_1)
  334. x1 := bar_index
  335. x2 := bar_index + (math.min(diff, max_bars))
  336. my_box := box.new(x1, _top, x2, _bottom, _color, i_sess_border_width, i_sess_border_style, bgcolor=color.new(_color, i_sess_bgopacity))
  337.  
  338. session_open := open
  339. session_high := _top
  340. session_low := _bottom
  341.  
  342. if _is_extend
  343. box.set_extend(my_box, extend.right)
  344.  
  345. if _delete_history
  346. box.delete(my_box[1])
  347.  
  348. else if _session
  349. box.set_top(my_box, _top)
  350. box.set_bottom(my_box, _bottom)
  351.  
  352. session_high := _top
  353. session_low := _bottom
  354.  
  355. else if _is_ended
  356. session_open := na
  357. box.set_right(my_box, bar_index)
  358.  
  359. [x1, x2, session_open, session_high, session_low]
  360.  
  361. // ------------------------
  362. // Drawing
  363. // ------------------------
  364. draw (_show, _session, _color, _label, _extend, _show_fib, _show_op, _lookback) =>
  365. max = f_get_period(_session, 1, _lookback)
  366. top = ta.highest(high, max)
  367. bottom = ta.lowest(low, max)
  368.  
  369. if i_osc
  370. top := i_osc_max
  371. bottom := i_osc_min
  372.  
  373. is_started = f_get_started(_session)
  374. is_ended = f_get_ended(_session)
  375. is_extend = _extend != option_no
  376.  
  377. delete_history = (not i_show_history) or is_extend
  378.  
  379. [x1, x2, _open, _high, _low] = f_render_session(_show, _session, is_started, is_ended, _color, top, bottom, _extend, is_extend, delete_history)
  380.  
  381. if i_show_candle
  382. f_render_candle(_show, _session, is_started, is_ended, _color, top, bottom, _open, x1, x2, delete_history)
  383.  
  384. if i_label_show
  385. f_render_label(_show, _session, is_started, _color, top, bottom, _label, delete_history)
  386.  
  387. if _show_op
  388. f_render_oprange(_show, _session, is_started, x1, x2, _color, max, is_extend, delete_history)
  389.  
  390. if _show_fib
  391. f_render_fibonacci(_show, _session, is_started, x1, x2, _color, top, bottom, 0.500, 2, line.style_solid, is_extend, delete_history)
  392. f_render_fibonacci(_show, _session, is_started, x1, x2, _color, top, bottom, 0.628, i_f_linewidth, i_f_linestyle, is_extend, delete_history)
  393. f_render_fibonacci(_show, _session, is_started, x1, x2, _color, top, bottom, 0.382, i_f_linewidth, i_f_linestyle, is_extend, delete_history)
  394.  
  395. [_session, _open, _high, _low]
  396.  
  397. ///////////////////
  398. // Calculating
  399. ///////////////////
  400. string tz = (i_tz == option_no or i_tz == '') ? na : i_tz
  401. int sess1 = time(timeframe.period, i_sess1, tz)
  402. int sess2 = time(timeframe.period, i_sess2, tz)
  403. int sess3 = time(timeframe.period, i_sess3, tz)
  404. int sess4 = time(timeframe.period, i_sess4, tz)
  405.  
  406. ///////////////////
  407. // Plotting
  408. ///////////////////
  409. [is_sess1, sess1_open, sess1_high, sess1_low] = draw(i_show_sess1, sess1, i_sess1_color, i_sess1_label, i_sess1_extend, i_sess1_fib, i_sess1_op, i_lookback)
  410. [is_sess2, sess2_open, sess2_high, sess2_low] = draw(i_show_sess2, sess2, i_sess2_color, i_sess2_label, i_sess2_extend, i_sess2_fib, i_sess2_op, i_lookback)
  411. [is_sess3, sess3_open, sess3_high, sess3_low] = draw(i_show_sess3, sess3, i_sess3_color, i_sess3_label, i_sess3_extend, i_sess3_fib, i_sess3_op, i_lookback)
  412. [is_sess4, sess4_open, sess4_high, sess4_low] = draw(i_show_sess4, sess4, i_sess4_color, i_sess4_label, i_sess4_extend, i_sess4_fib, i_sess4_op, i_lookback)
  413.  
  414.  
  415. ////////////////////
  416. // Alerts
  417. ////////////////////
  418. // Session alerts
  419. bool sess1_started = is_sess1 and not is_sess1[1]
  420. bool sess1_ended = not is_sess1 and is_sess1[1]
  421. bool sess2_started = is_sess2 and not is_sess2[1]
  422. bool sess2_ended = not is_sess2 and is_sess2[1]
  423. bool sess3_started = is_sess3 and not is_sess3[1]
  424. bool sess3_ended = not is_sess3 and is_sess3[1]
  425.  
  426. alertcondition(sess1_started, 'Session #1 started')
  427. alertcondition(sess1_ended, 'Session #1 ended')
  428. alertcondition(sess2_started, 'Session #2 started')
  429. alertcondition(sess2_ended, 'Session #2 ended')
  430. alertcondition(sess3_started, 'Session #3 started')
  431. alertcondition(sess3_ended, 'Session #3 ended')
  432.  
  433. alertcondition((not is_sess1) and ta.crossover(close, sess1_high), 'Session #1 High crossed (after session closed)')
  434. alertcondition((not is_sess1) and ta.crossunder(close, sess1_low), 'Session #1 Low crossed (after session closed)')
  435. alertcondition((not is_sess2) and ta.crossover(close, sess2_high), 'Session #2 High crossed (after session closed)')
  436. alertcondition((not is_sess2) and ta.crossunder(close, sess2_low), 'Session #2 Low crossed (after session closed)')
  437. alertcondition((not is_sess3) and ta.crossover(close, sess3_high), 'Session #3 High crossed (after session closed)')
  438. alertcondition((not is_sess3) and ta.crossunder(close, sess3_low), 'Session #3 Low crossed (after session closed)')
  439.  
  440. plotshape(i_alert1_show and sess1_started, color=i_sess1_color, text='Start', style=shape.labeldown, location=location.bottom, size=size.small, textcolor=color.new(color.white, 0))
  441. plotshape(i_alert1_show and sess1_ended, color=i_sess1_color, text='End', style=shape.labeldown, location=location.bottom, size=size.small, textcolor=color.new(color.white, 0))
  442. plotshape(i_alert1_show and sess2_started, color=i_sess2_color, text='Start', style=shape.labeldown, location=location.bottom, size=size.small, textcolor=color.new(color.white, 0))
  443. plotshape(i_alert1_show and sess2_ended, color=i_sess2_color, text='End', style=shape.labeldown, location=location.bottom, size=size.small, textcolor=color.new(color.white, 0))
  444. plotshape(i_alert1_show and sess3_started, color=i_sess3_color, text='Start', style=shape.labeldown, location=location.bottom, size=size.small, textcolor=color.new(color.white, 0))
  445. plotshape(i_alert1_show and sess3_ended, color=i_sess3_color, text='End', style=shape.labeldown, location=location.bottom, size=size.small, textcolor=color.new(color.white, 0))
  446.  
  447. plot(i_alert3_show ? sess1_high : na, style=plot.style_linebr, color=i_sess1_color)
  448. plot(i_alert3_show ? sess1_low : na, style=plot.style_linebr, linewidth=2, color=i_sess1_color)
  449. plot(i_alert3_show ? sess2_high : na, style=plot.style_linebr, color=i_sess2_color)
  450. plot(i_alert3_show ? sess2_low : na, style=plot.style_linebr, linewidth=2, color=i_sess2_color)
  451. plot(i_alert3_show ? sess3_high : na, style=plot.style_linebr, color=i_sess3_color)
  452. plot(i_alert3_show ? sess3_low : na, style=plot.style_linebr, linewidth=2, color=i_sess3_color)
  453.  
  454. plotshape(i_alert3_show and (not is_sess1) and ta.crossover(close, sess1_high), color=i_sess1_color, title="", style=shape.triangleup, location=location.bottom, size=size.tiny)
  455. plotshape(i_alert3_show and (not is_sess1) and ta.crossunder(close, sess1_low), color=i_sess1_color, title="", style=shape.triangledown, location=location.bottom, size=size.tiny)
  456. plotshape(i_alert3_show and (not is_sess2) and ta.crossover(close, sess2_high), color=i_sess2_color, title="", style=shape.triangleup, location=location.bottom, size=size.tiny)
  457. plotshape(i_alert3_show and (not is_sess2) and ta.crossunder(close, sess2_low), color=i_sess2_color, title="", style=shape.triangledown, location=location.bottom, size=size.tiny)
  458. plotshape(i_alert3_show and (not is_sess3) and ta.crossover(close, sess3_high), color=i_sess3_color, title="", style=shape.triangleup, location=location.bottom, size=size.tiny)
  459. plotshape(i_alert3_show and (not is_sess3) and ta.crossunder(close, sess3_low), color=i_sess3_color, title="", style=shape.triangledown, location=location.bottom, size=size.tiny)
  460.  
  461.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement