Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- // © twingall
- //customize the week ahead with 4x individual daily sessions (each day with it's own sessions)
- //add optional text labels and optional time/date stamps, for key events of the week
- //@version=5
- indicator(title="Future week Calendar; custom day sessions", overlay=true, max_boxes_count = 500, max_lines_count = 500)
- mult =input.int(0, "Boxes; weeks back to show(0 = upcoming week only)", minval =0, tooltip="with setting of 0 (only showing upcoming 7 days); the projected session boxes should disappear as price passes through their RHS")
- //mult2 =input.int(0, "Labels; weeks back to show (0 = upcoming week only)", minval =0,tooltip="i.e. with setting boxes = 1 above and Labels = 0; 1 week of historical boxes show, but labels will auto-delete as price passes through RHS of a box")
- userTimezone = input.string("America/New_York", "input your timezone", options =["America/New_York", "UTC-10", "UTC-9", "UTC-8", "UTC-7", "UTC-6", "UTC-5", "UTC-4", "UTC-3",
- "UTC-2", "UTC-1","UTC", "UTC+1", "UTC+2", "UTC+3", "UTC+4","UTC+5","UTC+6","UTC+7","UTC+8","UTC+9","UTC+10","UTC+11","UTC+12","UTC+13"])
- colorNone = color.new(color.white, 100)
- ma = ta.sma(close, 500)
- ma2 = ta.sma(close, 50)
- week = 7*24*3600*1000
- oneBartime = timeframe.in_seconds(timeframe.period)*1000
- boxHeight = input.int(70, minval =20, maxval = 110, step =3, title ="Box Height", tooltip = "Arbitrary units, based on multiplier of ADR; 70 seems optimal for most timeframes")
- atrMult = ta.atr(1000)*boxHeight //ta.atr(200)
- showDay = input.bool(true, "Day Name", inline ='1', group = 'text formatting')
- showTime =input.bool(true, "Time", inline ='1', group = 'text formatting')
- showDate=input.bool(true, "Date", inline ='2', group = 'text formatting')
- usaFormat = input.bool(false, "(USA format: MM/dd)",inline ='2', group = 'text formatting')
- valignChoice = input.string(text.align_top,"Position:", options = [text.align_top, text.align_center, text.align_bottom], inline ='4', group = 'text formatting')
- txtSize = input.string(size.small,"Size:", options = [size.auto, size.tiny, size.small, size.normal, size.large, size.huge], inline ='4', group = 'text formatting')
- txtCol = input.color(color.black, "Color:", inline ='4', group = 'text formatting')
- delHistLabs = input.bool(true, "delete historical labels", inline ='5', group = 'text formatting', tooltip = "Labels will auto-delete as price passes through right hand side of box")
- /// ~~FUNCTIONS~~
- close(sess)=>
- var float result =na
- if sess
- result:=close
- result
- closeTime(sess)=>
- var int closeTime = na
- if sess[1] and not sess
- closeTime := time[1]
- int result = closeTime
- openTime(sess)=>
- var int _openTime = na
- if sess and not sess[1]
- _openTime := time
- int result = _openTime
- DoW(_time)=>
- string _DoW = dayofweek(_time, userTimezone) ==1?"Sun":dayofweek(_time, userTimezone) ==2?"Mon":dayofweek(_time, userTimezone) ==3?"Tues":dayofweek(_time, userTimezone) ==4?"Weds":
- dayofweek(_time, userTimezone) ==5?"Thurs":dayofweek(_time, userTimezone) ==6?"Fri":dayofweek(_time, userTimezone) ==7?"Sat":na
- _DoW
- boxPaint(lab,t1,t2,_bxArr, col)=>
- string dayLab = showDay?DoW(t1+1*week)+"\n":na
- string dateLab = showDate and not usaFormat?str.format_time(t1+1*week, "dd/MM",userTimezone)+"\n":showDate and usaFormat?str.format_time(t1+1*week, "MM/dd",userTimezone)+"\n":na
- string timeLab =showTime?str.format_time(t1+1*week, "HH:mm",userTimezone)+"\n":na
- string txtLab = lab
- _bx = box (na)
- _bx:= box.new(t1+1*week, ma +atrMult, t2+1*week+oneBartime, ma -atrMult, text = dayLab+dateLab+timeLab+txtLab, text_valign=valignChoice,text_halign=text.align_left, text_size = txtSize, xloc = xloc.bar_time,
- text_color = txtCol, border_color = colorNone, bgcolor = col)
- array.push(_bxArr,_bx)
- if array.size(_bxArr)>mult+1
- box.delete(array.shift(_bxArr))
- if array.size(_bxArr)> (delHistLabs? 1: mult+1 ) //mult2+1
- box.set_text(array.shift(_bxArr), "")
- _bx
- boxReposition(_bxArr1)=>
- box _bx1 = na
- if array.size(_bxArr1)>0
- _bx1 := array.last(_bxArr1)
- box.set_bottom(_bx1, ma2 -atrMult)
- box.set_top(_bx1, ma2 +atrMult)
- inSess(_sess)=> not na(time(timeframe.period, str.tostring(_sess), userTimezone))
- //box arrays declared:
- var array<box> boxArr1 = array.new<box>(0), var array<box> boxArr2= array.new<box>(0), var array<box> boxArr3 = array.new<box>(0), var array<box> boxArr4 = array.new<box>(0)
- var array<box> boxArr5 = array.new<box>(0), var array<box> boxArr6= array.new<box>(0), var array<box> boxArr7 = array.new<box>(0), var array<box> boxArr8 = array.new<box>(0)
- var array<box> boxArr9 = array.new<box>(0), var array<box> boxArr10= array.new<box>(0), var array<box> boxArr11 = array.new<box>(0), var array<box> boxArr12 = array.new<box>(0)
- var array<box> boxArr13 = array.new<box>(0), var array<box> boxArr14= array.new<box>(0), var array<box> boxArr15 = array.new<box>(0), var array<box> boxArr16 = array.new<box>(0)
- var array<box> boxArr17 = array.new<box>(0), var array<box> boxArr18= array.new<box>(0), var array<box> boxArr19 = array.new<box>(0), var array<box> boxArr20 = array.new<box>(0)
- var array<box> boxArr21 = array.new<box>(0), var array<box> boxArr22= array.new<box>(0), var array<box> boxArr23 = array.new<box>(0), var array<box> boxArr24 = array.new<box>(0)
- var array<box> boxArr25 = array.new<box>(0), var array<box> boxArr26= array.new<box>(0), var array<box> boxArr27 = array.new<box>(0), var array<box> boxArr28 = array.new<box>(0)
- //MONDAY
- showSess1 =input.bool(true, "", group = "Monday", inline='1')
- inputSession1 = input.session('0100-0500', title='', group = "Monday", inline='1')
- col1 = input.color(color.new(color.green, 85), title ="", group = "Monday", inline='1')
- str1 =input.string("'Example Text'", "| text:", group = "Monday", inline='1')
- showSess2 =input.bool(true, "", group = "Monday", inline='2')
- inputSession2 = input.session('0700-1000', title='', group = "Monday", inline='2')
- col2 = input.color(color.new(color.red, 85), title ="", group = "Monday", inline='2')
- str2 =input.string("", "| text:", group = "Monday", inline='2')
- showSess3 =input.bool(true, "", group = "Monday", inline='3')
- inputSession3 = input.session('1100-1200', title='', group = "Monday", inline='3')
- col3 = input.color(color.new(color.orange, 85), title ="", group = "Monday", inline='3')
- str3 =input.string("", "| text:", group = "Monday", inline='3')
- showSess4 =input.bool(true, "", group = "Monday", inline='4')
- inputSession4 = input.session('1330-1600', title='', group = "Monday", inline='4')
- col4 = input.color(color.new(color.fuchsia, 85), title ="", group = "Monday", inline='4')
- str4 =input.string("", "| text:", group = "Monday", inline='4')
- inSession1= inSess(inputSession1)
- inSession2 = inSess(inputSession2)
- inSession3 = inSess(inputSession3)
- inSession4 = inSess(inputSession4)
- float htfClose1 =close(inSession1)
- int htfCloseTime1 = ta.valuewhen(close==htfClose1 and inSession1,time,0)
- int htfOpenTime1 = openTime(inSession1)
- float htfClose2 =close(inSession2)
- int htfCloseTime2 = ta.valuewhen(close==htfClose2 and inSession2,time,0)
- int htfOpenTime2 = openTime(inSession2)
- float htfClose3 =close(inSession3)
- int htfCloseTime3 = ta.valuewhen(close==htfClose3 and inSession3,time,0)
- int htfOpenTime3 = openTime(inSession3)
- float htfClose4 =close(inSession4)
- int htfCloseTime4 = ta.valuewhen(close==htfClose4 and inSession4,time,0)
- int htfOpenTime4 = openTime(inSession4)
- if not inSession1 and inSession1[1] and dayofweek(htfOpenTime1,userTimezone) ==2 and showSess1
- boxPaint(str1,htfOpenTime1,htfCloseTime1,boxArr1,col1)
- if not inSession2 and inSession2[1] and dayofweek(htfOpenTime2,userTimezone) ==2 and showSess2
- boxPaint(str2,htfOpenTime2,htfCloseTime2,boxArr2,col2)
- if not inSession3 and inSession3[1] and dayofweek(htfOpenTime3,userTimezone) ==2 and showSess3
- boxPaint(str3,htfOpenTime3,htfCloseTime3,boxArr3,col3)
- if not inSession4 and inSession4[1] and dayofweek(htfOpenTime4,userTimezone) ==2 and showSess4
- boxPaint(str4,htfOpenTime4,htfCloseTime4,boxArr4,col4)
- if dayofweek(time, userTimezone) ==2 and not (dayofweek(time, userTimezone) ==2)[1]
- boxReposition(boxArr1)
- boxReposition(boxArr2)
- boxReposition(boxArr3)
- boxReposition(boxArr4)
- //TUESDAY
- showSess5 =input.bool(true, "", group = "Tuesday", inline='1')
- inputSession5 = input.session('0500-0600', title='', group = "Tuesday", inline='1')
- col5 = input.color(color.new(color.green, 85), title ="", group = "Tuesday", inline='1')
- str5 =input.string("", "| text:", group = "Tuesday", inline='1')
- showSess6 =input.bool(true, "", group = "Tuesday", inline='2')
- inputSession6 = input.session('0700-1000', title='', group = "Tuesday", inline='2')
- col6 = input.color(color.new(color.red, 85), title ="", group = "Tuesday", inline='2')
- str6 =input.string("", "| text:", group = "Tuesday", inline='2')
- showSess7 =input.bool(true, "", group = "Tuesday", inline='3')
- inputSession7 = input.session('1200-1300', title='', group = "Tuesday", inline='3')
- col7 = input.color(color.new(color.orange, 85), title ="", group = "Tuesday", inline='3')
- str7 =input.string("", "| text:", group = "Tuesday", inline='3')
- showSess8 =input.bool(true, "", group = "Tuesday", inline='4')
- inputSession8 = input.session('1300-1600', title='', group = "Tuesday", inline='4')
- col8 = input.color(color.new(color.fuchsia, 85), title ="", group = "Tuesday", inline='4')
- str8 =input.string("", "| text:", group = "Tuesday", inline='4')
- inSession5 = inSess(inputSession5)
- inSession6 = inSess(inputSession6)
- inSession7 = inSess(inputSession7)
- inSession8 = inSess(inputSession8)
- float htfClose5 =close(inSession5)
- int htfCloseTime5 = ta.valuewhen(close==htfClose5 and inSession5,time,0)
- int htfOpenTime5 = openTime(inSession5)
- float htfClose6 =close(inSession6)
- int htfCloseTime6 = ta.valuewhen(close==htfClose6 and inSession6,time,0)
- int htfOpenTime6 = openTime(inSession6)
- float htfClose7 =close(inSession7)
- int htfCloseTime7 = ta.valuewhen(close==htfClose7 and inSession7,time,0)
- int htfOpenTime7 = openTime(inSession7)
- float htfClose8 =close(inSession8)
- int htfCloseTime8 = ta.valuewhen(close==htfClose8 and inSession8,time,0)
- int htfOpenTime8 = openTime(inSession8)
- if not inSession5 and inSession5[1] and dayofweek(htfOpenTime5,userTimezone ) ==3 and showSess5
- boxPaint(str5,htfOpenTime5,htfCloseTime5,boxArr5,col5)
- if not inSession6 and inSession6[1] and dayofweek(htfOpenTime6,userTimezone ) ==3 and showSess6
- boxPaint(str6,htfOpenTime6,htfCloseTime6,boxArr6,col6)
- if not inSession7 and inSession7[1] and dayofweek(htfOpenTime7,userTimezone ) ==3 and showSess7
- boxPaint(str7,htfOpenTime7,htfCloseTime7,boxArr7,col7)
- if not inSession8 and inSession8[1] and dayofweek(htfOpenTime8,userTimezone ) ==3 and showSess8
- boxPaint(str8,htfOpenTime8,htfCloseTime8,boxArr8,col8)
- if dayofweek(time, userTimezone) ==3 and not (dayofweek(time, userTimezone) ==3)[1]
- boxReposition(boxArr5)
- boxReposition(boxArr6)
- boxReposition(boxArr7)
- boxReposition(boxArr8)
- //WEDNESDAY
- showSess9 =input.bool(true, "", group = "Wednesday", inline='1')
- inputSession9 = input.session('0500-0900', title='', group = "Wednesday", inline='1')
- col9 = input.color(color.new(color.blue, 85), title ="", group = "Wednesday", inline='1')
- str9 =input.string("", "| text:", group = "Wednesday", inline='1')
- showSess10 =input.bool(true, "", group = "Wednesday", inline='2')
- inputSession10 = input.session('1100-1300', title='', group = "Wednesday", inline='2')
- col10 = input.color(color.new(color.red, 85), title ="", group = "Wednesday", inline='2')
- str10 =input.string("", "| text:", group = "Wednesday", inline='2')
- showSess11 =input.bool(true, "", group = "Wednesday", inline='3')
- inputSession11 = input.session('1300-1400', title='', group = "Wednesday", inline='3')
- col11 = input.color(color.new(color.gray, 85), title ="", group = "Wednesday", inline='3')
- str11 =input.string("", "| text:", group = "Wednesday", inline='3')
- showSess12 =input.bool(true, "", group = "Wednesday", inline='4')
- inputSession12 = input.session('1730-1800', title='', group = "Wednesday", inline='4')
- col12 = input.color(color.new(color.fuchsia, 85), title ="", group = "Wednesday", inline='4')
- str12 =input.string("", "| text:", group = "Wednesday", inline='4')
- inSession9 = inSess(inputSession9)
- inSession10 = inSess(inputSession10)
- inSession11 = inSess(inputSession11)
- inSession12 = inSess(inputSession12)
- float htfClose9 =close(inSession9)
- int htfCloseTime9 = ta.valuewhen(close==htfClose9 and inSession9,time,0)
- int htfOpenTime9 = openTime(inSession9)
- float htfClose10 =close(inSession10)
- int htfCloseTime10 = ta.valuewhen(close==htfClose10 and inSession10,time,0)
- int htfOpenTime10 = openTime(inSession10)
- float htfClose11 =close(inSession11)
- int htfCloseTime11 = ta.valuewhen(close==htfClose11 and inSession11,time,0)
- int htfOpenTime11 = openTime(inSession11)
- float htfClose12 =close(inSession12)
- int htfCloseTime12 = ta.valuewhen(close==htfClose12 and inSession12,time,0)
- int htfOpenTime12 = openTime(inSession12)
- if not inSession9 and inSession9[1] and dayofweek(htfOpenTime9,userTimezone ) ==4 and showSess9
- boxPaint(str9,htfOpenTime9,htfCloseTime9,boxArr9,col9)
- if not inSession10 and inSession10[1] and dayofweek(htfOpenTime10,userTimezone ) ==4 and showSess10
- boxPaint(str10,htfOpenTime10,htfCloseTime10,boxArr10,col10)
- if not inSession11 and inSession11[1] and dayofweek(htfOpenTime11,userTimezone ) ==4 and showSess11
- boxPaint(str11,htfOpenTime11,htfCloseTime11,boxArr11,col11)
- if not inSession12 and inSession12[1] and dayofweek(htfOpenTime12,userTimezone ) ==4 and showSess12
- boxPaint(str12,htfOpenTime12,htfCloseTime12,boxArr12,col12)
- if dayofweek(time, userTimezone) ==4 and not (dayofweek(time, userTimezone) ==4)[1]
- boxReposition(boxArr9)
- boxReposition(boxArr10)
- boxReposition(boxArr11)
- boxReposition(boxArr12)
- //THURSDAY
- showSess13 =input.bool(true, "", group = "Thursday", inline='1')
- inputSession13 = input.session('0100-0900', title='', group = "Thursday", inline='1')
- col13 = input.color(color.new(color.orange, 85), title ="", group = "Thursday", inline='1')
- str13 =input.string("", "| text:", group = "Thursday", inline='1')
- showSess14 =input.bool(true, "", group = "Thursday", inline='2')
- inputSession14 = input.session('0900-1300', title='', group = "Thursday", inline='2')
- col14 = input.color(color.new(color.lime, 85), title ="", group = "Thursday", inline='2')
- str14 =input.string("", "| text:", group = "Thursday", inline='2')
- showSess15 =input.bool(true, "", group = "Thursday", inline='3')
- inputSession15 = input.session('1300-1400', title='', group = "Thursday", inline='3')
- col15 = input.color(color.new(color.fuchsia, 85), title ="", group = "Thursday", inline='3')
- str15 =input.string("", "| text:", group = "Thursday", inline='3')
- showSess16 =input.bool(true, "", group = "Thursday", inline='4')
- inputSession16 = input.session('1500-1800', title='', group = "Thursday", inline='4')
- col16 = input.color(color.new(color.red, 85), title ="", group = "Thursday", inline='4')
- str16 =input.string("", "| text:", group = "Thursday", inline='4')
- inSession13 = inSess(inputSession13)
- inSession14 = inSess(inputSession14)
- inSession15 = inSess(inputSession15)
- inSession16 = inSess(inputSession16)
- float htfClose13=close(inSession13)
- int htfCloseTime13 = ta.valuewhen(close==htfClose13 and inSession13,time,0)
- int htfOpenTime13 = openTime(inSession13)
- float htfClose14 =close(inSession14)
- int htfCloseTime14 = ta.valuewhen(close==htfClose14 and inSession14,time,0)
- int htfOpenTime14 = openTime(inSession14)
- float htfClose15 =close(inSession15)
- int htfCloseTime15 = ta.valuewhen(close==htfClose15 and inSession15,time,0)
- int htfOpenTime15 = openTime(inSession15)
- float htfClose16 =close(inSession16)
- int htfCloseTime16 = ta.valuewhen(close==htfClose16 and inSession16,time,0)
- int htfOpenTime16 = openTime(inSession16)
- if not inSession13 and inSession13[1] and dayofweek(htfOpenTime13,userTimezone ) ==5 and showSess13
- boxPaint(str13,htfOpenTime13,htfCloseTime13,boxArr13,col13)
- if not inSession14 and inSession14[1] and dayofweek(htfOpenTime14,userTimezone ) ==5 and showSess14
- boxPaint(str14,htfOpenTime14,htfCloseTime14,boxArr14,col14)
- if not inSession15 and inSession15[1] and dayofweek(htfOpenTime15,userTimezone ) ==5 and showSess15
- boxPaint(str15,htfOpenTime15,htfCloseTime15,boxArr15,col15)
- if not inSession16 and inSession16[1] and dayofweek(htfOpenTime16,userTimezone ) ==5 and showSess16
- boxPaint(str16,htfOpenTime16,htfCloseTime16,boxArr16,col16)
- if dayofweek(time, userTimezone) ==5 and not (dayofweek(time, userTimezone) ==5)[1]
- boxReposition(boxArr13)
- boxReposition(boxArr14)
- boxReposition(boxArr15)
- boxReposition(boxArr16)
- //FRIDAY
- showSess17 =input.bool(true, "", group = "Friday", inline='1')
- inputSession17 = input.session('0600-0800', title='', group = "Friday", inline='1')
- col17 = input.color(color.new(color.gray, 85), title ="", group = "Friday", inline='1')
- str17 =input.string("", "| text:", group = "Friday", inline='1')
- showSess18 =input.bool(true, "", group = "Friday", inline='2')
- inputSession18 = input.session('0900-1400', title='', group = "Friday", inline='2')
- col18 = input.color(color.new(color.blue, 85), title ="", group = "Friday", inline='2')
- str18 =input.string("", "| text:", group = "Friday", inline='2')
- showSess19 =input.bool(true, "", group = "Friday", inline='3')
- inputSession19 = input.session('1400-1500', title='', group = "Friday", inline='3')
- col19 = input.color(color.new(color.maroon, 85), title ="", group = "Friday", inline='3')
- str19 =input.string("", "| text:", group = "Friday", inline='3')
- showSess20 =input.bool(true, "", group = "Friday", inline='4')
- inputSession20 = input.session('1500-1600', title='', group = "Friday", inline='4')
- col20 = input.color(color.new(color.red, 85), title ="", group = "Friday", inline='4')
- str20 =input.string("", "| text:", group = "Friday", inline='4')
- inSession17 = inSess(inputSession17)
- inSession18 = inSess(inputSession18)
- inSession19 = inSess(inputSession19)
- inSession20 = inSess(inputSession20)
- float htfClose17=close(inSession17)
- int htfCloseTime17 = ta.valuewhen(close==htfClose17 and inSession17,time,0)
- int htfOpenTime17 = openTime(inSession17)
- float htfClose18 =close(inSession18)
- int htfCloseTime18 = ta.valuewhen(close==htfClose18 and inSession18,time,0)
- int htfOpenTime18 = openTime(inSession18)
- float htfClose19 =close(inSession19)
- int htfCloseTime19 = ta.valuewhen(close==htfClose19 and inSession19,time,0)
- int htfOpenTime19 = openTime(inSession19)
- float htfClose20 =close(inSession20)
- int htfCloseTime20 = ta.valuewhen(close==htfClose20 and inSession20,time,0)
- int htfOpenTime20 = openTime(inSession20)
- if not inSession17 and inSession17[1] and dayofweek(htfOpenTime17,userTimezone ) ==6 and showSess17
- boxPaint(str17,htfOpenTime17,htfCloseTime17,boxArr17,col17)
- if not inSession18 and inSession18[1] and dayofweek(htfOpenTime18,userTimezone ) ==6 and showSess18
- boxPaint(str18,htfOpenTime18,htfCloseTime18,boxArr18,col18)
- if not inSession19 and inSession19[1] and dayofweek(htfOpenTime19,userTimezone ) ==6 and showSess19
- boxPaint(str19,htfOpenTime19,htfCloseTime19,boxArr19,col19)
- if not inSession20 and inSession20[1] and dayofweek(htfOpenTime20,userTimezone ) ==6 and showSess20
- boxPaint(str20,htfOpenTime20,htfCloseTime20,boxArr20,col20)
- if dayofweek(time, userTimezone) ==6 and not (dayofweek(time, userTimezone) ==6)[1]
- boxReposition(boxArr17)
- boxReposition(boxArr18)
- boxReposition(boxArr19)
- boxReposition(boxArr20)
- //SATURDAY
- showSess21 =input.bool(true, "", group = "Saturday", inline='1')
- inputSession21 = input.session('0100-0900', title='', group = "Saturday", inline='1')
- col21 = input.color(color.new(color.red, 85), title ="", group = "Saturday", inline='1')
- str21 =input.string("", "| text:", group = "Saturday", inline='1')
- showSess22 =input.bool(true, "", group = "Saturday", inline='2')
- inputSession22 = input.session('1000-1400', title='', group = "Saturday", inline='2')
- col22 = input.color(color.new(color.green, 85), title ="", group = "Saturday", inline='2')
- str22 =input.string("", "| text:", group = "Saturday", inline='2')
- showSess23 =input.bool(true, "", group = "Saturday", inline='3')
- inputSession23 = input.session('1400-1500', title='', group = "Saturday", inline='3')
- col23 = input.color(color.new(color.blue, 85), title ="", group = "Saturday", inline='3')
- str23 =input.string("", "| text:", group = "Saturday", inline='3')
- showSess24 =input.bool(true, "", group = "Saturday", inline='4')
- inputSession24 = input.session('1500-1700', title='', group = "Saturday", inline='4')
- col24 = input.color(color.new(color.orange, 85), title ="", group = "Saturday", inline='4')
- str24 =input.string("", "| text:", group = "Saturday", inline='4')
- inSession21 = inSess(inputSession21)
- inSession22 = inSess(inputSession22)
- inSession23 = inSess(inputSession23)
- inSession24 = inSess(inputSession24)
- float htfClose21=close(inSession21)
- int htfCloseTime21 = ta.valuewhen(close==htfClose21 and inSession21,time,0)
- int htfOpenTime21 = openTime(inSession21)
- float htfClose22 =close(inSession22)
- int htfCloseTime22 = ta.valuewhen(close==htfClose22 and inSession22,time,0)
- int htfOpenTime22 = openTime(inSession22)
- float htfClose23 =close(inSession23)
- int htfCloseTime23 = ta.valuewhen(close==htfClose23 and inSession23,time,0)
- int htfOpenTime23 = openTime(inSession23)
- float htfClose24 =close(inSession24)
- int htfCloseTime24 = ta.valuewhen(close==htfClose24 and inSession24,time,0)
- int htfOpenTime24 = openTime(inSession24)
- if not inSession21 and inSession21[1] and dayofweek(htfOpenTime21,userTimezone ) ==7 and showSess21
- boxPaint(str21,htfOpenTime21,htfCloseTime21,boxArr21,col21)
- if not inSession22 and inSession22[1] and dayofweek(htfOpenTime22,userTimezone ) ==7 and showSess22
- boxPaint(str22,htfOpenTime22,htfCloseTime22,boxArr22,col22)
- if not inSession23 and inSession23[1] and dayofweek(htfOpenTime23,userTimezone ) ==7 and showSess23
- boxPaint(str23,htfOpenTime23,htfCloseTime23,boxArr23,col23)
- if not inSession24 and inSession24[1] and dayofweek(htfOpenTime24,userTimezone ) ==7 and showSess24
- boxPaint(str24,htfOpenTime24,htfCloseTime24,boxArr24,col24)
- if dayofweek(time, userTimezone) ==7 and not (dayofweek(time, userTimezone) ==7)[1]
- boxReposition(boxArr21)
- boxReposition(boxArr22)
- boxReposition(boxArr23)
- boxReposition(boxArr24)
- //SUNDAY
- showSess25 =input.bool(true, "", group = "Sunday", inline='1')
- inputSession25 = input.session('0700-1100', title='', group = "Sunday", inline='1')
- col25 = input.color(color.new(color.olive, 85), title ="", group = "Sunday", inline='1')
- str25 =input.string("", "| text:", group = "Sunday", inline='1')
- showSess26 =input.bool(true, "", group = "Sunday", inline='2')
- inputSession26 = input.session('1200-1400', title='', group = "Sunday", inline='2')
- col26 = input.color(color.new(color.fuchsia, 85), title ="", group = "Sunday", inline='2')
- str26 =input.string("", "| text:", group = "Sunday", inline='2')
- showSess27 =input.bool(true, "", group = "Sunday", inline='3')
- inputSession27 = input.session('1400-1500', title='', group = "Sunday", inline='3')
- col27 = input.color(color.new(color.red, 85), title ="", group = "Sunday", inline='3')
- str27 =input.string("", "| text:", group = "Sunday", inline='3')
- showSess28 =input.bool(true, "", group = "Sunday", inline='4')
- inputSession28 = input.session('1700-1900', title='', group = "Sunday", inline='4')
- col28 = input.color(color.new(color.green, 85), title ="", group = "Sunday", inline='4')
- str28 =input.string("", "| text:", group = "Sunday", inline='4')
- inSession25 = inSess(inputSession25)
- inSession26 = inSess(inputSession26)
- inSession27 = inSess(inputSession27)
- inSession28 = inSess(inputSession28)
- float htfClose25=close(inSession25)
- int htfCloseTime25 = ta.valuewhen(close==htfClose25 and inSession25,time,0)
- int htfOpenTime25 = openTime(inSession25)
- float htfClose26 =close(inSession26)
- int htfCloseTime26 = ta.valuewhen(close==htfClose26 and inSession26,time,0)
- int htfOpenTime26 = openTime(inSession26)
- float htfClose27 =close(inSession27)
- int htfCloseTime27 = ta.valuewhen(close==htfClose27 and inSession27,time,0)
- int htfOpenTime27 = openTime(inSession27)
- float htfClose28 =close(inSession28)
- int htfCloseTime28 = ta.valuewhen(close==htfClose28 and inSession28,time,0)
- int htfOpenTime28 = openTime(inSession28)
- if not inSession25 and inSession25[1] and dayofweek(htfOpenTime25,userTimezone ) ==1 and showSess25
- boxPaint(str25,htfOpenTime25,htfCloseTime25,boxArr25,col25)
- if not inSession26 and inSession26[1] and dayofweek(htfOpenTime26,userTimezone ) ==1 and showSess26
- boxPaint(str26,htfOpenTime26,htfCloseTime26,boxArr26,col26)
- if not inSession27 and inSession27[1] and dayofweek(htfOpenTime27,userTimezone ) ==1 and showSess27
- boxPaint(str27,htfOpenTime27,htfCloseTime27,boxArr27,col27)
- if not inSession28 and inSession28[1] and dayofweek(htfOpenTime28,userTimezone ) ==1 and showSess28
- boxPaint(str28,htfOpenTime28,htfCloseTime28,boxArr28,col28)
- if dayofweek(time, userTimezone) ==1 and not (dayofweek(time, userTimezone) ==1)[1]
- boxReposition(boxArr25)
- boxReposition(boxArr26)
- boxReposition(boxArr27)
- boxReposition(boxArr28)
Advertisement
Add Comment
Please, Sign In to add comment