xmd79

market sessions by sellstreet

May 26th, 2023
170
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 19.42 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. // © sellstreet
  3.  
  4. //@version=5
  5. indicator("market sessions by sellstreet", overlay=true, precision=0,
  6. max_bars_back=1500, max_lines_count=500, max_labels_count=500, max_boxes_count=500)
  7. // format=format.price, precision=0, scale=scale.none)
  8.  
  9. gr_1="HISTORY"
  10. Show_Opens = input.bool(defval=true, title = "Opens", inline="0_1", group=gr_1)
  11. Only_Last_Opens = input.bool(defval=true, title = "Only Last Opens", inline="0_1", group=gr_1)
  12.  
  13. Show_Sessions = input.bool(defval=true, title = "Sessions", inline="0_2", group=gr_1)
  14. Only_Last_Sessions = input.bool(defval=false, title = "Only Last Sessions", inline="0_2", group=gr_1)
  15.  
  16. Show_Days_VLines = input.bool(defval=false, title = "Days Lines", inline="0_3", group=gr_1)
  17. // Show_Days_Bg = input.bool(defval=false, title = "Days Background", inline="0_3", group=gr_1)
  18.  
  19.  
  20. gr_2="OPENS"
  21. ULine_Width = input.int(defval=1, title = "Line Width", minval=0, maxval=7, step=1, group=gr_2)
  22. Show_Daily_Open = input.bool(defval=true, title = "Daily Open", inline = "2_1", group=gr_2)
  23. Col_Daily_Open = input.color(color.rgb(0, 0, 0, 0), "", inline = "2_1", group=gr_2)
  24. Show_Weekly_Open = input.bool(defval=true, title = "Weekly Open", inline = "2_1", group=gr_2)
  25. Col_Weekly_Open = input.color(color.rgb(0, 0, 0, 0), "", inline = "2_1", group=gr_2)
  26.  
  27. Show_Monthly_Open = input.bool(defval=true, title = "Monthly Open", inline = "2_2", group=gr_2)
  28. Col_Monthly_Open = input.color(color.rgb(0, 0, 0, 0), "", inline = "2_2", group=gr_2)
  29. Show_NewYork_Midnight = input.bool(defval=true, title = "New York Midnight", inline = "2_2", group=gr_2)
  30. Col_NewYork_Midnight = input.color(color.rgb(0, 0, 0, 0), "", inline = "2_2", group=gr_2)
  31.  
  32. Show_Previous_Daily_High = input.bool(defval=true, title = "Previous Daily High", inline = "2_3", group=gr_2)
  33. Col_Previous_Daily_High = input.color(color.rgb(0, 0, 0, 0), "", inline = "2_3", group=gr_2)
  34. Show_Previous_Daily_Low = input.bool(defval=true, title = "Previous Daily Low", inline = "2_3", group=gr_2)
  35. Col_Previous_Daily_Low = input.color(color.rgb(0, 0, 0, 0), "", inline = "2_3", group=gr_2)
  36.  
  37. SLine_Width = input.int(defval=0, title = "Session Line Width", minval=0, maxval=7, step=1)
  38.  
  39. // gr_4="SYDNEY"
  40. // Show_Sydney = input.bool(defval=false, title = "SYDNEY", inline="4_1", group=gr_4)
  41. // Sydney_Display = input.string(defval="Border", title = "", options=["Border", "Filled Box"], inline="4_1", group=gr_4)
  42. // Title_Col_Sydney = input.color(color.rgb(88, 43, 143, 20), "Title", inline="4_2", group=gr_4)
  43. // Background_Col_Sydney = input.color(color.rgb(88, 43, 143, 65), "Background", inline="4_2", group=gr_4)
  44.  
  45. gr_3="ASIA"
  46. Show_Asia = input.bool(defval=true, title = "ASIA", inline="3_1", group=gr_3)
  47. Asia_Display = input.string(defval="Filled Box", title = "", options=["Border", "Filled Box"], inline="3_1", group=gr_3)
  48. Title_Col_Asia = input.color(color.rgb(0, 0, 0, 0), "Title", inline="3_2", group=gr_3)
  49. Background_Col_Asia = input.color(color.rgb(230, 184, 0, 90), "Background", inline="3_2", group=gr_3)
  50.  
  51. gr_8="Frankfurt"
  52. Show_Frankfurt = input.bool(defval=true, title = "Frankfurt", inline="8_1", group=gr_8)
  53. Frankfurt_Display = input.string(defval="Filled Box", title = "", options=["Border", "Filled Box"], inline="8_1", group=gr_8)
  54. Title_Col_Frankfurt = input.color(color.rgb(0, 0, 0, 0), "Title", inline="8_2", group=gr_8)
  55. Background_Col_Frankfurt = input.color(color.rgb(204, 51, 0, 80), "Background", inline="8_2", group=gr_8)
  56.  
  57. gr_5="LONDON"
  58. Show_London = input.bool(defval=true, title = "London", inline="5_1", group=gr_5)
  59. London_Display = input.string(defval="Filled Box", title = "", options=["Border", "Filled Box"], inline="5_1", group=gr_5)
  60. Title_Col_London = input.color(color.rgb(0, 0, 0, 0), "Title", inline="5_2", group=gr_5)
  61. Background_Col_London = input.color(color.rgb(128, 170, 255, 90), "Background", inline="5_2", group=gr_5)
  62.  
  63. gr_6="NEW YORK"
  64. Show_NewYork = input.bool(defval=true, title = "NEW YORK", inline="6_1", group=gr_6)
  65. NewYork_Display = input.string(defval="Filled Box", title = "", options=["Border", "Filled Box"], inline="6_1", group=gr_6)
  66. Title_Col_NewYork = input.color(color.rgb(0, 0, 0, 0), "Title", inline="6_2", group=gr_6)
  67. Background_Col_NewYork = input.color(color.rgb(179,102,255, 90), "Background", inline="6_2", group=gr_6)
  68.  
  69. gr_7="CBDR"
  70. Show_CBDR = input.bool(defval=true, title = "CBDR", inline="7_1", group=gr_7)
  71. CBDR_Display = input.string(defval="Filled Box", title = "", options=["Border", "Filled Box"], inline="7_1", group=gr_7)
  72. Title_Col_CBDR = input.color(color.rgb(0, 0, 0, 0), "Title", inline="7_2", group=gr_7)
  73. Background_Col_CBDR = input.color(color.rgb(255,102,102, 90), "Background", inline="7_2", group=gr_7)
  74.  
  75.  
  76.  
  77. // ----- Utils -----
  78. // https://en.wikipedia.org/wiki/List_of_tz_database_time_zones
  79. // https://www.forexmarkethours.com/
  80.  
  81. __Get_Price_At_Midnight(Timezone="America/New_York") =>
  82. var float res_open = na
  83. session_str = "0000-0000:1234567" // Sun to Sat
  84. if time("D", session_str, Timezone) != time("D", session_str, Timezone)[1]
  85. res_open := open
  86. res_open
  87.  
  88. Get_Price_At_Midnight(Timezone="America/New_York") =>
  89. float Midnight_Price = request.security(syminfo.tickerid, "60", __Get_Price_At_Midnight(Timezone),
  90. gaps=barmerge.gaps_off, lookahead=barmerge.lookahead_on)
  91. Midnight_Price
  92.  
  93. Session_Range_Info(Range="0800-1600", Timezone="America/New_York") =>
  94. time_val = time("1", Range, Timezone)
  95. in_range = not na(time_val) ? true : false
  96. is_begin = in_range and na(time("1", Range, Timezone)[1])
  97. [in_range, is_begin, time_val]
  98.  
  99. Draw_Label(XLoc, YPrice, Text, TColor) =>
  100. nlabel = label.new(x=XLoc, y=YPrice, text=Text, textcolor=TColor, size=size.normal,
  101. xloc=xloc.bar_time, yloc=yloc.price, text_font_family=font.family_monospace, style=label.style_none, textalign=text.align_center)
  102. nlabel
  103.  
  104.  
  105.  
  106. // ----- Calc and Show Opens -----
  107. float Daily_Open = Show_Opens and Show_Daily_Open ? request.security(syminfo.tickerid, "D", open, lookahead=barmerge.lookahead_on) : na
  108. float Weekly_Open = Show_Opens and Show_Weekly_Open ? request.security(syminfo.tickerid, "W", open, lookahead=barmerge.lookahead_on) : na
  109. float Monthly_Open = Show_Opens and Show_Monthly_Open ? request.security(syminfo.tickerid, "M", open, lookahead=barmerge.lookahead_on) : na
  110. float NewYork_Midnight = Show_Opens and Show_NewYork_Midnight ? Get_Price_At_Midnight("America/New_York") : na
  111. float Previous_Daily_High = Show_Opens and Show_Previous_Daily_High ? request.security(syminfo.tickerid, "D", high[1], lookahead=barmerge.lookahead_on) : na
  112. float Previous_Daily_Low = Show_Opens and Show_Previous_Daily_Low ? request.security(syminfo.tickerid, "D", low[1], lookahead=barmerge.lookahead_on) : na
  113.  
  114. // var line[] DP_Lines_Arr = array.new_line(6)
  115. Draw_Part_Line(XStart, XEnd, YPrice, Text, LColor, LWidth) =>
  116. line.new(x1=XStart, y1=YPrice, x2=XEnd, y2=YPrice, xloc=xloc.bar_time, color=LColor, width=LWidth, style=line.style_solid)
  117. Draw_Label(XEnd, YPrice, Text, LColor)
  118.  
  119. // -- Daily_Open --
  120. if ta.change(Daily_Open, 1) != 0
  121. XStart = time(timeframe.period, "0000-0000:1234567")
  122. XEnd = XStart + 24 * 3600 * 1000 // 24 hours
  123.  
  124. is_last_line = last_bar_time - XEnd < 3600 * 1000 // less than 1 hour
  125. // Draw_Label(XStart, low, str.format("LBT: {0}", last_bar_time - XEnd), color.maroon)
  126. is_draw = Only_Last_Opens ? is_last_line : true
  127. if is_draw
  128. Draw_Part_Line(XStart, XEnd, Daily_Open, "DO", Col_Daily_Open, ULine_Width)
  129. // Draw_Part_Line(XStart, XEnd, Daily_Open, "DO", Col_Daily_Open, ULine_Width)
  130.  
  131. // -- Weekly_Open --
  132. if ta.change(Weekly_Open, 1) != 0
  133. XStart = time(timeframe.period, "0000-0000:1234567")
  134. XEnd = XStart + 7 * 24 * 3600 * 1000 // 7 days
  135.  
  136. is_last_line = last_bar_time - XEnd < 3600 * 1000 // less than 1 hour
  137. is_draw = Only_Last_Opens ? is_last_line : true
  138. if is_draw
  139. Draw_Part_Line(XStart, XEnd, Weekly_Open, "WO", Col_Weekly_Open, ULine_Width)
  140. // Draw_Part_Line(XStart, XEnd, Weekly_Open, "WO", Col_Weekly_Open, ULine_Width)
  141.  
  142. // -- Monthly_Open --
  143. if ta.change(Monthly_Open, 1) != 0
  144. XStart = time(timeframe.period, "0000-0000:1234567")
  145. XEnd = XStart + 30 * 24 * 3600 * 1000 // 30 days
  146.  
  147. is_last_line = last_bar_time - XEnd < 3600 * 1000 // less than 1 hour
  148. is_draw = Only_Last_Opens ? is_last_line : true
  149. if is_draw
  150. Draw_Part_Line(XStart, XEnd, Monthly_Open, "MO", Col_Monthly_Open, ULine_Width)
  151. // Draw_Part_Line(XStart, XEnd, Monthly_Open, "MO", Col_Monthly_Open, ULine_Width)
  152.  
  153. // ----- Calc and Show New York Midnight -----
  154. // var bool CharSS = false
  155. // CharSS := false
  156. if ta.change(NewYork_Midnight, 1) != 0
  157. XStart = time(timeframe.period, "0000-0000:1234567")
  158. XEnd = XStart + 24 * 3600 * 1000 // 24 hours
  159.  
  160. // hval = hour(XStart, "America/New_York")
  161. if not na(time("1", "1700-1800:1", "America/New_York"))
  162. XEnd := XStart + 7 * 3600 * 1000 // 7 hour
  163. // CharSS := true
  164. // else
  165. // CharSS := false
  166.  
  167. is_last_line = last_bar_time - XEnd < 3600 * 1000 // less than 1 hour
  168. is_draw = Only_Last_Opens ? is_last_line : true
  169. if is_draw
  170. Draw_Part_Line(XStart, XEnd, NewYork_Midnight, "NYM", Col_NewYork_Midnight, ULine_Width)
  171. // Draw_Part_Line(XStart, XEnd, NewYork_Midnight, "NYM", Col_NewYork_Midnight, ULine_Width)
  172.  
  173. // triangle char: ▲ ▼ ◄ ►
  174. // plotchar(CharSS, char='▼', location=location.top, color=color.teal, size=size.normal)
  175.  
  176. // ----- Previous Daily High -----
  177. if ta.change(Previous_Daily_High, 1) != 0
  178. XStart = time(timeframe.period, "0000-0000:1234567")
  179. XEnd = XStart + 24 * 3600 * 1000 // 24 hours
  180.  
  181. is_last_line = last_bar_time - XEnd < 3600 * 1000 // less than 1 hour
  182. is_draw = Only_Last_Opens ? is_last_line : true
  183. if is_draw
  184. Draw_Part_Line(XStart, XEnd, Previous_Daily_High, "PDH", Col_Previous_Daily_High, ULine_Width)
  185. // Draw_Part_Line(XStart, XEnd, Previous_Daily_High, "PDH", Col_Previous_Daily_High, ULine_Width)
  186.  
  187. // ----- Previous Daily Low -----
  188. if ta.change(Previous_Daily_Low, 1) != 0
  189. XStart = time(timeframe.period, "0000-0000:1234567")
  190. XEnd = XStart + 24 * 3600 * 1000 // 24 hours
  191.  
  192. is_last_line = last_bar_time - XEnd < 3600 * 1000 // less than 1 hour
  193. is_draw = Only_Last_Opens ? is_last_line : true
  194. if is_draw
  195. Draw_Part_Line(XStart, XEnd, Previous_Daily_Low, "PDL", Col_Previous_Daily_Low, ULine_Width)
  196. // Draw_Part_Line(XStart, XEnd, Previous_Daily_Low, "PDL", Col_Previous_Daily_Low, ULine_Width)
  197.  
  198.  
  199.  
  200. // plot(Daily_Open, color=Col_Daily_Open, linewidth=ULine_Width, title="Daily Open", editable=false, style=plot.style_steplinebr)
  201. // plot(Weekly_Open, color=Col_Weekly_Open, linewidth=ULine_Width, title="Weekly Open", editable=false, style=plot.style_steplinebr)
  202. // plot(Monthly_Open, color=Col_Monthly_Open, linewidth=ULine_Width, title="Monthly Open", editable=false, style=plot.style_steplinebr)
  203. // plot(NewYork_Midnight, color=Col_NewYork_Midnight, linewidth=ULine_Width, title="New York Midnight", editable=false, style=plot.style_steplinebr)
  204. // plot(Previous_Daily_High, color=Col_Previous_Daily_High, linewidth=ULine_Width, title="Previous Daily High", editable=false, style=plot.style_steplinebr)
  205. // plot(Previous_Daily_Low, color=Col_Previous_Daily_Low, linewidth=ULine_Width, title="Previous Daily Low", editable=false, style=plot.style_steplinebr)
  206.  
  207.  
  208.  
  209. // ----- Calc and Show Sessions -----
  210. arr_count = 8
  211. var float[] CHigh_Arr = array.new_float(arr_count)
  212. var float[] CLow_Arr = array.new_float(arr_count)
  213. var box[] Box_Arr = array.new_box(arr_count)
  214. var label[] Label_Arr = array.new_label(arr_count)
  215. var bool[] InRange_Arr = array.new_bool(arr_count)
  216.  
  217. Session_Draw(SLabel="London", Session_Range="0700-1600", HoursDur=9, Timezone="Greenwich", CI=0,
  218. Display_Type="Border", SLine_Width=2, Title_Col=color.maroon, Background_Col=color.aqua) =>
  219. [in_range, is_begin, time_val] = Session_Range_Info(Session_Range, Timezone)
  220. array.set(InRange_Arr, CI, in_range)
  221.  
  222. if is_begin
  223. end_time = time_val + (HoursDur - 1) * 3600 * 1000 // add Hours Duration
  224. is_last_box = last_bar_time - time_val < 24 * 3600 * 1000 // less than 24 hour
  225. is_draw = Only_Last_Sessions ? is_last_box : true
  226.  
  227. if is_draw
  228. array.set(CHigh_Arr, CI, high)
  229. array.set(CLow_Arr, CI, low)
  230.  
  231. NLabel = Draw_Label(time_val + (HoursDur / 2) * 3600 * 1000, high * 1.005, SLabel, Title_Col)
  232. array.set(Label_Arr, CI, NLabel)
  233.  
  234. bg_color = Background_Col // Display_Type == "Filled Box"
  235. if Display_Type == "Border"
  236. bg_color := color.new(Background_Col, 100)
  237.  
  238. NBox = box.new(time_val, high * 1.001, end_time, low * 0.999, xloc=xloc.bar_time,
  239. border_color=Title_Col, border_width=SLine_Width, border_style=line.style_solid, bgcolor=bg_color)
  240. array.set(Box_Arr, CI, NBox)
  241.  
  242. else
  243. array.set(CHigh_Arr, CI, na)
  244. array.set(CLow_Arr, CI, na)
  245. array.set(Label_Arr, CI, na)
  246. array.set(Box_Arr, CI, na)
  247.  
  248. if in_range and not is_begin
  249. Cur_High = array.get(CHigh_Arr, CI)
  250. ncHigh = math.max(high, Cur_High)
  251. array.set(CHigh_Arr, CI, ncHigh)
  252.  
  253. Cur_Low = array.get(CLow_Arr, CI)
  254. ncLow = math.min(low, Cur_Low)
  255. array.set(CLow_Arr, CI, ncLow)
  256.  
  257. Cur_Label = array.get(Label_Arr, CI)
  258. label.set_y(Cur_Label, ncHigh)
  259.  
  260. Cur_Box = array.get(Box_Arr, CI)
  261. box.set_top(Cur_Box, ncHigh)
  262. box.set_bottom(Cur_Box, ncLow)
  263.  
  264. // ----- Sydney, AEDT, UTC +11, with DST -----
  265. // if Show_Sessions and Show_Sydney
  266. // Session_Draw("Sydney", "0700-1600", 9, "Australia/Sydney", 0, Sydney_Display, SLine_Width, Title_Col_Sydney, Background_Col_Sydney)
  267.  
  268. // ----- Asia, JST, UTC +9, not DST -----
  269. if Show_Sessions and Show_Asia
  270. Session_Draw("Asia", "0800-1700", 9, "Asia/Tokyo", 1, Asia_Display, SLine_Width, Title_Col_Asia, Background_Col_Asia)
  271.  
  272. // ----- London, GMT, UTC +0, not DST -----
  273. if Show_Sessions and Show_London
  274. Session_Draw("London", "0700-1600", 9, "Greenwich", 2, London_Display, SLine_Width, Title_Col_London, Background_Col_London)
  275. // plotchar(array.get(InRange_Arr, 0), "in_range_London ", "▲", location.bottom, size=size.tiny, color=color.maroon, editable=false)
  276.  
  277. // ----- New York, EDT, UTC -4, with DST -----
  278. if Show_Sessions and Show_NewYork
  279. Session_Draw("New York", "0800-1700", 9, "America/New_York", 3, NewYork_Display, SLine_Width, Title_Col_NewYork, Background_Col_NewYork)
  280. // plotchar(array.get(InRange_Arr, 1), "in_range_NewYork ", "▲", location.bottom, size=size.tiny, color=color.maroon, editable=false)
  281.  
  282. // ----- Central Bank Dealers Range -----
  283. if Show_Sessions and Show_CBDR
  284. Session_Draw("CBDR", "2000-0000", 4, "Greenwich", 4, CBDR_Display, SLine_Width, Title_Col_CBDR, Background_Col_CBDR)
  285.  
  286. // // ----- Frankfurt Modify-----
  287. if Show_Sessions and Show_Frankfurt
  288. Session_Draw("Frankfurt", "0200-0300", 2, "America/New_York", 5, Frankfurt_Display, SLine_Width, Title_Col_Frankfurt, Background_Col_Frankfurt)
  289.  
  290. // // ----- Hong Kong -----
  291. // if Show_Sessions and Show_HongKong
  292. // Session_Draw("Hong Kong", "0100-1000", 9, "Asia/Hong_Kong", 5, HongKong_Display, SLine_Width, Title_Col_HongKong, Background_Col_HongKong)
  293. //
  294. // // ----- Singapore -----
  295. // if Show_Sessions and Show_Singapore
  296. // Session_Draw("Singapore", "0100-1000", 9, "Asia/Singapore", 6, Singapore_Display, SLine_Width, Title_Col_Singapore, Background_Col_Singapore)
  297.  
  298.  
  299.  
  300. // ----- Show Days -----
  301. // Days Utils
  302. dd_ses_str = "0000-0000:1234567"
  303. dd_tz = syminfo.timezone
  304. newDay = ta.change(time("D", dd_ses_str, syminfo.timezone))
  305. LineLengthMult = 100
  306. LineLength = ta.atr(100) * LineLengthMult
  307. bgPlot2 = time(timeframe.period)
  308.  
  309. isMon() => dayofweek(time("D", dd_ses_str, dd_tz), dd_tz) == dayofweek.monday ? 1 : 0
  310. isTue() => dayofweek(time("D", dd_ses_str, dd_tz), dd_tz) == dayofweek.tuesday ? 1 : 0
  311. isWed() => dayofweek(time("D", dd_ses_str, dd_tz), dd_tz) == dayofweek.wednesday ? 1 : 0
  312. isThu() => dayofweek(time("D", dd_ses_str, dd_tz), dd_tz) == dayofweek.thursday ? 1 : 0
  313. isFri() => dayofweek(time("D", dd_ses_str, dd_tz), dd_tz) == dayofweek.friday ? 1 : 0
  314. isSat() => dayofweek(time("D", dd_ses_str, dd_tz), dd_tz) == dayofweek.saturday ? 1 : 0
  315. isSun() => dayofweek(time("D", dd_ses_str, dd_tz), dd_tz) == dayofweek.sunday ? 1 : 0
  316.  
  317. txtMon = "M\no\nn\nd\na\ny"
  318. txtTue = "T\nu\ne\ns\nd\na\ny"
  319. txtWed = "W\ne\nd\nn\ne\ns\nd\na\ny"
  320. txtThu = "T\nh\nu\nr\ns\nd\na\ny"
  321. txtFri = "F\nr\ni\nd\na\ny"
  322. txtSat = "S\na\nt\nu\nr\nd\na\ny"
  323. txtSun = "S\nu\nn\nd\na\ny"
  324.  
  325. drawVerticalLine(offset, cond) =>
  326. if cond
  327. line.new(bar_index[offset], low-LineLength, bar_index[offset], high+LineLength,
  328. color=color.new(color.black, 40), width=1)
  329.  
  330. // Plot Char and Lines
  331. plotchar(Show_Days_VLines and newDay and isMon(), "Mon", "", location.bottom, color.black, size = size.tiny, text = txtMon, offset=2, editable=false, display=display.all - display.status_line)
  332. plotchar(Show_Days_VLines and newDay and isTue(), "Tue", "", location.bottom, color.black, size = size.tiny, text = txtTue, offset=2, editable=false, display=display.all - display.status_line)
  333. plotchar(Show_Days_VLines and newDay and isWed(), "Wed", "", location.bottom, color.black, size = size.tiny, text = txtWed, offset=2, editable=false, display=display.all - display.status_line)
  334. plotchar(Show_Days_VLines and newDay and isThu(), "Thu", "", location.bottom, color.black, size = size.tiny, text = txtThu, offset=2, editable=false, display=display.all - display.status_line)
  335. plotchar(Show_Days_VLines and newDay and isFri(), "Fri", "", location.bottom, color.black, size = size.tiny, text = txtFri, offset=2, editable=false, display=display.all - display.status_line)
  336. plotchar(Show_Days_VLines and newDay and isSat(), "Sat", "", location.bottom, color.black, size = size.tiny, text = txtSat, offset=2, editable=false, display=display.all - display.status_line)
  337. plotchar(Show_Days_VLines and newDay and isSun(), "Sun", "", location.bottom, color.black, size = size.tiny, text = txtSun, offset=2, editable=false, display=display.all - display.status_line)
  338.  
  339. drawVerticalLine(0, Show_Days_VLines and newDay and isMon())
  340. drawVerticalLine(0, Show_Days_VLines and newDay and isTue())
  341. drawVerticalLine(0, Show_Days_VLines and newDay and isWed())
  342. drawVerticalLine(0, Show_Days_VLines and newDay and isThu())
  343. drawVerticalLine(0, Show_Days_VLines and newDay and isFri())
  344. drawVerticalLine(0, Show_Days_VLines and newDay and isSat())
  345. drawVerticalLine(0, Show_Days_VLines and newDay and isSun())
  346.  
  347. // Background Color
  348. // trpv = 90
  349. // bgcolor(Show_Days_Bg and bgPlot2 and isMon() ? color.new(color.red, trpv) : na, title="Time", editable=false)
  350. // bgcolor(Show_Days_Bg and bgPlot2 and isTue() ? color.new(color.orange, trpv): na, title="Time", editable=false)
  351. // bgcolor(Show_Days_Bg and bgPlot2 and isWed() ? color.new(color.yellow, trpv) : na, title="Time", editable=false)
  352. // bgcolor(Show_Days_Bg and bgPlot2 and isThu() ? color.new(color.green, trpv) : na, title="Time", editable=false)
  353. // bgcolor(Show_Days_Bg and bgPlot2 and isFri() ? color.new(color.blue, trpv) : na, title="Time", editable=false)
  354. // bgcolor(Show_Days_Bg and bgPlot2 and isSat() ? color.new(color.purple, trpv) : na, title="Time", editable=false)
  355. // bgcolor(Show_Days_Bg and bgPlot2 and isSun() ? color.new(color.black, trpv) : na, title="Time", editable=false)
  356.  
Advertisement
Add Comment
Please, Sign In to add comment